⬢ DragonFlyBSD Kernel Audit
DF-2485 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-2485",
  "status": "reproduced",
  "reproduced": 1,
  "impact": "limited_write",
  "confidence": "certain",
  "verdict": "The verbatim mpt_refresh_raid_data and mpt_announce_vol iterate device-supplied counts (ioc_page3->NumPhysDisks :1401, ioc_page2->NumActiveVolumes :1432, vol_pg->NumPhysDisks :1149) over trailing arrays without checking the counts fit the page. The rig plants honest page headers (PageLength covering the header only) plus oversubscribed counts - exactly what a hostile IOC delivers - with the raid arrays in a single guarded allocation. Hostile page3 NumPhysDisks=3 (page holds 0 entries): the loop ran 3 times reading PhysDisk[0..2] past the page (0x03 canary), and the OOB-fetched PhysDiskNum indexed raid_disks[3] - one past the 2-entry array - whose flags |= MPT_RDF_REFERENCED|ACTIVE write landed in the guard (raid_disks-guard[70]=aaaaaaab captured). The announce loop (NumPhysDisks=5) similarly printed garbage flags read past the allocation (the OOB-read amplification arm of DF-2484). Control (honest counts) clean. Fix (clamp counts to the PageLength-derived maximum) A/B: no guard smash. HW-gated at runtime (no LSI MPT controller on the guest).",
  "exploit_chain": "malicious/faulty IOC (PCI trust boundary); OOB read of the page plus an IOC-indexed OOB |= write into raid_disks (limited write primitive per this findings scope; DF-2484 owns the far-index arm).",
  "evidence": "run.log: 3 refresh_disk walks, raid_disks-guard[70]=aaaaaaab (OOB write); announce 5 walks on OOB data; fixed: no smash.",
  "kernel_refs": [
    "sys/dev/disk/mpt/mpt_raid.c:1149",
    "sys/dev/disk/mpt/mpt_raid.c:1401",
    "sys/dev/disk/mpt/mpt_raid.c:1402",
    "sys/dev/disk/mpt/mpt_raid.c:1432"
  ],
  "poc_changes": "rig needed honest PageLength values planted in the fabricated pages (first attempt left them zero, masking the fix effect); guard placed in the same allocation after the arrays.",
  "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": 900,
  "guest_dirty": 0,
  "build_cmd": "sh /root/rigs/dfv_mpt/gen.sh && make -m /usr/src/share/mk (in dfv_mpt)",
  "run_cmd": "kldload dfv_mpt.ko; for i in 0 1 2 3; do sysctl kern.dfv_mpt_run=$i >/dev/null; sysctl -n kern.dfv_mpt_status; done",
  "code_hash": "f3d61859032b8179aa5d09bcfc92617006ae2add0b89ae52c96ef4cb67a2496e",
  "notes": "Rig plants honest page headers (PageLength = header only) plus oversubscribed counts, exactly what a hostile IOC delivers. Amplification into far OOB raid_disks[] indexing is the DF-2484 sibling. The clamp uses PageLength, which a hostile IOC also controls - allocation-size validation belongs in the page-read path (noted in fix).",
  "recommended_fix": "clamp NumPhysDisks/NumActiveVolumes/NumPhysDisks to the page header length",
  "fix_status": "fixed"
}