kern/77111: After pppd establishes connection, if "options MAC"
is enabled in the kernel, kernel panic happens.
Wojciech A. Koszek
dunstan at freebsd.czest.pl
Mon Feb 14 16:30:32 PST 2005
The following reply was made to PR kern/77111; it has been noted by GNATS.
From: "Wojciech A. Koszek" <dunstan at freebsd.czest.pl>
To: bug-followup at 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 at 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+--
More information about the freebsd-bugs
mailing list