DF-4100 / verdict.json
{ "finding_id": "DF-4100", "status": "reproduced", "verdict": "REPRODUCED end-to-end: bttimeouts BDR branch arms the recovery BCCB without BCCB_ACTIVE (rec_flags=0 observed at arm time; only bt.c:1302 sets ACTIVE and the recovery BCCB never transits btexecuteccb), so when the adapter completes the BDR mailbox the production btdone hits the bt.c:1388 guard first -- console btdone - Attempt to free non-active BCCB <recovery-addr> -- and returns; the recovery branch (bt.c:1406) is unreachable (AC_SENT_BDR never fires, pending timeouts never reinstated, SIM queue stays frozen). The 2s re-arm (bt.c:2215) then fires the hard-reset branch: the virtual HBA observed the production driver write HARD_RESET(0x80) to CONTROL_REG (vhba_hard_resets=1, last_ctl=128) and the timed-out CCB completed CAM_CMD_TIMEOUT (0xb). Every command timeout therefore escalates to a full bus-wide hard reset 2s later; targeted recovery impossible.", "reproduced": true, "impact": "dos", "confidence": "certain", "exploit_chain": "single hung command -> bttimeout BDR branch (bt.c:2214) arms recovery BCCB with flags still BCCB_FREE -> HBA completes BDR mailbox -> btdone guard at bt.c:1388 rejects (Attempt to free non-active BCCB) -> recovery branch dead: SIM queue stays frozen, no AC_SENT_BDR, no timeout reinstatement -> 2s re-arm fires bttimeout with BCCB_DEVICE_RESET set -> btreset(hard) writes 0x80 to CONTROL_REG -> bus-wide reset, all targets disrupted", "evidence": "run.log DF-4100 section: [timeout] flags=0x7 rec_flags=0; [comprec] + console btdone - Attempt to free non-active BCCB 0xfffff801167df690; async_bdr=0 across all snapshots; final snap ccb_status=0xb timer=0; vhba counters 1/1/128", "kernel_refs": [ "sys/dev/disk/buslogic/bt.c:2214", "sys/dev/disk/buslogic/bt.c:1302", "sys/dev/disk/buslogic/bt.c:1388", "sys/dev/disk/buslogic/bt.c:2215" ], "poc_changes": "recovery completion delivered straight to production btdone via the comprec ioctl (the virtual-HBA firmware emulation), mirroring what bt_intr_lockeds mailbox walk feeds it (bt.c:1363-1370)", "attempts": 2, "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": 45, "guest_dirty": 0, "build_cmd": "./push_rig.sh", "run_cmd": "sh run1.sh", "code_hash": "745f8b43787e6bb6a37f62b8ac9fc1a99d7aab498a1faa6d34c8caeba4ba8651", "notes": "guest stayed up; the vHBA state machine scripted the DIAG dance so btreset completes against virtual registers (counter evidence of the 0x80 write)", "recommended_fix": "Set recovery_bccb->flags = BCCB_ACTIVE when arming the BDR in bttimeout and clear it to BCCB_FREE when the recovery branch finishes (fix.diff, object-compile validated)", "fix_status": "not_tested", "fix_baseline_reproduced": true, "fix_patched_reproduced": false, "fix_verdict": "object-compile validation only (DoS class, kernel A/B not mandated): patched bt.c compiles clean under -Werror with kernel headers", "fix_evidence": "fix.diff; FIXED-COMPILES-CLEAN with bt.fixed.o on the guest" } |