⬢ DragonFlyBSD Kernel Audit
DF-2876 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-2876",
  "status": "reproduced",
  "reproduced": 1,
  "impact": "leak",
  "confidence": "certain",
  "verdict": "diskiodone attaches bp->b_data/b_bcount to the BLK reply before checking B_ERROR/b_resid (subr_diskiocom.c:594-597, :651-655), so a read that transfers nothing ships the stale contents of the SHARED getpbuf_mem KVA arena (vm_pager.c:505 - reused by every processs raw-device physio, kern_physio.c:43, and disk label probes). Verified: a BLK_READ at exact EOF on a vnode-backed vn disk (VOP_READ returns success with untouched resid) returned error=0 resid=65536 with a 64KB aux byte-identical (md5) to a previous root processs physio buffer of a secret image; a second run leaked the BOOT DISKs MBR boot code through a different disks channel (cross-device). Fixed kernel returns aux=0.",
  "exploit_chain": "dmsg peer -> BLK_READ at/after media EOF (or any erroring read) -> reply aux = most recent raw-I/O buffer of ANY process on the machine (up to MAXPHYS per request, repeatable) -> harvest other tenants/roots disk traffic (backups, fsck scans, other cluster nodes data)",
  "evidence": [
    "run.log (error=0 resid=65536 aux=65536; LEAK_RUN_1 FULL_64K_BLOCK_MATCHES_SECRET; run2 leaked boot-sector bytes fc310c8e...)",
    "leak_sample.txt",
    "f3_leak_1.bin == f3_secret.bin (md5 7081aa33857826393038748400c1ee27)",
    "run.fix.log (aux=0 x3 on fix kernel)"
  ],
  "kernel_refs": [
    "sys/kern/subr_diskiocom.c:594",
    "sys/kern/subr_diskiocom.c:600",
    "sys/kern/subr_diskiocom.c:651",
    "sys/kern/subr_diskiocom.c:655",
    "sys/vm/vm_pager.c:505",
    "sys/kern/kern_physio.c:43"
  ],
  "poc_changes": "No seed; wrote dfpeer.c eofread mode; deterministic EOF trigger discovered via vn(4) vnode strategy (success + untouched uio_resid at EOF)",
  "attempts": 2,
  "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": 420,
  "guest_dirty": 1,
  "build_cmd": "cc -O -Wall -o /tmp/dfpeer dfpeer.c",
  "run_cmd": "sh run_f3.sh (root)",
  "code_hash": "e748ca2203c63d4fc7c412513eefcdf465800329f3e8ff3c36dbd9f5d0583722",
  "notes": "Same runs also demonstrate the arena is global across devices (boot-disk MBR via vn0 channel).",
  "recommended_fix": "On B_ERROR attach no data; on short reads attach only completed bytes (b_bcount - b_resid)",
  "fix_status": "fixed",
  "fix_kernel_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #1: Wed Sep  2 18:43:16 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64 (fix.diff applied, make nativekernel)",
  "fix_baseline_reproduced": 1,
  "fix_patched_reproduced": 0,
  "fix_verdict": "Fix kernel: all three EOF-read runs return aux=0 (resid still reported). Leak dead.",
  "fix_evidence": [
    "run.fix.log"
  ]
}