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

Detach does not drain AcpiOsExecute callbacks: stale softc use-after-free (latent, AcpiOsWaitEventsComplete is no-op stub)

Summary

acpi_cmbat_attach L154/resume L174/notify L202 queue async AcpiOsExecute(acpi_cmbat_init_battery/get_bif_task,dev) running up to ~60s in taskq. acpi_cmbat_init_battery captures sc=device_get_softc(dev) ONCE L450 BEFORE retry loop sleeps AcpiOsSleep(10000) L459 holding stale sc. device_is_attached(dev) check L461 outside any lock TOCTOU. acpi_cmbat_detach L159-168 does NOT drain callbacks; AcpiOsWaitEventsComplete() is empty stub acdragonfly.h:218-220 XXX TBI. Root kldunload acpi_cmbat or physical battery hot-unplug _BIF_CHANGE notify before detach. Stale-pointer deref in taskq -> kernel panic. Unprivileged local has no path. Same pattern acpi_smbat.c no detach. Fix: per-softc dying flag set under cmbat serial lock in detach; re-check inside lock in init_battery; implement AcpiOsWaitEventsComplete for real.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1941 Β· 1 files
FileTypeDescriptionSize
manifest.json file 397 B view raw

Fix verification

not_testable
baseline reproduced→ patch + rebuild →patched clean

recommended fix identified; fix.diff not authored/validated in this batch

recommended fix identified; fix.diff not authored/validated in this batch
combined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Info severity)

Evidence (decisive lines)

Source-confirmed at sys/dev/acpica/acpi_cmbat.c:154: detach does not drain AcpiOsExecute callbacks (stale softc UAF, latent)

Verified recommended fix

Source-confirmed at sys/dev/acpica/acpi_cmbat.c:154: detach does not drain AcpiOsExecute callbacks (stale softc UAF, latent)

Verdict

Source-confirmed at sys/dev/acpica/acpi_cmbat.c:154: detach does not drain AcpiOsExecute callbacks (stale softc UAF, latent)