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

NULL deref / panic in bwn_dma_parse_cookie on unexpected TX-status cookie

Summary

bwn_dma_parse_cookie at if_bwn.c:7081-7087: default case sets dr=NULL with only debug KASSERT, then falls through to :7086-7087 dereferencing dr->dr_numslots while dr is still NULL. PIO sibling bwn_pio_parse_cookie has correct pattern (KASSERT then if(tq==NULL) return NULL at :6751-6752). Requires firmware bug/hardware fault/corrupt TX-status FIFO to trigger. Kernel panic. Fix: add if(dr==NULL) return NULL after the switch.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1132 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-1132 641 B ↓ raw
fix.diff suggested-fix Add if(dr==NULL) return NULL after default case in bwn_dma_parse_cookie 371 B view raw
../fix_build.log build-log Batch kernel build log (all fixes, rc=0) 5.6 MB ↓ download
VERDICT.md verdict Source-confirmation verdict for DF-1132
↓ download raw

DF-1132 Verification Verdict

Severity: Low Impact class: panic Verification method: Source-only confirmation (HW-gated, not triggerable on QEMU guest)

Verdict: REPRODUCED (source-confirmed)

The bug is confirmed in the audited source at the cited path:line. Triggerable but requires specific driver/config.

Fix applied and validated in batch kernel build (rc=0, -Werror).

Fix validation

All 41-fix patches batched into single make -j6 nativekernel KERNCONF=X86_64_GENERIC build. Build result: rc=0, 0 errors (full -Werror clean).

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.

VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none

Evidence (decisive lines)

REPRODUCED (source-only): bwn_dma_parse_cookie default case sets dr=NULL with only debug KASSERT, then falls through to dereference dr->dr_numslots. NULL deref panic.

Verified recommended fix

REPRODUCED (source-only): bwn_dma_parse_cookie default case sets dr=NULL with only debug KASSERT, then falls through to dereference dr->dr_numslots. NULL deref panic.

Verdict

REPRODUCED (source-only): bwn_dma_parse_cookie default case sets dr=NULL with only debug KASSERT, then falls through to dereference dr->dr_numslots. NULL deref panic.