Untrusted IOC-supplied indices index raid_disks/raid_volumes arrays without bounds checks (OOB read/write of kernel heap)
Summary
Driver sizes raid_disks to ioc_page2 MaxPhysDisks and raid_volumes to MaxVolumes (both U8 set at mpt.c) but then indexes those same arrays with PhysDiskNum/VolumePageNumber values read from separate IOC config pages and IR events without ever comparing index to raid_max_disks/raid_max_volumes. Five sites: mpt_raid_event :413-414 mpt_refresh_raid_vol :1309-1311 (WRITES kernel pointer volume) mpt_announce_vol :1155 mpt_refresh_raid_data :1405-1413 (RMW writes flags) :1436-1448 (RMW writes flags reads config_page). U8 index can range 0-254 while array sized by unrelated U8 typically 2-8. Malicious/faulty IOC (PCIe DMA peripheral emulated mptsas guest firmware bug) supplies out-of-range index. Impact: heap OOB write of kernel pointer and u_int fields at attacker-influenced offsets up to ~38KB past raid_disks -> kernel memory corruption privilege escalation or panic.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-2484 Β· 6 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | Source trace confirming DF-2484 bug is real but HW-gated | 1.3 KB | β raw |
| fix.diff | suggested-fix | Add raid_max_disks/raid_max_volumes bounds checks at all 5 IOC-index sites | 1.8 KB | view raw |
| env.txt | environment | Guest gate proof: kldstat, pciconf, camcontrol (no target HBA) | 1.1 KB | view raw |
| build.sh | build-script | No buildable PoC (HW-gated) | 384 B | view raw |
| run.sh | run-script | Gate verification commands | 411 B | view raw |
| README.md | readme | Overview of HW-gated finding | 791 B | β raw |
HW-gated SCSI/FC HBA driver finding
This finding targets a SCSI/FC/SATA HBA driver that is not present in this QEMU/KVM guest (only PIIX3 IDE + virtio). The driver cannot attach and the cited code path is unreachable at runtime.
Reproduction status: NOT REPRODUCED (HW-gated)
- The source bug is confirmed real by line-by-line source trace (see VERDICT.md).
- It cannot be triggered because the HBA hardware/driver does not exist on this guest.
- A defense-in-depth
fix.diffhas been authored and validated withgit apply --check.
Evidence
VERDICT.mdβ full source trace and analysisenv.txtβ guest environment (kldstat, pciconf, camcontrol gate proof)fix.diffβ git-apply-able defense-in-depth fixmanifest.jsonβ machine-readable catalog
DF-2484 β Untrusted IOC-supplied indices index raid_disks/raid_volumes
Verdict: NOT REPRODUCED (HW-gated) β source bug CONFIRMED
Hardware gate
No LSI Logic MPT HBA in guest: kldstat shows only kernel/ehci/xhci; pciconf -l
shows no LSI device. RAID arrays do not exist.
Source trace (confirmed real bug)
File: sys/dev/disk/mpt/mpt_raid.c β five sites:
- Line 414:
mpt_disk = mpt->raid_disks + raid_event->PhysDiskNum; - Line 1155:
mpt_disk = mpt->raid_disks + vol_pg->PhysDisk[i].PhysDiskNum; - Line 1309:
mpt_disk = mpt->raid_disks + vol_pg->PhysDisk[i].PhysDiskNum; - Line 1405:
mpt_disk = mpt->raid_disks + ioc_disk->PhysDiskNum; - Line 1436:
mpt_vol = mpt->raid_volumes + ioc_vol->VolumePageNumber;
None of these compare the index to raid_max_disks/raid_max_volumes. The arrays
are sized by MaxPhysDisks/MaxVolumes (U8), but the indices are independently
supplied U8 values from different IOC config pages. A malicious/faulty IOC can
supply PhysDiskNum=254 when the array has 2-8 entries β heap OOB write of kernel
pointer and u_int fields up to ~38KB past the array.
Fix
Added >= raid_max_disks/>= raid_max_volumes bounds checks before each indexing
site. See fix.diff.
Impact (on HW that has the HBA)
Medium β heap OOB read/write of kernel pointers and u_int fields via malicious IOC.
Fix verification
not_testablenot_testable: target driver cannot attach (no target HBA). fix.diff validated with git apply --check (EXIT=0); fix is correct by source trace.
git apply --check findings/poc/DF-2484/fix.diff => EXIT=0. No runtime test possible (no target HBA).
Confirmed kernel references
Detail
Exploit chain
none β valid hard blocker (driver code path dead at runtime on this guest: no target HBA). No unprivileged->root path.
Evidence (decisive lines)
kldstat -> kernel/ehci/xhci only (no target driver); pciconf -l -> PIIX3 IDE + virtio only (no target HBA); camcontrol devlist -> only <QEMU QEMU DVD-ROM>. Source confirmed at cited lines.
PoC changes
Created findings/poc/DF-2484/{VERDICT.md,fix.diff,manifest.json,env.txt,build.sh,run.sh,README.md}. No PoC source (HW-gated).
Verified recommended fix
Defense-in-depth fix.diff closes the cited path (see findings/poc/DF-2484/fix.diff; git apply --check OK).
Verdict
NOT REPRODUCED (HW-gated). The bug is REAL in source (traced line-by-line): mpt_raid untrusted IOC indices index raid_disks/raid_volumes OOB (needs LSI MPT RAID HBA). Gate confirmed: kldstat (only kernel+ehci+xhci; no isp/mpt/sili/trm/sbp module loaded), pciconf -l (no QLogic ISP/LSI MPT/SiliconImage/Tekram/FireWire HBA β only PIIX3 IDE atapci0 + virtio), camcontrol devlist (only QEMU DVD-ROM). The target driver cannot attach so the cited code path is dead at runtime on this guest.
No comments yet.