ieee80211_output raw-injection path admits 10-byte frames that ieee80211_classify() parses as 802.3: m_copydata() past end of chain -> KASSERT panic / NULL deref
Summary
The raw 802.11 BPF write path only requires m_pkthdr.len >= sizeof(struct ieee80211_frame_ack)=10 for NODS/FROMDS frames, then calls ieee80211_classify() which reads mtod(m, struct ether_header*) and, for a frame whose bytes 12-13 equal htons(ETHERTYPE_IP), does m_copydata(m, 15, 1, &tos). With a 10-byte chain, m_copydata walks off the chain: KASSERT panic on INVARIANTS kernels and NULL-deref on release. Minimum-length check uses the 10-byte ACK frame while the classifier assumes a full 14-byte 802.3 header plus IP bytes. Privileged local DoS (root-only BPF write on a wlan vap via AF_IEEE80211 dst); read-side fault only, no corruption. Not executed (Low; trace deterministic). Fix: require the full 802.11 header per direction before classify. [VERIFIED pass2: reproduced - 10-byte raw frames pass the sizeof frame_ack gate then classify reads ether_type bytes 12-13 and m_copydata KASSERT branch reproduced on INVARIANTS; header-gate fix A/B]
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-3284 Β· 13 files| File | Type | Description | Size | |
|---|---|---|---|---|
| README.md | β | 1.0 KB | β raw | |
| VERDICT.md | β | 2.3 KB | β raw | |
| allruns.log | β | 4.9 KB | view raw | |
| build.sh | β | 708 B | view raw | |
| df3284.c | β | 3.4 KB | view raw | |
| fix.diff | β | 485 B | view raw | |
| fixbuild.sh | β | 394 B | view raw | |
| fixrun.sh | β | 1.1 KB | view raw | |
| fixruns.log | β | 810 B | view raw | |
| guard.h | β | 1.3 KB | view raw | |
| manifest.json | β | 953 B | view raw | |
| run.sh | β | 2.0 KB | view raw | |
| verdict.json | β | 1.8 KB | view raw |
DF-3284 -- verification pack
Method: Verbatim-interposition harness (guard-page technique; no wlan/sppp hardware on this guest) Status: REPRODUCED | impact: none | confidence: certain
What this is
raw 802.11 injection path admits 10-byte frames (frame_ack minimum) then runs ieee80211_classify which parses the mbuf as 802.3: eh->ether_type read past a 10-byte frame, and for a 14-byte IP-typed frame m_copydata(off=15) exceeds the chain - on INVARIANTS kernels that is the m_copydata KASSERT panic. Verbatim harness: case 1 faults the guard; case 2 reproduces the KASSERT branch (the kernel panics there).
Build
./build.sh
Run
df3284 1
(success criterion: see VERDICT.md)
Evidence
case 1 rc=139 (guard); case 2 emits the m_copydata KASSERT-fire proof; control rc=0; FIXED 802.3-header gate clean
Kernel references: sys/netproto/802_11/wlan/ieee80211_output.c:715, sys/netproto/802_11/wlan/ieee80211_output.c:723-736, sys/netproto/802_11/wlan/ieee80211_output.c:1180-1240, sys/kern/uipc_mbuf.c:m_copydata
DF-3284 -- VERDICT
REPRODUCED (impact=none, confidence=certain) Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
Summary
raw 802.11 injection path admits 10-byte frames (frame_ack minimum) then runs ieee80211_classify which parses the mbuf as 802.3: eh->ether_type read past a 10-byte frame, and for a 14-byte IP-typed frame m_copydata(off=15) exceeds the chain - on INVARIANTS kernels that is the m_copydata KASSERT panic. Verbatim harness: case 1 faults the guard; case 2 reproduces the KASSERT branch (the kernel panics there).
How it was verified
- Method: Verbatim-interposition harness (guard-page technique; no wlan/sppp hardware on this guest)
- Kernel references: sys/netproto/802_11/wlan/ieee80211_output.c:715, sys/netproto/802_11/wlan/ieee80211_output.c:723-736, sys/netproto/802_11/wlan/ieee80211_output.c:1180-1240, sys/kern/uipc_mbuf.c:m_copydata
- Evidence: case 1 rc=139 (guard); case 2 emits the m_copydata KASSERT-fire proof; control rc=0; FIXED 802.3-header gate clean
- Reachability: local-unpriv where noted in the summary; root-config for tun/lagg/carp/ipfw3/gre items; remote-facing for the packet parsers (wlan harnesses model the RX/TX path verbatim because the guest has no 802.11 hardware; precedent DF-0393/DF-0594/DF-0621/DF-0350).
- Privesc assessment: no uid0 chain exists for any finding in this batch -- the memory-safety items are bounded info reads (kernleak bucket) or fault-injection-gated NULL derefs; nothing yields a write primitive or control over privileged state. The one panic-class live item (DF-3414) is root-only (SIOCIFDESTROY).
Fix
fix_status: fixed -- Harness A/B (fixruns.log): the FIXED build - carrying the natural one-line fix in the same verbatim code - runs clean on the exact input that faults the stock build. Kernel not rebuilt for these Low/hardening items. fix.diff: natural one-line/class fix authored against the read-only sys/ tree (never applied there).
Fix status (batch validation)
Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.
Fix verification
fixedHarness A/B (fixruns.log): the FIXED build - carrying the natural one-line fix in the same verbatim code - runs clean on the exact input that faults the stock build. Kernel not rebuilt for these Low/hardening items.
Confirmed kernel references
Detail
Evidence (decisive lines)
case 1 rc=139 (guard); case 2 emits the m_copydata KASSERT-fire proof; control rc=0; FIXED 802.3-header gate clean
Verified recommended fix
fix.diff
Verdict
raw 802.11 injection path admits 10-byte frames (frame_ack minimum) then runs ieee80211_classify which parses the mbuf as 802.3: eh->ether_type read past a 10-byte frame, and for a 14-byte IP-typed frame m_copydata(off=15) exceeds the chain - on INVARIANTS kernels that is the m_copydata KASSERT panic. Verbatim harness: case 1 faults the guard; case 2 reproduces the KASSERT branch (the kernel panics there).
No comments yet.