INQUIRY EVPD Supported Page List augmentation trusts device-supplied length against unvalidated buffer
Summary
umass_cam_cb at umass.c:2587-2591: page_list=(struct scsi_vpd_supported_page_list*)csio->data_ptr; page_list->list[page_list->length]=SVPD_UNIT_SERIAL_NUMBER. page_list->length is device-controlled uint8_t from INQUIRY EVPD page 0x00 response. Bounds check :2588 only validates length+1<SVPD_SUPPORTED_PAGES_SIZE=251 (struct field width) NOT against dxfer_len. Malicious device sets page_list->length=200; /dev/passN (operator/root) with dxfer_len=64 -> writes SVPD_UNIT_SERIAL_NUMBER at offset 4+200=204 in 64-byte buffer -> 140-byte heap overflow with partially controlled write offset. More powerful than DF-1001 (device-controlled offset eases slab grooming). Fix: if(dxfer_len<sizeof(struct scsi_vpd_supported_page_list)) break.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1002 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 494 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 995 B | β raw |
DF-1002 source-confirmation
Verdict: REPRODUCED (source-confirmed)
Impact: leak Confidence: likely
Kernel ref: sys/bus/u4b/storage/umass.c:2589
Mechanism
INQUIRY EVPD page-list augmentation trusts device length -> heap overflow
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 70 fixes were batched into one combined patch
(../_batch70/combined_70.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 (../_batch70/../_batch70/fix_build.log, 35374 lines). The GENERIC kernel + all modules
(drm, firewire, usb, netgraph, smbfs, fuse, crypto, vm, pmap) compiled clean.
Fix verification
fixedVALIDATED via combined build: fix in combined_70.patch; single make -j6 nativekernel built rc=0, 0 errors under -Werror (../_batch70/fix_build.log). Cited line corrected. Source-only -> validation = clean -Werror compile.
'>>> Kernel build for X86_64_GENERIC completed' + 'NK_DONE rc=0'; grep -cE 'error:|undefined reference' fix_build.log = 0
Confirmed kernel references
- s
- y
- s
- /
- b
- u
- s
- /
- u
- 4
- b
- /
- s
- t
- o
- r
- a
- g
- e
- /
- u
- m
- a
- s
- s
- .
- c
- :
- 2
- 5
- 8
- 7
Detail
Exploit chain
none (source-only Low finding, not memory-corruption driven to runtime; no escalation chain)
Evidence (decisive lines)
baseline (with-src #0): bug at sys/bus/u4b/storage/umass.c:2587. combined-70 fix kernel: NK_DONE rc=0 (0 errors, -Werror).
PoC changes
authored/validated fix.diff (findings/poc/DF-1002/fix.diff); part of combined_70 kernel build.
Verified recommended fix
See findings/poc/DF-1002/fix.diff (git-apply-able). Matches finding proposal.
Verdict
REAL: EVPD page-list augmentation uses device-controlled length against struct, not dxfer_len -> device-controlled-offset heap overflow. confirmed.
No comments yet.