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

Heap buffer overflow in sbp_fix_inq_data via short INQUIRY data buffer

Summary

sbp_fix_inq_data at sbp.c:1504: inq=(struct scsi_inquiry_data*)ccb->csio.data_ptr without checking dxfer_len>=36. Writes inq->vendor(8B at offset 8), product(16B at offset 16), revision(4B at offset 32). Short buffer (e.g. 5B via pass(4)) -> heap overflow up to 31B. Overflow content from sdev->vendor/product/revision (partially device-controlled via CSR ROM). Root only (pass/sg). Sibling of DF-1285 (hptmv INQUIRY). Fix: check dxfer_len>=offsetof(revision)+4.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

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

DF-1317 - Verification Verdict

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

Finding

Heap buffer overflow in sbp_fix_inq_data via short INQUIRY data buffer

Source Location

sys/dev/disk/sbp/sbp.c:1504-1529

Verdict

Source-confirmed: Heap buffer overflow in sbp_fix_inq_data via short INQUIRY data buffer. 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

sbp_fix_inq_data at sbp.c:1504: inq=(struct scsi_inquiry_data*)ccb->csio.data_ptr without checking dxfer_len>=36. Writes inq->vendor(8B at offset 8), product(16B at offset 16), revision(4B at offset 32). Short buffer (e.g. 5B via pass(4)) -> heap overflow up to 31B. Overflow content from sdev->vendor/product/revision (partially device-controlled via CSR ROM). Root only (pass/sg). Sibling of DF-1285 (hptmv INQUIRY). Fix: check dxfer_len>=offsetof(revision)+4.

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: sbp_fix_inq_data dereferences inq from ccb->csio.data_ptr without checking buffer length >= SHORT_INQUIRY_LENGTH. Added length check. HW-gated.

Verified recommended fix

Source-confirmed: sbp_fix_inq_data dereferences inq from ccb->csio.data_ptr without checking buffer length >= SHORT_INQUIRY_LENGTH. Added length check. HW-gated.

Verdict

Source-confirmed: sbp_fix_inq_data dereferences inq from ccb->csio.data_ptr without checking buffer length >= SHORT_INQUIRY_LENGTH. Added length check. HW-gated.