DF-5357 / verdict.json
{ "finding_id": "DF-5357", "status": "untested", "verdict": "Statically certain NULL-deref panic, root-triggered (Low). pccard_attach_card returns early on card->error (sys/bus/pccard/pccard.c:205-208) after read_cis already populated pf_head, leaving pf->dev NULL for every function (children are only created at pccard.c:253-259). A later devclass_add_driver of any pccard-bus module (kldload) runs pccard_driver_added, which does child = pf->dev at pccard.c:1084 and passes it to device_get_state (pccard.c:1085) \u2014 device_get_state is a raw dev->state load (sys/kern/subr_bus.c:1824-1827), so NULL dereferences and the kernel panics. The sibling loop pccard_detach_card guards exactly this (if (pf->dev == NULL) continue;, pccard.c:304-305). Not runnable in QEMU (no PCMCIA bridge): pf_head can never be populated on the guest, static evidence only.", "reproduced": false, "impact": "panic", "confidence": "certain", "exploit_chain": "", "evidence": "VERDICT.md trace; fix.diff one-line guard mirroring pccard.c:304-305", "kernel_refs": [ "sys/bus/pccard/pccard.c:205", "sys/bus/pccard/pccard.c:253", "sys/bus/pccard/pccard.c:304", "sys/bus/pccard/pccard.c:1081", "sys/bus/pccard/pccard.c:1084", "sys/bus/pccard/pccard.c:1085", "sys/kern/subr_bus.c:1824", "sys/bus/pccard/pccard_cis.c:1053" ], "poc_changes": "No seed PoC; static pack (hardware+root trigger).", "attempts": 0, "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": 0, "guest_dirty": 0, "build_cmd": "", "run_cmd": "hardware+root: insert erroring-CIS card, then kldload any DRIVER_MODULE(..., pccard, ...) module -> panic in device_get_state", "code_hash": "", "notes": "Low severity: trigger action (kldload) requires root; filed as robustness/defense-in-depth consistent with DF-1489.", "recommended_fix": "Skip functions without a child device in pccard_driver_added (if (pf->dev == NULL) continue;), mirroring the pccard_detach_card guard at pccard.c:304-305.", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "One-line NULL guard; cannot be boot-tested without PCMCIA hardware. Semantically identical to the existing guard in pccard_detach_card.", "fix_evidence": "findings/poc/DF-5357/fix.diff" } |