Kernel Memory Sanitizer Lands For Linux 6.1

Written by Michael Larabel in Linux Kernel on 12 October 2022 at 04:00 AM EDT. 5 Comments
LINUX KERNEL
In addition to Linux 6.1 x86_64 defaulting to warning over W+X mappings and other security-minded improvements this merge window, another benefit of this next kernel is the mainlining of the Kernel Memory Sanitizer (KMSAN).

The Kernel Memory Sanitizer is now in mainline as a dynamic error detector. KMSAN is focused on finding use of uninitialized values within the kernel code. KMSAN relies on compiler instrumentation like the other sanitizers to provide this capability.

While merged for Linux 6.1, the Kernel Memory Sanitizer documentation indicates that it isn't intended for production as it "drastically increases" the kernel memory footprint and has significant system performance implications.

In any event if wanting to run the Kernel Memory Sanitizer to look for uninitialized value use witin the kernel, KMSAN can enabled with CONFIG_KMSAN and requires using the LLVM Clang 14 compiler or newer.

See the new documentation for more details on KMSAN in Linux 6.1. KMSAN was merged as part of Andrew Morton's "mm" patches.
Related News
About The Author
Michael Larabel

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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week