Linux 5.8 Lands The Kernel Concurrency Sanitizer To Spot Race Conditions
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.
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.
7 Comments