⬢ DragonFlyBSD Kernel Audit
DF-4345 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-4345",
  "status": "inconclusive",
  "reproduced": 0,
  "impact": "none",
  "confidence": "certain",
  "verdict": "Code defect certain: the amdgpu atom_context (amd/amdgpu/atom.h:125-143) has no bios length and amdgpu_atom_parse (amdgpu_atombios.c:2037) passes none -- even though adev->bios_size already exists (amdgpu.h:860) and every amdgpu_bios.c reader sets it (bios_size at :111/:140/:179/:217/:357/:431). Every 16-bit VBIOS offset dereference is unbounded: master/cmd/data/IIO table pointers at atom.c:1323-1334, interpreter base+fetch loop at atom.c:1200/1228-1249 (ptr moved by jumps atom.c:756 and switch walks atom.c:1004-1022), ID operand U32(idx+data_block) at atom.c:268 (reach ~128KB), calltable/setdatablock master entries at atom.c:619/869, asic_init FWI chain at atom.c:1356-1367, and the verbatim twin parsers amdgpu_atom_parse_data_header/amdgpu_atom_parse_cmd_header at atom.c:1384-1420 (idx/*size/*data_start unvalidated; ~38+16 downstream call sites). Kernel runtime could not be exercised (no AMD GPU on the guest, QEMU bochs vga only); proven instead on the guest by a guard-page userland mirror of the exact expressions: ALL 8 OOB cases (data_header, cmd_header, id_operand, master_entry, iio, partstr, asic_fwi, fetchloop) SIGSEGV deterministically (exit 139, run.log); the DF-4337 port fix logic (bios_size + amdgpu_atom_in_bios gates incl. the fetch loop) rejects every case cleanly (exit 0, fix_run.log).",
  "exploit_chain": "",
  "evidence": "run.log: 8/8 OOB cases Segmentation fault exit=139; fix_run.log: all cases rejected exit 0; fix.diff (3 files, git apply --check OK); VERDICT.md site table with path:line + downstream neutralization assessment (DF-4104 mostly, DF-4152/DF-4289 partial, DF-4048 unaffected)",
  "kernel_refs": [
    "sys/dev/drm/amd/amdgpu/atom.h:125",
    "sys/dev/drm/amd/amdgpu/atom.c:268",
    "sys/dev/drm/amd/amdgpu/atom.c:619",
    "sys/dev/drm/amd/amdgpu/atom.c:869",
    "sys/dev/drm/amd/amdgpu/atom.c:1200",
    "sys/dev/drm/amd/amdgpu/atom.c:1229",
    "sys/dev/drm/amd/amdgpu/atom.c:1287",
    "sys/dev/drm/amd/amdgpu/atom.c:1323",
    "sys/dev/drm/amd/amdgpu/atom.c:1356",
    "sys/dev/drm/amd/amdgpu/atom.c:1384",
    "sys/dev/drm/amd/amdgpu/atom.c:1405",
    "sys/dev/drm/amd/amdgpu/amdgpu_atombios.c:2037",
    "sys/dev/drm/amd/amdgpu/amdgpu.h:860",
    "sys/dev/drm/amd/amdgpu/amdgpu_bios.c:140"
  ],
  "poc_changes": "harness adapted from the DF-4337 radeon mirror to the amdgpu twins (renamed functions, vbios_version part-string instead of name[512], asic_init FWI, fetch-loop NOP walk); fixed one comment self-termination bug and EINVAL include on the guest build",
  "attempts": 3,
  "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul  2 06:02:54 UTC 2026     root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64",
  "runtime_sec": 900,
  "guest_dirty": 0,
  "build_cmd": "cc -O1 -g -o atom_harness atom_harness.c && cc -O1 -g -o atom_harness_fixed atom_harness_fixed.c (on DragonFly guest)",
  "run_cmd": "./atom_harness <case> for the 8 OOB cases (expect 139) ; ./atom_harness_fixed <case> (expect 0)",
  "code_hash": "5356b23349edbb49469348db664a12cf6437fa43fe980eef7d322939a6da7eba",
  "notes": "Hardware-gated at kernel runtime (no AMD GPU; QEMU cannot emulate an AMD card with custom VBIOS ROM). Downstream: DF-4104 mostly neutralized (residual: declared size < 0x2C with in-image over-read -- caller-side size check recommended), DF-4152/DF-4289 partially (inner walks need per-site bounds), DF-4048 unaffected, bios_parser2.c paths NOT covered (never calls amdgpu_atom_parse_data_header). Knowns NOT re-reported and NOT fixed by this port: DF-1542/1543/1544/1545. Adjacent observation (other file, folded here): check_atom_bios reads bios[0x49] after only size>=0x49 (amdgpu_bios.c:52-64) -- off-by-one on size==0x49. amdgpu-vs-radeon diff: interpreter core byte-identical modulo printk renames + RV515 quirk; amdgpu adds mul32/div32 (benign) and the part-string tail (DF-4347).",
  "recommended_fix": "Port DF-4337s central fix: add bios_size to amd/amdgpu/atom.hs atom_context, pass adev->bios_size at amdgpu_atombios.c:2037, and gate every bios-offset dereference (both header parsers, interpreter fetch loop, ID/calltable/setdatablock reads, IIO walk, asic_init FWI, part-number string) behind amdgpu_atom_in_bios()",
  "fix_status": "inconclusive",
  "fix_baseline_reproduced": 0,
  "fix_patched_reproduced": 0,
  "fix_verdict": "fix.diff (293 lines, 3 files) passes git apply --check against the pristine tree; the fixed-logic mirror on the guest rejects all 8 baseline-trapping inputs (ok=0/ret=-EINVAL, exit 0) where the baseline traps (139). A patched-kernel run is impossible on this guest (no AMD/ATOM hardware), so fixed-at-kernel-runtime is not demonstrable; unlike the radeon fix, no amdgpu_bios.c plumbing is required because adev->bios_size already exists.",
  "fix_evidence": "fix.diff; fix_run.log (all 9 cases exit 0 with clean rejections); VERDICT.md Fix (the DF-4337 port) + validation"
}