Linux 6.8 Now Enables -Wstringop-overflow To Warn About Buffer Overflows
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.
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.
15 Comments