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

freerd_state allocation prologue runs unlocked and is reachable from two threads concurrently β€” orphaned kdmsg_state leak

Summary

The freerd_state prologue reads/kmallocs/assigns iocom->freerd_state BEFORE acquiring msglk, justified by a comment claiming no races β€” false: kdmsg_state_abort releases msglk and calls kdmsg_state_msgrx from the WRITER thread (deferred aborts in cleanuptx and drain paths), so both threads can execute the unlocked prologue simultaneously. Interleaving read-NULL/alloc/write loses one update and permanently orphans a fully-initialized state (refs=1, no pointer) β€” a 160-byte leak the peer can provoke by racing teardown traffic against new commands. No corruption possible (the under-lock handoff is serialized β€” a state can only be leaked, never double-used). Move-population-under-msglk fix proposed. Code-path proof only (Low).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean
per-fix-DF-5827

Confirmed kernel references

Detail

Evidence (decisive lines)

static trace; cross-refs in DF-5825 evidence pack

Verified recommended fix

populate freerd_state under msglk

Verdict

untested (Info/Low hardening or race-bound leak - Phase V not applicable or not economical per contract; DF-5825 pack carries the transport proof)