⬢ DragonFlyBSD Kernel Audit
DF-3153 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-3153",
  "status": "untested",
  "reproduced": 0,
  "impact": "none",
  "confidence": "likely",
  "verdict": "Code path certain but not executed: hammer_free_freemap/hammer_count_bigblocks handle a zone-3 (UNDO) layer2 entry on a non-root volume with bare KKASSERT(0) (hammer_volume.c:554/590/804) while volume-del only guards the root volume (hammer_volume.c:195). In-tree tooling never places undo off-root (sbin/hammer/ondisk.c alloc_undo_bigblock(root_vol)), so triggering requires a CRC-correct crafted multi-volume image plus a privileged HAMMERIOC_DEL_VOLUME - not built this run. INVARIANTS: deterministic panic from the admin ioctl; production: the assert compiles out and the second pass bzero()s the undo layer2 entry while the root undomap still references it, silently truncating the undo FIFO (crash-recovery corruption, no error surfaced).",
  "exploit_chain": "privileged: mount crafted 2-volume hammer1 image with zone-3 layer2 (valid CRCs) on vol 1, then hammer volume-del <vol1 dev>",
  "evidence": [
    "README.md fix sketch and line references"
  ],
  "kernel_refs": [
    "sys/vfs/hammer/hammer_volume.c:552-557",
    "sys/vfs/hammer/hammer_volume.c:588-597",
    "sys/vfs/hammer/hammer_volume.c:802-807",
    "sys/vfs/hammer/hammer_volume.c:195-200",
    "sys/vfs/hammer/hammer_disk.h:789",
    "sys/vfs/hammer/hammer_blockmap.c:54-60"
  ],
  "poc_changes": "no seed; no PoC built (crafted-image precondition, Low severity, privileged)",
  "attempts": 0,
  "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": 0,
  "guest_dirty": 0,
  "build_cmd": "",
  "run_cmd": "",
  "code_hash": "",
  "notes": "Pass-2 depth result: the drain logic (allocator skip via volume_to_remove at hammer_blockmap.c:226, triple flusher_sync quiesce, buffer RB_SCAN filter at hammer_ondisk.c:946-955) is otherwise sound under fs_token; the undo-zone case is the one on-disk-legal state the del path asserts on instead of handling.",
  "recommended_fix": "Replace the three KKASSERT(0) undo cases with an explicit EBUSY/EINVAL rejection of volumes hosting undo big-blocks (del must abort before reblock/freemap wipe)"
}