SESIOC_GETOBJMAP leaks 2 bytes uninitialized kernel stack per object (struct padding)
Summary
sesioctl SESIOC_GETOBJMAP at scsi_ses.c:503 ses_object obj declared without initializer. :565-568 loop only assigns obj_id(0-3), subencid(4), object_type(5). struct ses_object is 8 bytes on standard ABI with 2 bytes unnamed padding at offsets 6-7 for alignment. :570 copyout(&obj,uobj,sizeof(ses_object)) copies 8 bytes including 2 uninitialized. Up to ses_nobjects entries -> up to 2*nobjects bytes leaked. Root-only (SYSCAP_RESTRICTEDROOT at :397). Defense-in-depth: kernel stack may contain function pointers/credential fragments from prior syscall frames. Fix: memset(&obj,0,sizeof(obj)) per iteration or __packed struct.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1013 Β· 3 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 417 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 922 B | β raw |
| env.txt | environment | guest uname + toolchain | 247 B | view raw |
DF-1013 source-confirmation
Verdict: REPRODUCED (source-confirmed) Impact: none Confidence: likely
Kernel ref: sys/bus/cam/scsi/scsi_ses.c:565
Mechanism
SESIOC_GETOBJMAP 2-byte uninit stack leak: ses_object obj filled field-by-field leaving 2 bytes of struct padding uninitialized; copyout copies full 8 bytes. root-only; confirmed.
Confirmation method
source-only Low-severity; confirmation by code inspection. Runtime PoC not exercised for this Low-severity item; confirmation is by code inspection against sys/.
Recommended fix
See fix.diff in this folder (git-apply-able unified diff).
Phase 8 (combined build)
This fix is part of the batched 70-finding combined patch
(../_batch70/combined_70.patch) applied to in-guest /usr/src. A single
make -j6 nativekernel KERNCONF=X86_64_GENERIC build is validated rc=0 with 0
errors under -Werror (../_batch70/fix_build.log).
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
- /
- c
- a
- m
- /
- s
- c
- s
- i
- /
- s
- c
- s
- i
- _
- s
- e
- s
- .
- c
- :
- 5
- 6
- 5
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/cam/scsi/scsi_ses.c:565. combined-70 fix kernel: NK_DONE rc=0 (0 errors, -Werror).
PoC changes
authored/validated fix.diff (findings/poc/DF-1013/fix.diff); part of combined_70 kernel build.
Verified recommended fix
See findings/poc/DF-1013/fix.diff (git-apply-able). Matches finding proposal.
Verdict
REAL: SESIOC_GETOBJMAP copies ses_object with 2 uninit padding bytes (field-by-field fill). root-only. confirmed.
No comments yet.