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

Use-after-free race: unprivileged bktr ioctls race privileged msp_detach and write into the freed msp3400c struct (no locking, admitted by 'XXX mutex lock required')

Summary

msp_detach frees client->msp3400c_info with no lock while msp_wake_thread - reached on every TVTUNER_SETCHNL/SETFREQ/SAUDIO ioctl from unpriv /dev/bktrN - re-reads the pointer, calls setvolume from freed state, writes watch_stereo/restart flags into freed memory, and wakeup()s the freed struct's kthread pointer. The code itself notes 'XXX mutex lock required' and the driver is documented not mp-safe. Free side needs a privileged kldunload/hot-unplug, hence Low. lockmgr-serialization fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-4419 Β· 1 files
FileTypeDescriptionSize
verdict.json file 1.3 KB view raw

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean

not_testable: no bt848 hardware

lockmgr serialization diff in finding markdown (msp_lock around detach handshake/kfree + wake paths with rmmod/kthread bail)
per-fix-DF-4419

Confirmed kernel references

Detail

Exploit chain

[]

Evidence (decisive lines)

Hardware-gated: requires bt848/MSP34xx card (none on QEMU guest) plus privileged kldunload as the free-side trigger. Source-trace proof in finding; pack seeded with minimal untested verdict.

Verdict

not_run: no bt848 hardware on guest; source-verified UAF window (driver admits 'XXX mutex lock required', not mp-safe)