DF-4398 / verdict.json
{ "finding_id": "DF-4398", "status": "inconclusive", "reproduced": 0, "impact": "panic", "confidence": "likely", "verdict": "Code-level violation certain: tws_scsi_err_complete() executes callout_stop(req->ccb_ptr->ccb_h.timeout_ch) at sys/dev/raid/tws/tws_cam.c:596 AFTER xpt_done(ccb) at :593 surrendered the ccb to CAM (xpt_done queues to sim_doneq, sys/bus/cam/cam_xpt.c:4891-4926; the cambio SWI can recycle/free the ccb before :596 runs). The correct order (callout_stop before xpt_done) is used by tws_scsi_complete (:365/:371) and tws_drain_busy_queue (:627/:634) in the same file. Could not be exercised: the audit QEMU guest has no 3ware HBA (no vendor-0x13c1 device, no /dev/tws*).", "exploit_chain": "", "evidence": "VERDICT.md (line-by-line ownership analysis); fix.diff (order swap); sys/dev/raid/tws/tws_cam.c:593-596 vs :365-371; sys/bus/cam/cam_xpt.c:4891-4926; env.txt (guest lacks controller)", "kernel_refs": [ "sys/dev/raid/tws/tws_cam.c:549", "sys/dev/raid/tws/tws_cam.c:593", "sys/dev/raid/tws/tws_cam.c:596", "sys/dev/raid/tws/tws_cam.c:365", "sys/bus/cam/cam_xpt.c:4891" ], "poc_changes": "no seed existed; trigger.c is a plain error-I/O hammer written for this pack", "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": 0, "guest_dirty": 0, "build_cmd": "cc -O2 -o trigger trigger.c", "run_cmd": "./run.sh /dev/daX (host with tws controller; guest lacks device)", "notes": "Race window is a few instructions wide per error completion but recurs on every controller error response under load. Hardware-gated: 3ware 9700-class HBA required.", "recommended_fix": "Stop the ccb timeout callout before xpt_done() in tws_scsi_err_complete(), matching tws_scsi_complete().", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff moves callout_stop() before the xpt_done() block, restoring the ownership invariant used by the other completion paths. Cannot be validated on the audit guest (no 3ware controller to build a baseline on).", "fix_evidence": "fix.diff (order swap, no functional change to completion semantics)", "code_hash": "485277457e5f9b35a08010897caa73f5a75efb37077e6eace299bfb8f99740fb" } |