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

mmc_rescan_cards()/mmc_delete_cards() free card ivars unconditionally after device_delete_child() β€” latent UAF if a child driver's detach ever fails

Summary

Both card-removal paths ignore device_delete_child's return and kfree(ivar) anyway - but DF's device_delete_child returns the detach error while leaving the child on the bus with ivars installed: the free leaves a live child pointing at freed ivars and the next pass double-frees. Latent (the only mmc child, mmcsd, cannot fail detach); any future child driver (SDIO, RPMB) returning EBUSY turns this into UAF+double-free. check-then-continue fix (the DF-5635 shape).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-5771 Β· 1 files
FileTypeDescriptionSize
verdict.json file 938 B view raw

Fix verification

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

Confirmed kernel references

Detail

Evidence (decisive lines)

static trace with path:line (DF-5768/5769 pack carries the rig)

Verified recommended fix

see finding

Verdict

untested (Low traced-only; leak-rate/virtual-driver precondition not rig-economical per contract)