# DF-4345 — amdgpu ATOM interpreter + master-table parsers dereference unvalidated VBIOS offsets (no bios_size)

`sys/dev/drm/amd/amdgpu/atom.c` is the amdgpu twin of radeon's atom.c
(DF-4337, whose central fix this port mirrors). `struct atom_context`
carries no bios length, so every 16-bit offset taken from VBIOS content
is dereferenced unbounded:

- master table pointers + IIO pointer at attach: atom.c:1323-1334
- part-number string walk: atom.c:1340-1348 (filed separately as DF-4347)
- IIO table walk + opcode index: atom.c:1280-1294 (filed as DF-4346)
- interpreter table base + header: atom.c:1200-1211
- interpreter fetch loop (jump/switch-movable ptr): atom.c:1228-1249
- ID operand: atom.c:268
- calltable / setdatablock master entries: atom.c:619, 869
- asic_init FWI chain: atom.c:1356-1367
- `amdgpu_atom_parse_data_header` / `parse_cmd_header`: atom.c:1384-1420

Plumbing for the fix already exists on the amdgpu side:
`adev->bios_size` (amdgpu.h:860) is set by every reader in
amdgpu_bios.c (:111, :140, :179, :217, :357, :431); only the call at
amdgpu_atombios.c:2037 and the atom_context itself ignore it.

## Reproduce (logic level — guest has no AMD GPU)

```
cc -O1 -g -o atom_harness atom_harness.c
./atom_harness data_header    # + 7 more OOB cases -> SIGSEGV/139 each
./atom_harness_fixed data_header   # fixed logic -> clean reject, exit 0
```

`run.log` (baseline) traps on all 8 OOB cases at the exact kernel
expressions; `fix_run.log` shows the ported-fix logic rejecting every
case. Kernel-runtime validation requires an AMD card with a crafted
VBIOS (or writable ROM shadow), which QEMU cannot provide.

## Fix

`fix.diff` — add `bios_size` to `atom_context`, plumb
`amdgpu_atom_parse(card, bios, bios_size)` from `adev->bios_size`, and
gate all bios-offset dereferences behind `amdgpu_atom_in_bios()`
(including the interpreter fetch loop and the part-number string).
Neutralizes the outer offsets of the DF-4104/DF-4152/DF-4289 family on
the amdgpu side (see VERDICT.md for the per-finding assessment).
