DF-3800 / verdict.json
{ "finding_id": "DF-3800", "status": "not_reproduced", "reproduced": 0, "impact": "none", "confidence": "likely", "verdict": "Source-level heap OOB write: after a Diag Reset that changes IOC facts, mprsas_realloc_targets (mpr_sas.c:3911) re-allocates sassc->targets to the PRE-reset size (caller mpr.c:632 passes saved_facts) and never updates sassc->maxtargets, while the mapping layer is rebuilt from the NEW facts (mpr_mapping.c:2564-2565). Discovery then writes ~20 firmware-influenced fields at &sassc->targets[id] (mpr_sas_lsi.c:908,925-965) with mapping-derived id bounded only by the new max_devices -> OOB write past the array. In the opposite direction (facts shrank), surviving CAM targets write sc->mapping_table[target_id].TLR_bits (mpr_sas.c:2706) past the shrunk mapping table. Not reproduced on the QEMU guest: mpr driver is present (pci/mpr registered) but the guest has no SAS3 PCI device, so mpr_attach_sas never runs and no runtime path exists; verified via pciconf/kldstat/camcontrol (env.txt). Defect is certain from source; the trigger requires a facts delta across a diag reset (malicious or online-upgraded firmware), hence confidence likely.", "exploit_chain": "", "evidence": "VERDICT.md (full source chain with path:line), env.txt (guest hardware gate), fix.diff (realloc to current facts + maxtargets update + clamp)", "kernel_refs": [ "sys/dev/raid/mpr/mpr_sas.c:3911", "sys/dev/raid/mpr/mpr_sas.c:3924", "sys/dev/raid/mpr/mpr_sas.c:3932", "sys/dev/raid/mpr/mpr_sas.c:760", "sys/dev/raid/mpr/mpr.c:632", "sys/dev/raid/mpr/mpr_mapping.c:2565", "sys/dev/raid/mpr/mpr_sas_lsi.c:908", "sys/dev/raid/mpr/mpr_sas_lsi.c:925", "sys/dev/raid/mpr/mpr_sas.c:2706" ], "poc_changes": "No runnable PoC exists for a firmware-facts-delta trigger; run.sh records the hardware-gate proof instead.", "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": 30, "guest_dirty": 0, "build_cmd": "n/a (no userland trigger)", "run_cmd": "sh findings/poc/DF-3800/run.sh", "code_hash": "", "notes": "KASSERT guards in mpr_sas.c are INVARIANTS-only (sys/sys/systm.h:94-118) and do not constrain the mapping-derived id path at mpr_sas_lsi.c:908.", "recommended_fix": "Realloc targets to current facts (sc->facts->MaxTargets+MaxVolumes) and update sassc->maxtargets in mprsas_realloc_targets; clamp mapping ids to sassc->maxtargets in mprsas_add_device.", "fix_status": "not_testable", "fix_baseline_reproduced": 0, "fix_patched_reproduced": 0, "fix_verdict": "fix.diff authored from line-accurate source analysis; cannot be kernel-built-and-exercised on this guest because the mpr SIM never attaches without SAS3 hardware.", "fix_evidence": "findings/poc/DF-3800/fix.diff" } |