⬢ DragonFlyBSD Kernel Audit
DF-5329 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-5329",
  "status": "reproduced",
  "reproduced": true,
  "impact": "silent integrity failure: the CAM cores only periph-refcount underflow detector (cam_periph.c:576) provably never fires because refcount is u_int32_t and is compared < 0; underflowed periphs (DF-5273/DF-5327 classes) become silent zombies with no diagnostic",
  "confidence": "certain",
  "verdict": "cam_periph_invalidate()s `else if (periph->refcount < 0) is dead code (u_int32_t). Guest proof: DF-5273 burn drove the cd periph refcount to -5 (0xFFFFFFFB), cam_periph_invalidate() was invoked on it, and zero occurrences of the warning appeared in dmesg. The guard this audit relied on for detection never fires on a stock kernel.",
  "exploit_chain": "",
  "evidence": "poc_ref.out (refcount -1 -> -3 lines), sysctl refcnt=-5, `dmesg | grep -c \"refcount < 0\" -> 0` after invalidate; README.md reproduce block",
  "kernel_refs": [
    "sys/bus/cam/cam_periph.c:576",
    "sys/bus/cam/cam_periph.c:577",
    "sys/bus/cam/cam_periph.h:123",
    "sys/bus/cam/cam_periph.c:352"
  ],
  "poc_changes": "reused DF-5273s poc_ref burn unchanged; added poc_guard.c wrapper that also invokes invalidate and greps dmesg",
  "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": 50,
  "guest_dirty": 0,
  "build_cmd": "cc -O -o poc_ref poc_ref.c",
  "run_cmd": "timeout 45 usched :1 ./poc_ref /dev/cd1; sysctl -n debug.evilcd.refcnt; sysctl -n debug.evilcd.invalidate=1; dmesg | grep -c refcount < 0",
  "code_hash": "38598013323c6353cca28770503999b008863bb463f9887c0e89f46f2b11a216",
  "notes": "Info/hardening finding; no kernel rebuild spent on its fix (inspection only). Same rig session as DF-5273.",
  "recommended_fix": "signed comparison in the guard plus an underflow check + loud report in cam_periph_release()s fast path (fix.diff)",
  "fix_status": "not_testable",
  "fix_baseline_reproduced": true,
  "fix_patched_reproduced": false,
  "fix_verdict": "fix.diff authored (guard cast + release-side underflow trap); not kernel-validated -- Info severity, validation budget spent on DF-5327",
  "fix_evidence": "fix.diff; code inspection"
}