← Lab /Security & privacy

Tool automatically tests all A-B-A interleavings of kernel race condition test cases

Their MAccConc tooling can automatically test every possible A-B-A interleaving of a multi-threaded Linux kernel test case.

Security & privacy Google Project Zero 8 Sep 2026 Tooling Prototype evidence

Published as “Testing race conditions with memory access tracing and stack-based delay injection”

Why it matters

Provides a practical way to reliably reproduce and analyze kernel race conditions, aiding debugging, regression testing, and future automated discovery.

Summary

The author built MAccConc, a set of kernel and userspace tools that trace memory accesses via KCOV and ASAN instrumentation and inject delays through a custom ioctl to force specific thread orderings. An automatic tester enumerates all A-B-A interleavings for a two-thread test case, and a GUI/terminal UI lets users manually explore and constrain interleavings. In a demo with dup() and close() syscalls, the tool discovered an ordering where dup() returns the original file descriptor, confirming its ability to reproduce subtle race outcomes. The evidence is limited to a synthetic toy example, and the implementation currently supports only two threads and requires custom kernel patches.

What they found 2

  1. The automatic tester can discover specific interleavings such as dup() returning the original descriptor

    “It discovers one ordering where dup(5) returns 5 , which is working as intended but might be a somewhat surprising result:”

  2. Memory accesses are identified across executions using count-augmented stack traces

    “I am instead identifying memory accesses with count-augmented stack traces, where each stack trace element essentially consists of a callee function address and a number indicating how many calls to this callee should be skipped in the calling stack frame.”

Caveats 7

  • The command-line tooling can only handle two concurrent threads
  • The GUI implementation is described as "a bit more hacky"
  • Kernel patches required for the tooling are not yet upstreamed
  • ASAN instrumentation may miss on-stack objects and globals unless specific flags are disabled
  • The GUI implementation is a bit more hacky
  • Kernel patches are not yet in the upstream kernel; a custom branch is required
  • ASAN does not emit helper calls on direct stack memory access unless there is potential for out-of-bounds access

What’s new here 4

  • Automatic A-B-A interleaving tester that exhaustively explores two-thread orderings
  • Count-augmented stack traces to stably identify memory accesses across runs
  • Delay-injection ioctl (KCOV_SET_DI) enabling constraint-style and fully-specified ordering
  • Terminal UI and GUI for manual exploration and constraint creation