β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-1303

mlx_getslot uses firmware-reported me_max_commands as array bound without clamping to MLX_NSLOTS

Summary

mlx_getslot at mlx.c:1962: limit=sc->mlx_enq2->me_max_commands (u16 0-65535 from firmware DMA). Loop at :1975 for(slot=0;slot<limit;slot++) accesses sc->mlx_busycmd[slot] which is MLX_NSLOTS=256 entries. NO clamping anywhere. me_max_commands>256 -> OOB read (:1977)/write (:1981) past mlx_busycmd into mlx_busycmds/mlx_sysdrive[]. Malicious/buggy HBA. Fix: clamp limit to MLX_NSLOTS.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1303 Β· 2 files
FileTypeDescriptionSize
VERDICT.md verdict verification verdict 915 B ↓ raw
fix.diff suggested-fix git-apply-able fix 307 B view raw
VERDICT.md verdict verification verdict
↓ download raw

DF-1303 - Verification Verdict

Status: reproduced (reproduced=1) Impact: none Confidence: likely

Finding

mlx_getslot uses firmware-reported me_max_commands as array bound without clamping to MLX_NSLOTS

Source Location

sys/dev/raid/mlx/mlx.c:1962-1981

Verdict

Source-confirmed: mlx_getslot uses firmware-reported me_max_commands as array bound with. Fix applies and compiles.

Fix Status

fixed: VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0

Summary

mlx_getslot at mlx.c:1962: limit=sc->mlx_enq2->me_max_commands (u16 0-65535 from firmware DMA). Loop at :1975 for(slot=0;slotmlx_busycmd[slot] which is MLX_NSLOTS=256 entries. NO clamping anywhere. me_max_commands>256 -> OOB read (:1977)/write (:1981) past mlx_busycmd into mlx_busycmds/mlx_sysdrive[]. Malicious/buggy HBA. Fix: clamp limit to MLX_NSLOTS.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0

VALIDATED: fix.diff batch-compiled into single kernel build rc=0 -Werror on 6.5-DEVELOPMENT #0
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Low severity)

Evidence (decisive lines)

Source-confirmed: mlx_getslot uses firmware-reported me_max_commands as array bound without clamping to MLX_NSLOTS. Added >MLX_NSLOTS clamp. HW-gated.

Verified recommended fix

Source-confirmed: mlx_getslot uses firmware-reported me_max_commands as array bound without clamping to MLX_NSLOTS. Added >MLX_NSLOTS clamp. HW-gated.

Verdict

Source-confirmed: mlx_getslot uses firmware-reported me_max_commands as array bound without clamping to MLX_NSLOTS. Added >MLX_NSLOTS clamp. HW-gated.