⬢ DragonFlyBSD Kernel Audit
DF-4538 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-4538",
  "status": "untested",
  "reproduced": 0,
  "impact": "none",
  "confidence": "certain",
  "verdict": "cs4281_pci_detach() (cs4281.c:878-901) releases the BA0 register window (cs4281.c:893) and BA1 memory window (cs4281.c:894) before bus_teardown_intr() (cs4281.c:895), while cs4281_intr -- installed at cs4281.c:812 on a shareable IRQ (cs4281.c:805-806) -- bus_space-reads HISR/HDSR through exactly those mappings on every dispatch (cs4281.c:517,523,528) and pcm_unregister() (cs4281.c:884) does not unregister it. An interrupt arriving in the release window dispatches into released rman mappings: use-after-release, typical outcome panic. The bad: attach-unwind repeats the same inverted order (cs4281.c:867-870). Sibling es137x.c:1917-1919 demonstrates the correct teardown-first order. Untested: executing detach at all requires a CS4281 PCI function (absent on the audit guest, env.txt) and root (kldunload); the race window needs an interrupt arrival. Root-gated, hardware-gated: Low, analysis certain.",
  "exploit_chain": "",
  "evidence": "findings/poc/DF-4538/VERDICT.md; cs4281.c:812 snd_setup_intr, cs4281.c:805-806 RF_SHAREABLE, cs4281.c:517/523/528 ISR register reads, cs4281.c:893-895 inverted release order, cs4281.c:867-870 same order in bad:, es137x.c:1917-1919 correct sibling order; run.log/env.txt (no vendor-1013 PCI function on guest)",
  "kernel_refs": [
    "sys/dev/sound/pci/cs4281.c:812",
    "sys/dev/sound/pci/cs4281.c:805",
    "sys/dev/sound/pci/cs4281.c:517",
    "sys/dev/sound/pci/cs4281.c:893",
    "sys/dev/sound/pci/cs4281.c:895",
    "sys/dev/sound/pci/cs4281.c:867",
    "sys/dev/sound/pci/es137x.c:1917"
  ],
  "poc_changes": "no seed; environment probe shared with DF-4537 (same trigger-hardware absence)",
  "attempts": 1,
  "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul  2 06:02:54 UTC 2026     root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64",
  "runtime_sec": 6,
  "guest_dirty": 0,
  "build_cmd": "cc -O -Wall -o /root/cs4281_probe /root/cs4281_probe.c",
  "run_cmd": "/root/cs4281_probe; pciconf -l | grep -i 1013 || echo no vendor-1013 PCI function (detach path unreachable)",
  "code_hash": "19c94f1b781ac9af341782f14e78bc816a96515adcfa4f6ff6c1ebaef2c63dfb",
  "notes": "Found in pass 2 via the detach leg of the sound-family checklist; pass 1 filed nothing on this path. The same inverted order exists in the bad: unwind, folded into this finding (same fix locus).",
  "recommended_fix": "In cs4281_pci_detach (and the bad: unwind), call bus_teardown_intr and release the IRQ before releasing the BA0/BA1 register resources, matching es137x.c:1917-1919",
  "fix_status": "not_testable",
  "fix_baseline_reproduced": 0,
  "fix_patched_reproduced": 0,
  "fix_verdict": "fix.diff moves bus_teardown_intr() and the IRQ release ahead of the BA0/BA1 register releases in cs4281_pci_detach(); git apply --check is clean. Not observable on the audit guest (no CS4281 hardware), so baseline vs patched cannot be compared.",
  "fix_evidence": "findings/poc/DF-4538/fix.diff; correct sibling order at es137x.c:1917-1919"
}