Unvalidated firmware header fields enable heap overflow in ASD firmware copy (variant of DF-1838/1854/1875)
Summary
psp_v10_0_init_microcode L142-144: asd_ucode_size=le32_to_cpu(hdr->header.ucode_size_bytes); asd_start_addr=(uint8_t*)hdr+le32_to_cpu(hdr->header.ucode_array_offset_bytes). No range check. amdgpu_ucode_validate only checks datasize==size_bytes not inner length/offset. Sink: amdgpu_psp.c:254-255 memset(fw_pri_buf,0,PSP_1_MEG); memcpy(fw_pri_buf,asd_start_addr,asd_ucode_size). asd_ucode_size>0x100000 -> heap overflow past 1MiB fw_pri_buf; ucode_array_offset_bytes>datasize -> OOB source read. Same pattern DF-1838(v3_1)/DF-1854(asd_load)/DF-1875(v11_0). v10_0 lacks sos_fw split so only ASD path. Root attacker crafted firmware. Fix: validate ucode_size_bytes<=datasize-offset AND <=PSP_1_MEG.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1955 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able unified diff; validated as part of combined 41-finding kernel build (rc=0, -Werror clean) | 650 B | view raw |
| VERDICT.md | verdict | source-only confirmation + HW/module gating explanation | 1.5 KB | β raw |
DF-1955 Verification
Verdict
SOURCE-CONFIRMED, INCONCLUSIVE-RUNTIME (HW/module gated).
The cited defect exists in the audited source at sys/dev/drm/amd/amdgpu/psp_v10_0.c:142-144. Reproduction
on the running guest is not possible because the affected code path is
gated behind hardware that is not present in the audit QEMU/KVM guest
(no AMD/i915 GPU, no LSI MegaRAID, no MMC/SDHCI controller, no FireWire, no
ATAPI floppy, etc.) and/or lives in a kernel module that is not loaded on the
GENERIC-running guest.
Mechanism (source-only confirmation)
amdgpu (not in GENERIC, no AMD HW). Source: psp_v10_0_init_microcode at L142-144 asd_ucode_size=le32_to_cpu(hdr->header.ucode_size_bytes); asd_start_addr=(uint8_t*)hdr+le32_to_cpu(hdr->header.ucode_array_offset_bytes). No range check; amdgpu_ucode_validate only checks datasize==size_bytes not inner offsets. Forged/corrupt firmware can craft offsets indexing past the blob.
Recommended fix
Reject firmware whose ucode_array_offset + asd_ucode_size > asd_fw->size.
The full git apply-able diff lives in fix.diff in this folder; it was
applied as part of a single combined 41-finding kernel build that compiled
cleanly (rc=0, -Werror clean) β see ../fix_build_summary.txt.
Build validation
git apply --checkon this fix.diff: OK- Combined kernel build (
X86_64_GENERIC, INVARIANTS ON) with all 41 findings' fix.diffs applied: rc=0, no warnings, no errors. - The patched kernel was not booted/run because the affected code path requires hardware that the audit guest does not have.
Confirmed kernel references
- s
- y
- s
- /
- d
- e
- v
- /
- d
- r
- m
- /
- a
- m
- d
- /
- a
- m
- d
- g
- p
- u
- /
- p
- s
- p
- _
- v
- 1
- 0
- _
- 0
- .
- c
- :
- 1
- 4
- 2
- -
- 1
- 4
- 4
Detail
Exploit chain
none β non-corruption classes (info leak / DoS / div0 / logic) or HW/module gated. No memory-corruption primitive reachable from userspace on this guest.
Evidence (decisive lines)
Source-only confirmation. Combined kernel build with all 41 fix.diffs applied: === NK_DONE rc=0 === at Wed Jul 22 18:05:21 UTC 2026 (no errors, no warnings). See findings/poc/fix_build_summary.txt.
PoC changes
Authored findings/poc/DF-1955/fix.diff (minimal targeted guard). VERDICT.md and manifest.json written. fix.diff validated by combined build.
Verified recommended fix
Reject firmware whose ucode_array_offset + asd_ucode_size > asd_fw->datasize. Full git-apply-able diff in findings/poc/DF-1955/fix.diff; validated as part of combined 41-finding kernel build (rc=0).
Verdict
SOURCE-CONFIRMED, INCONCLUSIVE-RUNTIME. The cited defect exists at sys/dev/drm/amd/amdgpu/psp_v10_0.c:142-144. amdgpu (not in GENERIC, no AMD HW). psp_v10_0_init_microcode L142-144 asd_ucode_size=le32_to_cpu(hdr->header.ucode_size_bytes); asd_start_addr=(uint8_t*)hdr+le32_to_cpu(hdr->header.ucode_array_offset_bytes). No range check; amdgpu_ucode_validate only checks datasize==size_bytes. Forged firmware can craft offsets indexing past the blob. HW gated.
No comments yet.