PROBE_SERIAL_NUM_1 heap OOB read via device-controlled length in VPD unit serial number response
Summary
probedone PROBE_SERIAL_NUM_1 at cam_xpt.c:6340-6346 bcopy(serial_buf->serial_num, ..., serial_buf->length). serial_buf->length is u_int8_t from device response byte 3. serial_buf allocated 255 bytes (sizeof(struct scsi_vpd_unit_serial_number)=4+251); serial_num at offset 4 has 251B storage. length=255 -> bcopy reads 255 bytes from offset 4 -> 4-byte OOB read past kmalloc into M_CAMXPT slab. Leaked bytes stored in device->serial_num exposed via XPT_GDEV_TYPE (/dev/xpt0 mode 0600 root-only) and kprintf at :1653 (60-char bounded). Malicious SCSI target (USB UMS/iSCSI/FC) triggers on attach. Fix: min(length, SVPD_SERIAL_NUM_SIZE=251).
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0972 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 486 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 983 B | β raw |
DF-0972 source-confirmation
Verdict: REPRODUCED (source-confirmed)
Impact: leak Confidence: likely
Kernel ref: sys/bus/cam/cam_xpt.c:6342
Mechanism
PROBE_SERIAL_NUM bcopy uses device-controlled length -> OOB read past serial buffer
Confirmation method
Source-trace confirmed the cited code path matches the finding (exact line/condition
verified against sys/). Runtime PoC not exercised for this source-only Low-severity
item; confirmation is by code inspection.
Recommended fix
See fix.diff in this folder (git-apply-able unified diff).
Phase 8 (combined build)
All 64 fixes were batched into one combined patch
(../_batch/combined_64.patch) and applied to in-guest /usr/src. A single
make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under
-Werror (../_batch/fix_build.log, 35374 lines). The GENERIC kernel + all modules
(drm, firewire, usb, netgraph, smbfs, fuse, crypto, vm, pmap) compiled clean.
Fix verification
not_testablenot_testable (source-only): no runtime PoC exercised; fix.diff applies cleanly and the combined single nativekernel build of all 64 fixes completed rc=0 with 0 errors under -Werror (findings/poc/_batch/fix_build.log). Bug source-confirmed in baseline tree. Compile-validation of the fix is the requested Phase-8 deliverable for this batch.
combined build: '=== NK_DONE rc=0 ===' and '>>> Kernel build for X86_64_GENERIC completed on Thu Jul 23 09:17:55 UTC 2026' (0 'error:' lines in 35374-line log).
Confirmed kernel references
- s
- y
- s
- /
- b
- u
- s
- /
- c
- a
- m
- /
- c
- a
- m
- _
- x
- p
- t
- .
- c
- :
- 6
- 3
- 4
- 2
Detail
Exploit chain
none (non-corruption / source-only confirmation; no memory-corruption escalation chain developed for this Low-severity item)
Evidence (decisive lines)
source-only: PROBE_SERIAL_NUM bcopy uses device-controlled length -> OOB read past serial buffer @ sys/bus/cam/cam_xpt.c:6342. Combined fix build: '=== NK_DONE rc=0 ===' / 'Kernel build for X86_64_GENERIC completed', 0 errors under -Werror (findings/poc/_batch/fix_build.log).
PoC changes
authored git-apply-able fix.diff targeting the cited line; source-trace verified the vulnerable path. Evidence pack (VERDICT.md, manifest.json, env.txt, fix.diff) in findings/poc/DF-0972/.
Verified recommended fix
cap bcopy length at SVPD_SERIAL_NUM_SIZE. matches finding proposal. Full diff in findings/poc/DF-0972/fix.diff.
Verdict
REPRODUCED (source-confirmed). Source-trace confirmed PROBE_SERIAL_NUM bcopy uses device-controlled length -> OOB read past serial buffer at sys/bus/cam/cam_xpt.c:6342 against the audited sys/ tree; exact line/condition verified.
No comments yet.