From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 15 00:30:31 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE57D16A4CE for ; Tue, 15 Feb 2005 00:30:31 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA9C043D45 for ; Tue, 15 Feb 2005 00:30:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1F0ULEs027204 for ; Tue, 15 Feb 2005 00:30:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1F0ULwb027203; Tue, 15 Feb 2005 00:30:21 GMT (envelope-from gnats) Date: Tue, 15 Feb 2005 00:30:21 GMT Message-Id: <200502150030.j1F0ULwb027203@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Wojciech A. Koszek" Subject: Re: kern/77111: After pppd establishes connection, if "options MAC" is enabled in the kernel, kernel panic happens. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Wojciech A. Koszek" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2005 00:30:32 -0000 The following reply was made to PR kern/77111; it has been noted by GNATS. From: "Wojciech A. Koszek" To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/77111: After pppd establishes connection, if "options MAC" is enabled in the kernel, kernel panic happens. Date: Tue, 15 Feb 2005 00:32:24 +0000 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I'm not able to test it in working environment right now, but attached patch should correct this problem. Needs testing. The problem is that mac_check_ifnet_transmit() needs to have packet header in passed mbuf. This function is called from: pppwrite() -- pppoutput() -- mac_check_ifnet_transmit(). Attached patch should correct this problem. -- * Wojciech A. Koszek && dunstan@FreeBSD.czest.pl --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.0.ppp_tty.c" Patch against FreeBSD 5.3-STABLE, kern.osreldate: 503102. diff -upr /usr/src/sys/net/ppp_tty.c src/sys/net/ppp_tty.c --- /usr/src/sys/net/ppp_tty.c Sat Feb 12 09:36:38 2005 +++ src/sys/net/ppp_tty.c Tue Feb 15 00:29:38 2005 @@ -396,6 +396,16 @@ pppwrite(tp, uio, flag) splx(s); return (ENOBUFS); } + /* + * mbuf has to hold packet header in order to pass tests made by + * mac_check_ifnet_transmit() in pppoutput(), when MAC is present in + * the kernel. + */ + if (!(m->m_flags & M_PKTHDR)) { + m_free(m0); + splx(s); + return (EIO); + } m->m_len = 0; if (uio->uio_resid >= MCLBYTES / 2) MCLGET(m, M_DONTWAIT); --mYCpIKhGyMATD0i+--