β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-3374

ieee80211_parse_csaparams consumes the CSA IE without validating its declared length: 2-3 byte read past IE/frame end drives channel-switch decisions on stale mbuf bytes (DF-3341/DF-0582 family)

Summary

The beacon path hands scan.csa straight to ieee80211_parse_csaparams whenever 802.11h/DOTH is enabled and the STA is associated. parse_beacon's walk only guarantees each IE's DECLARED payload is within the frame; no minimum for the CSA IE. parse_csaparams then reads csa_mode (offset 2), csa_newchan (3) and csa_count (4) via the packed struct cast with no check that frm[1] >= 3. A beacon from the BSSID carrying a CSA IE with len 0-2 as the LAST IE makes those reads land past efrm (mtod+m_len) - 2-3 bytes past the frame data into stale/uninitialized mbuf tail bytes. Unauthenticated radio attacker (spoofing the AP's BSSID, or as rogue AP): garbage values drive find_channel_byieee/csa_startswitch/cancelswitch - a spurious channel switch (connectivity loss) or cancellation of a legitimate CSA; bounded by CSA_COUNT_MIN and monotonic-count re-validation - best-effort DoS/state-confusion, no memory corruption, no disclosure. Phase V skipped (Low). Fix: require csa_len == 3 before consuming. [VERIFIED pass2: reproduced via guard harness - CSA IE parsed with no frm 1 check for len 1 and 2, channel-switch decision on stale bytes; len-ge-3 fix A/B]

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3374 Β· 13 files
FileTypeDescriptionSize
README.md β€” 865 B ↓ raw
VERDICT.md β€” 2.2 KB ↓ raw
allruns.log β€” 4.9 KB view raw
build.sh β€” 708 B view raw
df3374.c β€” 2.1 KB view raw
fix.diff β€” 297 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 β€” 903 B view raw
run.sh β€” 2.0 KB view raw
verdict.json β€” 1.6 KB view raw

DF-3374 -- 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

ieee80211_parse_csaparams consumes csa_mode/csa_newchan/csa_count with no frm[1] validation (caller passes scan.csa straight from the beacon walk). Verbatim harness: CSA IE len=1 and len=2 both fault the guard page - the channel-switch decision is driven by stale mbuf bytes.

Build

./build.sh

Run

df3374 1

(success criterion: see VERDICT.md)

Evidence

cases 1,2 rc=139; control (len=3) rc=0; FIXED length check clean

Kernel references: sys/netproto/802_11/wlan/ieee80211_sta.c:1146-1200, sys/netproto/802_11/wlan/ieee80211_sta.c:1472, sys/netproto/802_11/ieee80211.h:1063-1069, sys/netproto/802_11/wlan/ieee80211_input.c:565

VERDICT.md
↓ download raw

DF-3374 -- 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

ieee80211_parse_csaparams consumes csa_mode/csa_newchan/csa_count with no frm[1] validation (caller passes scan.csa straight from the beacon walk). Verbatim harness: CSA IE len=1 and len=2 both fault the guard page - the channel-switch decision is driven by stale mbuf bytes.

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_sta.c:1146-1200, sys/netproto/802_11/wlan/ieee80211_sta.c:1472, sys/netproto/802_11/ieee80211.h:1063-1069, sys/netproto/802_11/wlan/ieee80211_input.c:565
  • Evidence: cases 1,2 rc=139; control (len=3) rc=0; FIXED length check 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

fixed
baseline reproduced→ patch + rebuild →patched clean

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.diffper-fix-DF-3374

Confirmed kernel references

Detail

Evidence (decisive lines)

cases 1,2 rc=139; control (len=3) rc=0; FIXED length check clean

Verified recommended fix

fix.diff

Verdict

ieee80211_parse_csaparams consumes csa_mode/csa_newchan/csa_count with no frm[1] validation (caller passes scan.csa straight from the beacon walk). Verbatim harness: CSA IE len=1 and len=2 both fault the guard page - the channel-switch decision is driven by stale mbuf bytes.