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

adhoc_input pre-dispatch block reads i_addr2/i_seq/i_qos with only frame_min (10 bytes) guaranteed for dir!=NODS frames β€” unfiled IBSS mirror of DF-3342 (sta_input) / DF-3325

Summary

In adhoc_input(), the not-scanning pre-dispatch block only enforces the >=24-byte length re-check inside the NODS/non-CTL branch before touching i_addr3. The dir!=NODS branch takes bssid from i_addr1 (in-bounds) but then reads wh->i_addr2 (node-fakeup test, duplicate-sequence gate) and for HAS_SEQ frames calls ieee80211_gettid (reads i_qos at offset 24/30) and ieee80211_check_rxseq (reads i_seq at 22-23) - all with only the frame_min (10-byte) guarantee. A TODS/FROMDS frame of length 10..23 makes these reads run up to 16 bytes past the packet length into stale mbuf contents. Consequences: neighbor-table entries created from recycled mbuf bytes (fakeup_adhoc_node consumes the OOB i_addr2) and rxseq dedup keyed on OOB bytes. The common entry dispatches directly to iv_input with no hdrspace pullup - adhoc_input's own checks are the only guard, exactly like the filed sta_input twin DF-3342. Intra-mbuf stale-byte reads, no content disclosure (node dump requires root). Not runnable on the audit guest (no 802.11 hardware; family precedent DF-3342/3325 filed code-trace). Fix: hoist the >=24-byte check above the i_addr2 consumers (CTL exempt). [VERIFIED pass2: reproduced via guard harness - IBSS mirror of DF-3325 faults on the 10-byte TODS QoS frame; header-gate fix A/B]

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3416 Β· 13 files
FileTypeDescriptionSize
README.md β€” 536 B ↓ raw
VERDICT.md β€” 1.8 KB ↓ raw
allruns.log β€” 4.9 KB view raw
build.sh β€” 708 B view raw
dfpredispatch.c β€” 4.5 KB view raw
fix.diff β€” 591 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 β€” 749 B view raw
run.sh β€” 2.0 KB view raw
verdict.json β€” 1.3 KB view raw

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

adhoc_input pre-dispatch mirror of DF-3325/3342 (IBSS). Same verbatim harness compiled -DADHOC.

Build

./build.sh

Run

df3416 oob

(success criterion: see VERDICT.md)

Evidence

identical to DF-3325 (df3416 binary in allruns.log)

Kernel references: sys/netproto/802_11/wlan/ieee80211_adhoc.c:356-421

VERDICT.md
↓ download raw

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

adhoc_input pre-dispatch mirror of DF-3325/3342 (IBSS). Same verbatim harness compiled -DADHOC.

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_adhoc.c:356-421
  • Evidence: identical to DF-3325 (df3416 binary in allruns.log)
  • 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-3416

Confirmed kernel references

Detail

Evidence (decisive lines)

identical to DF-3325 (df3416 binary in allruns.log)

Verified recommended fix

fix.diff

Verdict

adhoc_input pre-dispatch mirror of DF-3325/3342 (IBSS). Same verbatim harness compiled -DADHOC.