Linux 6.8 Now Enables -Wstringop-overflow To Warn About Buffer Overflows

Written by Michael Larabel in Linux Kernel on 22 January 2024 at 01:28 PM EST. 15 Comments
LINUX KERNEL
A change merged today for the Linux 6.8 kernel intentionally following yesterday's Linux 6.8-rc1 is a move to enable the "-Wstringop-overflow" compiler option by default.

The -Wstringop-overflow warning is used with recent compilers to warn about string manipulation functions that are determined to overflow the destination buffer. This will provide a compiler warning for known cases where calls to the likes of strcpy or memcpy would for certain yield a buffer overflow.

As of today in Linux Git, the -Wstringop-overflow option is used by default with the exception of when building the kernel with the GCC 11 compiler due to known bugs in that version.

This change was diverted until after the Linux 6.8 merge window was over so a final test build could be done to ensure no new warnings came up over this compiler option. In fact, Gustavo Silva who spearheaded the initiative did 358 test builds of the kernel overnight for different architectures and kernel configurations to verify everything was in good shape with Linux 6.8-rc1.

The code is now merged as another buffer overflow safeguard for users/developers.
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