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

iicbus ownership protocol is not MP-safe and mis-ordered: crit_enter gives no cross-CPU exclusion (double-acquire), and iicbus_release_bus frees the bridge resource BEFORE validating ownership (non-owner teardown of bridge exclusion)

Summary

The owner check-then-set runs under crit_enter, which on DF masks interrupts per-CPU only (IICBUS_LOCK is a no-op per DF-2313): two requesters on different CPUs can both observe owner==NULL and both set owner (both return 0 believing they own the bus). Compounding, release_bus performs the bridge-level release FIRST and validates ownership after: a non-owner drops the ppbus-level exclusion out from under the real owner, and the EACCES path skips wakeup entirely. Wire/protocol-level corruption of external devices (EEPROM/SMBus registers) on realistic SMP contention (/dev/iic0 vs /dev/smb0 vs ipmi_ssif); kernel-memory-safe. Inspection-proven (crit_enter semantics); the DF-5563 spinlock protocol fix covers it (validate-before-callback + unconditional wakeup).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

Fix verification

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

Confirmed kernel references

Detail

Evidence (decisive lines)

static: crit_enter per-CPU only (iiconf.c:100-108), release-before-validate (iiconf.c:131-140), IICBUS_LOCK no-op (iicbus.h:58-60)

Verified recommended fix

spinlock around owner check-and-set; validate owner before IICBUS_CALLBACK; unconditional wakeup

Verdict

untested (inspection-proven MP race; fix validated as part of the DF-5563 spinlock protocol build)