DF-3965 / verdict.json
{ "finding_id": "DF-3965", "status": "not_reproduced", "reproduced": 0, "impact": "none", "confidence": "certain", "verdict": "Certain DMA-map lifetime bug, Low on this platform: the three completion callbacks sync/unload the per-SRB io map only inside case IOP_RESULT_SUCCESS (hptiop.c:393-409/547-561/654-668) although every data CCB loads it (2304-2309); all non-success results (BAD_TARGET from every absent-tid bus probe, BUSY, FAIL, CHECK_CONDITION, ...) return the srb to the freelist with the map still loaded, and the next use double-loads it. On bounce-capable tags/platforms the reservation accounting (busdma_machdep.c pagesneeded) accumulates until the bounce pool is exhausted -> permanent CAM_BUSY; on the current amd64 no-bounce io_dmat the leak is bookkeeping-only. Not reproduced: guest lacks the HBA (env.txt).", "exploit_chain": "", "evidence": "VERDICT.md (load/unload asymmetry + busdma accounting path), trigger.c (deterministic BAD_TARGET source), env.txt (hw.busdma.max_bpages=1024), fix.diff (unload on all completions)", "kernel_refs": [ "sys/dev/raid/hptiop/hptiop.c:2304", "sys/dev/raid/hptiop/hptiop.c:393", "sys/dev/raid/hptiop/hptiop.c:547", "sys/dev/raid/hptiop/hptiop.c:654", "sys/dev/raid/hptiop/hptiop.c:457", "sys/platform/pc64/x86_64/busdma_machdep.c:616" ], "poc_changes": "Informational trigger only.", "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": 4, "guest_dirty": 0, "build_cmd": "guest: cd /usr/src/sys/dev/raid/hptiop && patch -p1 < fix.diff && make # after make obj", "run_cmd": "dfbsd-qemu/vm.sh run_root sysctl hw.busdma.max_bpages hw.busdma.total_bpages; pciconf -lv | grep -i 1103", "code_hash": "b2a932eabc042f2d632cb3c4d46159c1cf70d1fa6096df2797b4c2e832430bcc", "notes": "Pass-2 finding, checklist item (e). BAD_TARGET probes make the leak deterministic rather than exceptional.", "recommended_fix": "Unload/sync the srb dma_map on every completion, not only IOP_RESULT_SUCCESS (fix.diff pattern for all three callbacks).", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff demonstrates the itl hunk (default-arm unload); the mv/mvfrey callbacks need the identical pattern. git apply --check clean fix.diff applied to the guest /usr/src copy and the hptiop.ko module rebuilt clean with -Werror (build.log; combined with the other four hptiop fix.diffs of this batch); runtime validation still impossible without the HBA.", "fix_evidence": "fix.diff; fix.diff applied to the guest /usr/src copy and the hptiop.ko module rebuilt clean with -Werror (build.log; combined with the other four hptiop fix.diffs of this batch); runtime validation still impossible without the HBA." } |