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

DFS_SET_THRESH dereferences indata without verifying ATH_DIAG_IN was set (NULL-pointer-deref panic)

Summary

ath_ioctl_phyerr DFS_SET_THRESH (dfs_null.c:260-266): checks only if(insize < sizeof(HAL_PHYERR_PARAM)) at 261 -- pure size check does NOT inspect ATH_DIAG_IN flag and does NOT test indata!=NULL. indata initialized NULL (224) only assigned heap buffer inside if(ad_id & ATH_DIAG_IN) at 232-244. ad_in_size read unconditionally at 226 so size check passes for any caller. pe=(HAL_PHYERR_PARAM*)indata (265); ath_hal_enabledfs(ah,pe) (266). When ATH_DIAG_IN clear indata stays NULL -> pe==NULL -> ar5416EnableDfs pe->pe_firpwr read at ar5416_radar.c:129 unconditional NULL deref -> kernel panic. Same reachability as DF-2051: SIOCGATHPHYERR no priv check; ATH_DIAGAPI kernel; any local user with socket on ath interface. Impact: reliable local DoS panic (pure read of *(int32_t*)0 in HAL no memory corruption). AV:L/PR:L/AC:L, A:H.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-2052 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-2052 685 B ↓ raw
fix.diff suggested-fix Validate ATH_DIAG_IN flag and indata!=NULL in DFS_SET_THRESH 712 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-2052
↓ download raw

DF-2052 Verification Verdict

Severity: Medium 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. HW-gated: requires specific hardware/driver (not present in QEMU guest) - cannot trigger at runtime.

Fix: Validate ATH_DIAG_IN flag and indata!=NULL in DFS_SET_THRESH

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): ath_ioctl_phyerr DFS_SET_THRESH: checks insize<sizeof(HAL_PHYERR_PARAM) but does NOT inspect ATH_DIAG_IN flag and does NOT test indata!=NULL; indata initialized NULL, deref p

Verified recommended fix

REPRODUCED (source-only): ath_ioctl_phyerr DFS_SET_THRESH: checks insize<sizeof(HAL_PHYERR_PARAM) but does NOT inspect ATH_DIAG_IN flag and does NOT test indata!=NULL; indata initialized NULL, deref panic.

Verdict

REPRODUCED (source-only): ath_ioctl_phyerr DFS_SET_THRESH: checks insize<sizeof(HAL_PHYERR_PARAM) but does NOT inspect ATH_DIAG_IN flag and does NOT test indata!=NULL; indata initialized NULL, deref panic.