# DF-1357 — amr_linux_ioctl AMR_CMD_PASS copyout overrun of ap_request_sense_area

## Summary
Clamp ap_request_sense_length to AMR_MAX_REQ_SENSE_LEN (0x20) before copyout.

## How to reproduce
This bug lives in a device driver not reachable from the booted QEMU guest as
an unprivileged user (`maxx`) because the required hardware is absent (AMD GPU,
RAID HBA, sound PCI, AMD SCSI) or the trigger requires a malicious hypervisor
(virtio_net, virtio_scsi).  The bug is reproduced at the **function level** by
porting the cited code path into a userspace harness that drives it with the
attacker-controlled inputs the original code fails to validate.

### Build
```sh
cc -O2 -Wall -o trigger trigger.c
```

### Run
```sh
./trigger
```

### Expected
- BEFORE-FIX section shows the bug signature (SIGFPE for div-by-zero, OOB index
  report for overflows, wraparound count for underflows, over-read length for
  info leaks).
- AFTER-FIX section shows the guard from `fix.diff` cleanly rejecting the
  attacker input.

The same harness was compiled and run on the **patched single-fix kernel**
(DragonFly 6.5-DEVELOPMENT #1) — output is identical because the harness
intentionally demonstrates both the unpatched and patched function logic side
by side, and the userspace behavior of those branches is independent of the
kernel.  The patched kernel build (`fix_build.log`) confirms all 15 `fix.diff`s
compile cleanly in the real kernel / module context.

## Impact classification
**leak:223** — gated by absent hardware / malicious-hypervisor precondition on
this guest; live trigger from `maxx` is not possible.  See `VERDICT.md` for
the threat-model analysis.

## Files
- `trigger.c` — function-level harness porting the cited code path.
- `fix.diff` — git-apply-able unified diff against `sys/`.
- `build.sh` / `run.sh` — exact repro commands.
- `run.log` — decisive harness output (BEFORE-FIX + AFTER-FIX).
- `fix_build.log` — patched kernel build log (proves all 15 fixes compile).
- `VERDICT.md` — full narrative analysis.
- `manifest.json` — machine-readable catalog.

Host has no gcc; harnesses built in guest as maxx with cc (DragonFly gcc 8.3).
