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

acpi_ec: ec_sci_pend publication race between EcGpeHandler and EcGpeQueryHandler permanently disables the EC GPE (lost AcpiFinishGpe)

Summary

EcGpeHandler queues the query handler via AcpiOsExecute (an async LWKT sendmsg) and returns 0 - transferring the GPE re-enable duty - but publishes ec_sci_pend=TRUE only AFTER the enqueue returns. The helper thread can sample sci_enqueued==FALSE, skip AcpiFinishGpe, and the GPE stays disabled forever: all future EC SCI events (lid, hotkeys, battery/AC/thermal) permanently lost until reboot. Unpriv battery sysctl reads open the window repeatedly. Flag-before-enqueue fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean

not_testable

set-flag-before-enqueue + rollback-on-failure diff in finding markdown
per-fix-DF-4490

Confirmed kernel references

Detail

Exploit chain

[]

Evidence (decisive lines)

ec_sci_pend published after the async LWKT sendmsg enqueue; consumer can sample FALSE, skip AcpiFinishGpe, and the GPE handler's return 0 leaves the GPE disabled forever (ACPICA contract evgpe.c:1023-1037). Low availability race; QEMU guest DSDT has no PNP0C09 so acpi_ec never attaches there (verified live).

Verdict

not_run: Low availability race, hardware-gated on guest (no EC device)