β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-1950

Unvalidated ACPI ATRM return object: heap buffer overflow and type confusion in amdgpu_atrm_call

Summary

amdgpu_atrm_call L264-265: obj=(ACPI_OBJECT*)buffer.Pointer; memcpy(bios+offset,obj->Buffer.Pointer,obj->Buffer.Length) without verifying obj->Type==ACPI_TYPE_BUFFER (0x03). ACPI_OBJECT union actypes.h:1077-1129 places Integer.Value offset 8 same as Buffer.Pointer; if ATRM returns ACPI_TYPE_INTEGER obj->Buffer.Pointer aliases integer value as kernel pointer wild deref. No bound on obj->Buffer.Length vs destination buffer capacity (len=4096 or remaining 256KB-offset); ACPI returns >4096 bytes at i=63 offset=258048 -> overflow past 256KB kmalloc heap corruption. Trigger: malicious/buggy ACPI ATRM method (PowerXpress dual-GPU laptops); GPU card firmware influences ACPI return. Automatic at probe boot/hotplug. Impact: kernel crash to heap corruption. Fix: verify Type==ACPI_TYPE_BUFFER clamp obj->Buffer.Length<=len.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-1950 Β· 2 files
FileTypeDescriptionSize
fix.diff suggested-fix git-apply-able unified diff; validated as part of combined 41-finding kernel build (rc=0, -Werror clean) 763 B view raw
VERDICT.md verdict source-only confirmation + HW/module gating explanation 1.6 KB ↓ raw
VERDICT.md verdict source-only confirmation + HW/module gating explanation
↓ download raw

DF-1950 Verification

Verdict

SOURCE-CONFIRMED, INCONCLUSIVE-RUNTIME (HW/module gated).

The cited defect exists in the audited source at sys/dev/drm/amd/amdgpu/amdgpu_bios.c:264-265. 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: amdgpu_atrm_call at L264-265 obj=(ACPI_OBJECT*)buffer.Pointer; memcpy(bios+offset,obj->Buffer.Pointer,obj->Buffer.Length) without verifying obj->Type==ACPI_TYPE_BUFFER. ACPI_OBJECT union (actypes.h:1077-1129) places Integer.Value at offset 8 same as Buffer.Length; malicious ACPI returning Integer would memcpy from a bogus pointer.

Check obj->Type==ACPI_TYPE_BUFFER before memcpy; also cap obj->Buffer.Length to ATRM_BIOS_PAGE.

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 --check on 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

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-1950/fix.diff (minimal targeted guard). VERDICT.md and manifest.json written. fix.diff validated by combined build.

Verified recommended fix

Check obj->Type==ACPI_TYPE_BUFFER before memcpy; also cap obj->Buffer.Length to ATRM_BIOS_PAGE. Full git-apply-able diff in findings/poc/DF-1950/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/amdgpu_bios.c:264-265. amdgpu (not in GENERIC, no AMD HW). amdgpu_atrm_call L264-265 obj=(ACPI_OBJECT*)buffer.Pointer; memcpy(bios+offset,obj->Buffer.Pointer,obj->Buffer.Length) without verifying obj->Type==ACPI_TYPE_BUFFER. ACPI_OBJECT union (actypes.h:1077-1129) places Integer.Value at offset 8 same as Buffer.Length; malicious ACPI returning Integer would memcpy from a bogus pointer -> heap overflow / type confusion. HW gated.