Integer underflow in psp_v11_0_compare_sram_data loop causes OOB read of ucode buffer β variant of DF-1839
Summary
psp_v11_0_compare_sram_data L498-509 ucode_size=ucode->ucode_size (uint32_t from untrusted firmware header via amdgpu_firmware_info); while(ucode_size){ RREG32 compare *ucode_mem; ucode_mem++; ucode_size-=4; }. If ucode_size not multiple of 4 (1/2/3) subtraction underflows to ~0xFFFFFFFD/FD/FF loop continues ~1B iterations reading past ucode->kaddr OOB. No check ucode_size%4==0 anywhere. Same bug as psp_v3_1_compare_sram_data DF-1839. LATENT: only in-tree caller amdgpu_psp_check_fw_loading_status amdgpu_psp.c:547 invoked from amdgpu_psp.c:330 inside #if 0. Becomes exploitable if block re-enabled. Impact ceiling: small kernel-memory info leak + reliable local DoS via page-fault panic no write primitive. Fix: require dword alignment ucode_size%4==0 OR change loop to while(ucode_size>=4).
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1876 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited bug | 435 B | view raw |
| VERDICT.md | verdict | source-confirmation analysis | 1.0 KB | β raw |
| build.sh | build-script | N/A (source-only) | 65 B | view raw |
| run.sh | run-script | N/A (source-only) | 89 B | view raw |
DF-1876 VERDICT
Verdict: REPRODUCED (source-confirmed)
Impact: Low (driver-level NULL deref / OOB / leak / DoS β hardware-gated)
Mechanism: psp_v11_0_compare_sram_data L498-509 ucode_size=ucode->ucode_size (uint32_t from untrusted firmware header via amdgpu_firmware_info); while(ucode_size){ RREG32 compare *ucode_mem; ucode_mem++; ucode_s
Citation: sys/dev/drm/amd/amdgpu/psp_v11_0.c:498-509
Fix: Applied fix.diff β compiles in batch kernel build (rc=0, -Werror).
Verification method: Source-only line-by-line trace of cited path:line. Low-severity driver bug; PoC trigger requires specific hardware or root context. Confirmed the cited vulnerable pattern exists in source.
Fix status (batch validation)
Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.
Fix verification
fixedfix.diff compiled in batch kernel build rc=0 -Werror
fix.diff compiled in batch kernel build rc=0 -Werror
Confirmed kernel references
β
Detail
Exploit chain
none (Low severity)
Evidence (decisive lines)
Source-confirmed: ucode_size-=4 underflows when not multiple of 4 (psp_v11_0.c:498-509)
Verified recommended fix
Source-confirmed: ucode_size-=4 underflows when not multiple of 4 (psp_v11_0.c:498-509)
Verdict
Source-confirmed: ucode_size-=4 underflows when not multiple of 4 (psp_v11_0.c:498-509)
No comments yet.