⬢ DragonFlyBSD Kernel Audit
DF-2818 / verdict.json
← back to finding ↓ download raw
{
 "finding_id": "DF-2818",
 "status": "reproduced",
 "reproduced": 1,
 "impact": "none",
 "confidence": "certain",
 "verdict": "Mechanically reproduced on the stock guest across two pinned kernel threads (6-cpu guest): cpu0s thread acquired the token exclusively; cpu1s thread then called lwkt_token_init() on the live token - init unconditionally zeroes t_count/t_ref (lwkt_token.c:914-920) - and lwkt_trytoken() on cpu1 then SUCCEEDED (returned 1) while cpu0 still held the token: mutual exclusion silently broken with no diagnostic (harness T14). lwkt_token_uninit() is empty (no quiescence check). Fix validation was instructive: a KKASSERT in init false-positived at BOOT (rman_init re-inits tokens on recycled non-zeroed memory - the first fix kernel panicked at nexus_probe), so the shipped fix asserts quiescence at UNINIT only (where the token provably came from init) and zeroes the fields; the init-side re-init-of-live-token case cannot be asserted without an ownership marker (documented limitation - needs a state flag to be fully contained).",
 "exploit_chain": "re-init of a held token zeroes the holder claim -> second cpu acquires the exclusive token",
 "evidence": "harness.log T14: holder(cpu0) holds; taker re-init + trytoken=1 (acquired while held); boot-panic of fix-v1 documented in VERDICT.md",
 "kernel_refs": [
  "sys/kern/lwkt_token.c:914",
  "sys/kern/lwkt_token.c:923",
  "sys/vm/../kern/lwkt_token.c:918"
 ],
 "poc_changes": "none (kthread_create_cpu pinning + lwkt_trytoken avoids any hang risk)",
 "attempts": 3,
 "guest_uname": "DragonFly dfbsd 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": 180,
 "guest_dirty": 0,
 "build_cmd": "cd /root/h41 && make",
 "run_cmd": "kldload ./h41.ko; sysctl -w debug.h41.cmd=14",
 "code_hash": "85d6e241caa2a7fb1fb44b80c7736a4e83c36d29314b0c96ce91769bc9bdf839",
 "notes": "Fix-validation boot panic captured; in-tree callers disciplined, no trigger",
 "recommended_fix": "Assert quiescence in lwkt_token_uninit; a full fix needs an initialized-state marker for init",
 "fix_status": "partial",
 "fix_baseline_reproduced": 1,
 "fix_patched_reproduced": 1,
 "fix_kernel_uname": "DragonFly dfbsd 6.5-DEVELOPMENT #1: Mon Oct 26 01:57:23 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64 (h41 fix kernel, all 41 hardening fixes applied)",
 "fix_verdict": "Fix v1 (KKASSERT in init) panicked at boot via rman_init/nexus_probe - tokens are legitimately re-initialized on recycled memory. Shipped fix: uninit-side quiescence KKASSERT + field zeroing; init-side silent re-init remains possible without an ownership marker (documented; T14 on the fix kernel still acquires - the uninit assert is not on that path)."
}