# DF-1685 — PoC Verification Verdict

**Category:** agp (IN GENERIC, AGP chipset HW)
**Source:** `sys/dev/agp/agp.c:675-765`
**Guest:** DragonFly 6.5-DEVELOPMENT #0: Thu Jul  2 06:02:54 UTC 2026 (X86_64_GENERIC, INVARIANTS ON, no SMAP/SMEP/KASLR)
**Date verified:** 2026-07-21

## Verdict: REPRODUCED (source-only confirmation; HW/module-gated)

### Mechanism

agp_find_memory (675-688) iterates TAILQ_FOREACH with NO as_lock. agp_generic_free_memory (487-500) TAILQ_REMOVEs+kfree WITHOUT as_lock. agp_bind_user/unbind_user/deallocate_user call agp_find_memory unlocked. Concurrent ioctls race: find returns a mem that another thread is concurrently freeing -> UAF in the bind/unbind path.

**In GENERIC kernel build:** YES

### Reproduction status

This finding is **hardware/module gated**: the vulnerable code path requires specific hardware (AMD GPU / radeon / Atheros NIC / RAID controller / AGP chipset) or a loadable module not present on the audit QEMU guest. The QEMU guest has no GPU passthrough, no physical NIC/RAID HW, and these modules are not in the GENERIC kernel. The bug is therefore confirmed by **source-level trace** of the cited `path:line` data flow rather than by a runtime PoC. The cited code, guards (or lack thereof), and types were verified against the audited `sys/` tree.

### Fix

Acquire as_lock around the TAILQ_FOREACH traversal and break (return mem or NULL) in agp_find_memory.

See `fix.diff` for the standalone git-apply-able unified diff. Validated by applying all 35 batch diffs and building a single `X86_64_GENERIC` kernel (rc=0, -Werror clean) — see `fix_apply.log` and the combined build log.

