⬢ DragonFlyBSD Kernel Audit
DF-4325 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-4325",
  "status": "reproduced",
  "reproduced": 1,
  "impact": "panic",
  "confidence": "certain",
  "verdict": "REPRODUCED on the live guest kernel via harness: sf_txeofs unchecked DMA-supplied 15-bit completion index (sf_index>>7, if_sf.c:998) indexes the 128-entry TX ring with values up to 255; the OOB-read sf_mbuf (planted 0xdeadc0de0000) fed to the REAL m_freem() panicked the kernel in m_free+0x10 (GPF), plus OOB NULL write and sf_tx_cnt 0->-1 underflow logged. gcc -Warray-bounds independently proves the expression OOB at build time. Hardware-gated in production (needs AIC-6915 completion DMA); uid=0 chain not attempted: no sf NIC on guest.",
  "exploit_chain": "on-hw chain (not exercisable on guest): NIC/faulty DMA emits TX completion with sf_index>=16384 -> OOB pointer read -> m_freem(arbitrary value) = wild free / NULL-write into RX rings + tx_cnt underflow -> heap corruption -> crash..privesc depending on adjacent allocations",
  "evidence": "run.log (mode1 log lines + mode2 panic sequence), panic.txt (Fatal trap 9, Stopped at m_free+0x10), build.log (gcc array-bounds static proof), sf_ring_harness.c",
  "kernel_refs": [
    "sys/dev/netif/sf/if_sf.c:998",
    "sys/dev/netif/sf/if_sf.c:1008",
    "sys/dev/netif/sf/if_sf.c:1010",
    "sys/dev/netif/sf/if_sf.c:1013",
    "sys/dev/netif/sf/if_sfreg.h:899",
    "sys/dev/netif/sf/if_sfreg.h:781"
  ],
  "poc_changes": "harness authored from scratch (none seeded): replicates sf_txeof index math + m_freem/NULL-write/tx_cnt stores verbatim; volatile laundering added so gcc cannot constant-fold the deliberately-OOB index (its -Warray-bounds diagnostic kept as static evidence)",
  "attempts": 4,
  "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": "cp /usr/src/sys/dev/netif/sf/if_sfreg.h /root/kmod/sfring/ && cd /root/kmod/sfring && make SYSDIR=/usr/src/sys",
  "run_cmd": "kldload /root/kmod/sfring/sf_ring_harness.ko && sysctl kern.sfrh.run=1 && sysctl kern.sfrh.run=2",
  "code_hash": "0e5aaac455bdfc0bdffad6e93c39e43cfc8f47330731d7150744fce738ab41d7",
  "notes": "guest reset with-src after runs. IDs reserved DF-4325..DF-4336 (batch).",
  "recommended_fix": "bounds-check cur_cmp->sf_index>>7 against SF_TX_DLIST_CNT and resync/reset on violation",
  "fix_status": "not_testable",
  "fix_baseline_reproduced": 1,
  "fix_patched_reproduced": 0,
  "fix_verdict": "fix targets sf_txeof() which only executes on AIC-6915 hardware absent from the guest; the harness replicates driver code inside its own module and cannot observe a sys/ source change",
  "fix_evidence": "fix.diff authored (bounds check + resync); no hardware path to validate"
}