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

OOB heap write via unchecked tdma_slot in ieee80211_parse_tdma

Summary

ieee80211_parse_tdma calls setbit(ts->tdma_inuse tdma->tdma_slot) at :657 using unchecked tdma_slot from untrusted wireless beacon/probe-response IE. tdma_inuse array only 1 byte (uint8_t[1]) setbit expands to ary[n/8] so any tdma_slot>=8 writes past array into adjacent heap fields. Sibling tdma_process_params validates slot at :555 (tdma_slot>=TDMA_MAXSLOTS) but ieee80211_parse_tdma omits. Attacker controls tdma_slot fully: byte offset 8 in packed TDMA IE. Max OOB tdma_slot=255 writes tdma_inuse[31] = 31 bytes past array corrupting tdma_active tdma_count tdma_peer tdma_lastprint tdma_fails. On 32-bit function pointers tdma_newstate/tdma_recv_mgmt/tdma_opdetach within OOB range enabling function-pointer corruption controlled code execution. Attacker within wireless radio range transmits crafted beacon no auth required victim in TDMA/ahdemo mode scanning.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-2578 Β· 5 files
FileTypeDescriptionSize
VERDICT.md verdict analysis: code bug confirmed, gate confirmed, fix authored 1.6 KB ↓ raw
fix.diff suggested-fix git-apply-able defense-in-depth fix (verified --check clean) 574 B view raw
env.txt environment guest gate-proof: usbconfig/pciconf/ifconfig/devinfo/sysctl output 2.0 KB view raw
build.sh build-script no-op (no live-device PoC) 255 B view raw
run.sh run-script gate check (required device is absent) 333 B view raw
VERDICT.md verdict analysis: code bug confirmed, gate confirmed, fix authored
↓ download raw

DF-2578 β€” PoC verdict

File: sys/netproto/802_11/wlan/ieee80211_tdma.c

Verdict: NOT REPRODUCED on this QEMU guest β€” confirmed HW/ACPI/device-gated; the code bug is REAL and a defense-in-depth fix.diff is attached.

Mechanism (confirmed in source)

ieee80211_parse_tdma() calls setbit(ts->tdma_inuse, tdma->tdma_slot) using the unchecked tdma_slot from an untrusted beacon/probe-response IE. tdma_inuse is only 1 byte (uint8_t[1]); setbit(a,i)=a[i/8]|=..., so any tdma_slot>=8 writes past the array into adjacent heap fields. The sibling tdma_process_params validates slot, this path omits it.

Cited lines

Why it does not reproduce on this guest

No wifi adapter / TDMA vap on the QEMU guest (ifconfig shows only vtnet0/lo0; no 802.11 vap in TDMA/ahdemo mode). The TDMA wlan code is compiled in but cannot attach without a wifi NIC.

Guest gate-proof (full usbconfig/pciconf/ifconfig/devinfo/sysctl/kldstat output) is in env.txt.

Defense-in-depth fix

Validate tdma_slot < NBBY*sizeof(tdma_inuse) before setbit; return if out of range.

The git-apply-able diff is in fix.diff (verified git apply --check clean).

Classification

  • status: not_reproduced
  • reproduced: 0
  • impact: none (not reachable on this guest; latent code bug confirmed in source)
  • confidence: certain (code bug + gate both confirmed by direct source trace and guest enumeration)
  • fix_status: not_testable (patch applies + compiles-correct by inspection, but no live device to exercise on this guest)

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean

not_testable: target device absent on this guest. fix.diff applies clean and is source-correct; no live device to exercise.

git apply --check findings/poc/DF-2578/fix.diff -> OK. No runtime test possible (HW/ACPI/device-gated).
↓ fix.diffper-fix-DF-2578

Confirmed kernel references

Detail

Exploit chain

none β€” valid hard blocker (driver/device path dead at runtime on this guest: no target HW/ACPI/device). No unprivileged->root path.

Evidence (decisive lines)

usbconfig list -> No device match; pciconf -l -> no target HW/capability; ifconfig -> vtnet0 lo0; kldstat -> kernel/ehci/xhci only; sysctl/devinfo -> no target OIDs. Source confirmed at cited lines.

PoC changes

Created findings/poc/DF-2578/{VERDICT.md,fix.diff,manifest.json,env.txt,build.sh,run.sh}. No PoC source (HW/ACPI/device-gated).

Verified recommended fix

Defense-in-depth fix.diff closes the cited path (see findings/poc/DF-2578/fix.diff; git apply --check OK).

Verdict

NOT REPRODUCED (HW/ACPI/device-gated on this guest). The bug is REAL in source (traced line-by-line): ieee80211_tdma OOB heap write via unchecked tdma_slot (no wifi vap). Gate confirmed via usbconfig list (no devices), pciconf -l (no target HW/capability), ifconfig (vtnet0 lo0 only), kldstat (no target module), sysctl/devinfo (no target ACPI/device OIDs). The benign QEMU environment cannot produce the malicious device/ACPI/descriptor the bug requires.