DF-3902 / verdict.json
{ "finding_id": "DF-3902", "status": "inconclusive", "reproduced": 0, "impact": "none", "confidence": "certain", "verdict": "Deterministic double-free, source-certain: sioclose()s gone-branch (sio.c:1478-1479) kfrees com->ibuf under a != NULL guard but never NULLs it, and com->gone is sticky; after a pccard ejection with >=2 open fds on the unit (sio_pccard_detach takes the still open, forcing close branch and deliberately leaves ibuf to sioclose), every further sioclose re-kfrees the same M_DEVBUF block. Second close also runs comhardclose MMIO writes through the bus handle detach already released, and bzero(tp) destroys a struct tty that com->tp/dev->si_tty still reference. Distinct defect from DF-2191 (callout UAF, other file). Guest verification: trigger program + full ioctl-glue suite run live on the guests sio0 console (two open/close cycle clean RC=0; TIOCTIMESTAMP zeros; TIOCMGET 0x167; console speed-lock merge live-proven; 100KB TX stable; unpriv EACCES on all nodes) \u2014 but the guest has no pccard hardware so com->gone can never be set: the double-free itself is honestly inconclusive.", "exploit_chain": "on pccard hw: open ttydN twice -> eject card -> close fd1 -> close fd2 -> kfree of freed M_DEVBUF (size 2*ibufsize, 256..2048B attacker-influenced via prior baud change) -> heap corruption/panic; physical-hotplug class", "evidence": "VERDICT.md; df3902_trigger.c; run.log (guest live: clean non-gone path); run_ioctl.log + run_user_boundary.log (live ioctl-glue verification on sio0 console)", "kernel_refs": [ "sys/dev/serial/sio/sio.c:1475", "sys/dev/serial/sio/sio.c:1479", "sys/dev/serial/sio/sio.c:1480", "sys/dev/serial/sio/sio_pccard.c:127", "sys/dev/serial/sio/sio_pccard.c:135" ], "poc_changes": "authored fresh (trigger + ioctl-glue suite)", "attempts": 2, "guest_uname": "DragonFly dfbsd 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": 45, "guest_dirty": 0, "build_cmd": "cc -o df3902_trigger df3902_trigger.c -Wall; cc -o sio_ioctl_test sio_ioctl_test.c -Wall", "run_cmd": "/tmp/siot/df3902_trigger /dev/ttyd0 ; /tmp/siot/sio_ioctl_test", "code_hash": "sha256:b11aad650cd08048244c4c240d42117d2f23f38413157bc741587c1c568909dd", "fix_status": "not_applicable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff NULLs com->ibuf/com->iptr after the kfree and drops the bzero of the live tty; not build-validated (trigger not runnable on guest; no reproduced corruption gating mandatory validation)", "fix_evidence": "fix.diff", "notes": "DF-2191 twin-family but independent defect+fix. Guest console identity confirmed: sio0 console 16550A per dmesg.", "recommended_fix": "Set com->ibuf = NULL (and iptr) after the gone-path kfree; do not bzero the still-referenced struct tty" } |