CVS: cvs.openbsd.org: src
David Gwynne <[email protected]>
| Newsgroups | gmane.os.openbsd.cvs |
|---|---|
| Message-ID | <[email protected]> |
CVSROOT: /cvs Module name: src Changes by: [email protected] 2026/07/06 23:39:05 Modified files: sys/net : pipex.c Log message: don't assume an ipv4 header is always 20 bytes. as reported by SecBuddyF, Tencent KeenLab: > OpenBSD's pipex PPTP GRE packet handling uses a fixed GRE/IP header > length check before later reading the GRE header at an offset derived > from the actual IPv4 header length. > > When IPv4 options are present, the dynamic IPv4 header length can > be larger than 20 bytes. A short GRE packet can therefore pass the > fixed 28-byte PIPEX_IPGRE_HDRLEN check while still being too short > for the later m_copydata(m0, hlen, sizeof(gre), &gre) read. > > This can trigger: > > panic: m_copydata: null mbuf > > The issue is remotely triggerable when GRE and pipex are enabled > and inbound IPv4 GRE packets with IP options are allowed to reach > the target. they identified the problem in pipex_pptp_lookup_session() and suggested a minimal fix, but i reimplemented it to make it more like other code in the tree. also, there were similar issues in pipex_pptp_input() which i'm also fixing while here. testing and ok yasuoak@