Linux 5.8 Lands The Kernel Concurrency Sanitizer To Spot Race Conditions
Written by Michael Larabel in Linux Kernel on 12 June 2020 at 07:41 AM EDT. 7 Comments
LINUX KERNEL --
Merged overnight into the Linux 5.8 code-base is KCSAN, the Kernel Concurrency Sanitizer that is a dynamic race detector for spotting flaws in the kernel code.

The Linux Kernel Concurrency Sanitizer with this newly-added kernel code (4k+ lines of code) paired with compiler-based instrumentation in supported compilers is able to provide detection of race conditions happening within the kernel.

Even before being mainlined to the kernel, KCSAN has already been successful in spotting legitimate kernel bugs and now with it being mainlined should see more usage in helping uncover other code flaws dealing with multiple threads/concurrency.

While KCSAN is part of the Linux 5.8 kernel, currently only the LLVM Clang 11 Git compiler has the necessary compiler instrumentation for working with KCSAN. When building with GCC or older Clang releases, KCSAN support is not available. Clang 11 won't be out as stable until August~September, shortly after the release of Linux 5.8 stable.

So it's great seeing the Kernel Concurrency Sanitizer merged for helping to uncover more kernel bugs and will hopefully see an uptick in adoption once the compiler support is more widespread.

More details on KCSAN via Google's GitHub with this being another sanitizer spearheaded by the search giant. Their documentation notes 60+ bugs fixed so far by KCSAN.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week