DF-4539 / verdict.json
{ "finding_id": "DF-4539", "status": "untested", "reproduced": 0, "impact": "none", "confidence": "certain", "verdict": "cs4281_pci_attach() ignores the return of mixer_init() (cs4281.c:845) and of both pcm_addchan() calls (cs4281.c:850-851), then reports the device healthy via pcm_setstatus (cs4281.c:856). If sndbuf_alloc() fails inside cs4281chan_init (cs4281.c:326-328) the embedded sc->pch/sc->rch keep parent==NULL (set only later at cs4281.c:329-337), and if mixer_init() fails snddev->mixer_dev stays NULL. A later suspend/resume then NULL-derefs twice: cs4281_pci_resume (cs4281.c:941-949) calls cs4281chan_setspeed -> adcdac_go (cs4281.c:474-479) -> cs4281_rd with sc==ch->parent==NULL (cs4281.c:146-150), and mixer_reinit (cs4281.c:935) derefs mixer_get_devt()s NULL return at mixer.c:828-829 (snddev->mixer_dev per mixer.c:118-124). Guaranteed panic when the half-attach condition holds; root-gated (ACPI suspend), plus resource-pressure precondition, so Low. Untested: needs a CS4281 PCI function whose attach half-fails then a suspend cycle; the audit guest has no vendor-1013 function (env.txt) so neither the failure legs nor suspend of this device can occur.", "exploit_chain": "", "evidence": "findings/poc/DF-4539/VERDICT.md; cs4281.c:845 ignored mixer_init, cs4281.c:850-851 ignored pcm_addchan, cs4281.c:326-337 early-return-before-parent-init, cs4281.c:941-949 unconditional resume restore, cs4281.c:474-479 adcdac_go parent deref, mixer.c:828-829 mixer_reinit NULL pdev, sound.c:1125-1141 pcm_addchan failure semantics; run.log/env.txt", "kernel_refs": [ "sys/dev/sound/pci/cs4281.c:845", "sys/dev/sound/pci/cs4281.c:850", "sys/dev/sound/pci/cs4281.c:326", "sys/dev/sound/pci/cs4281.c:329", "sys/dev/sound/pci/cs4281.c:941", "sys/dev/sound/pci/cs4281.c:935", "sys/dev/sound/pci/cs4281.c:474", "sys/dev/sound/pcm/mixer.c:828", "sys/dev/sound/pcm/mixer.c:118" ], "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 (resume path unreachable)", "code_hash": "19c94f1b781ac9af341782f14e78bc816a96515adcfa4f6ff6c1ebaef2c63dfb", "notes": "Pass-2 pass over EVERY goto unwind / ignored return in attach, per the sound-family checklist. Attach-side checks are in the DF-4537 fix; this verdicts fix.diff is the resume-side backstop.", "recommended_fix": "Check mixer_init() and pcm_addchan() returns and unwind via pcm_unregister on failure (DF-4537 fix.diff), plus guard cs4281_pci_resume to return ENXIO when either embedded channel never initialized", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff adds the resume-side guards (fail ENXIO before mixer_reinit/channel restore when sc->rch.parent or sc->pch.parent is NULL); git apply --check clean. Combined with the DF-4537 attach reorder, no half-attached device can reach resume. Not observable on this guest (no CS4281 hardware).", "fix_evidence": "findings/poc/DF-4539/fix.diff; attach-side half in findings/poc/DF-4537/fix.diff" } |