DragonFlyBSD Kernel Audit
DF-0893 / fix_run.log
← back to finding ↓ download raw
DF-0893 deterministic race harness for hammer_enter_undo_history()
Transcribes sys/vfs/hammer/hammer_undo.c:432-460 (unlocked) called from
hammer_generate_undo() at hammer_undo.c:125 BEFORE undo_lock at :133.

--- Trial 0: KKASSERT panic mode (models GENERIC INVARIANTS) ---
=== BUGGY    : 4 thr x 8000 ops range=1000000 (UNLOCKED-buggy) ===
  RESULT : RACE CONFIRMED - TAILQ corruption caused a wild
           pointer write (SIGSEGV) -- CWE-787 manifestation
           on a non-INVARIANTS (noinv) kernel
=== FIXED    : 4 thr x 8000 ops range=1000000 (LOCKED-fix) ===
  KKASSERT(onode==NULL) trips   : 0
  undo_alloc overshoot (OOB idx): 0
  TAILQ/RB list corruption       : 0
  undo_alloc final               : 1024
  RESULT                         : no violations detected

--- Trial 1: undo_alloc counter race (large offset range) ---
=== BUGGY    : 4 thr x 8000 ops range=1000000 (UNLOCKED-buggy) ===
  RESULT : RACE CONFIRMED - corruption created a cycle in the
           RB/TAILQ structure -> infinite loop (kernel would
           wedge in-kernel, equivalent to a DoS hang)
=== FIXED    : 4 thr x 8000 ops range=1000000 (LOCKED-fix) ===
  KKASSERT(onode==NULL) trips   : 0
  undo_alloc overshoot (OOB idx): 0
  TAILQ/RB list corruption       : 0
  undo_alloc final               : 1024
  RESULT                         : no violations detected

--- Trial 2: LRU-recycle race (small offset range, history full) ---
=== BUGGY    : 4 thr x 8000 ops range=2048 (UNLOCKED-buggy) ===
  RESULT : RACE CONFIRMED - TAILQ corruption caused a wild
           pointer write (SIGSEGV) -- CWE-787 manifestation
           on a non-INVARIANTS (noinv) kernel
=== FIXED    : 4 thr x 8000 ops range=2048 (LOCKED-fix) ===
  KKASSERT(onode==NULL) trips   : 0
  undo_alloc overshoot (OOB idx): 0
  TAILQ/RB list corruption       : 0
  undo_alloc final               : 1024
  RESULT                         : no violations detected

--- Trial 3: higher concurrency (8 threads) ---
=== BUGGY    : 8 thr x 8000 ops range=1000000 (UNLOCKED-buggy) ===
  RESULT : RACE CONFIRMED - TAILQ corruption caused a wild
           pointer write (SIGSEGV) -- CWE-787 manifestation
           on a non-INVARIANTS (noinv) kernel
=== FIXED    : 8 thr x 8000 ops range=1000000 (LOCKED-fix) ===
  KKASSERT(onode==NULL) trips   : 0
  undo_alloc overshoot (OOB idx): 0
  TAILQ/RB list corruption       : 0
  undo_alloc final               : 1024
  RESULT                         : no violations detected

DONE
HARNESS_RC=0