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

targbhctor leaks the softc when targbhenlun() fails: cam_periph_alloc() never calls the dtor on ctor failure

Summary

The ctor owns the softc allocation but delegates its status to enlun; cam_periph_alloc's failure ladder frees the periph WITHOUT calling periph_dtor, so the softc leaks on every failed attach - and the INOT-failure exit's dislun never checks XPT_ABORT status, so an abort-refusing SIM leaves armed ATIOs referencing the periph being freed (speculative periph-UAF on completion). Config-gated (option targbh + target-mode SIM). Self-cleaning-ctor fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

Fix verification

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

Confirmed kernel references

Detail

Evidence (decisive lines)

static branch-by-branch trace + cam_periph.c failure-ladder trace

Verified recommended fix

see finding markdown

Verdict

untested (Low/Info; config-gated behind option targbh + target-mode SIM)