summaryrefslogtreecommitdiff
path: root/samples/hidraw
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-05-17 16:18:11 -0700
committerKees Cook <keescook@chromium.org>2023-05-22 12:33:53 -0700
commitdf8fc4e934c12b906d08050d7779f292b9c5c6b5 (patch)
treeeff293b0a9ca59c1f4a7e017d8447be5efb639a6 /samples/hidraw
parent08e4044243a668ea2801cebffcb7c07df568ed3f (diff)
downloadlwn-df8fc4e934c12b906d08050d7779f292b9c5c6b5.tar.gz
lwn-df8fc4e934c12b906d08050d7779f292b9c5c6b5.zip
kbuild: Enable -fstrict-flex-arrays=3
The -fstrict-flex-arrays=3 option is now available with the release of GCC 13[1] and Clang 16[2]. This feature instructs the compiler to treat only C99 flexible arrays as dynamically sized for the purposes of object size calculations. In other words, the ancient practice of using 1-element arrays, or the GNU extension of using 0-sized arrays, as a dynamically sized array is disabled. This allows CONFIG_UBSAN_BOUNDS, CONFIG_FORTIFY_SOURCE, and other object-size aware features to behave unambiguously in the face of trailing arrays: only C99 flexible arrays are considered to be dynamically sized. For yet more detail, see: https://people.kernel.org/kees/bounded-flexible-arrays-in-c Enabling this will help track down any outstanding cases of fake flexible arrays that need attention in kernel code. [1] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-fstrict-flex-arrays [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fstrict-flex-arrays Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Nicolas Schier <nicolas@fjasle.eu> Cc: linux-kbuild@vger.kernel.org Co-developed-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'samples/hidraw')
0 files changed, 0 insertions, 0 deletions