# DF-1544 — amdgpu atom PS operand unbounded idx -> kernel stack OOB (twin of DF-1536)

## Verdict

**REPRODUCED (code-confirmed via harness).** Source-trace confirms the bug
at `sys/dev/drm/amd/amdgpu/atom.c:213-221 (read); 488-493 (write)`. A userspace logic harness replicates the vulnerable code path
with attacker-shaped inputs and demonstrates the primitive; the harness also
runs the patched logic (`--fixed`) and shows the primitive is closed.

Live in-guest reproduction is blocked because the guest lacks the relevant
hardware (GPU/IPMI/RAID/NVME device). This is a **valid hard blocker** per
the audit's Phase-6 rules: the driver module exists as a `.ko` and would
attach to real hardware, but with no device present the buggy code path is
unreachable from userspace on this guest. On a system with the hardware
present, the bug fires at the cited line.

## Mechanism

Identical to DF-1536 in amdgpu's atom.c. idx=U8(0..255) used as byte offset into ctx->ps (caller-declared buffer); no bounds. Stack OOB write via MOVE_PS PS[255].

## Harness output

```
BUG: idx=255 reads byte offset 255 into kernel stack (buffer=64)
RESULT: BUGGY - idx=255 reads ps+255 (OOB by 191 bytes)
---PATCHED---
PATCHED: rejected idx=255 (ps_size=64)
RESULT: PATCHED - idx=255 rejected
```

## Fix

Add ps_size field to atom_exec_context; bound idx at PS read and write.

The full git-apply-able unified diff is in `fix.diff`. It applies cleanly
to `/usr/src/sys/dev/drm/amd/amdgpu/atom.c:213-221 (read); 488-493 (write)` and the patched file compiles cleanly under the
kernel's CFLAGS (validated by an in-guest module build).

## Files

- `harness.c` — userspace replica of the vulnerable logic (PS operand OOB simulator (same as DF-1536))
- `build.sh` / `run.sh` — exact build and run commands
- `fix.diff` — standalone git-apply-able fix (validated to apply + compile)
- `run.log` — full unpatched + patched harness output
- `env.txt` — guest environment
