Skip to content

Commit 3e00f58

Browse files
keesakpm00
authored andcommitted
init/Kconfig: lower GCC version check for -Warray-bounds
We continue to see false positives from -Warray-bounds even in GCC 10, which is getting reported in a few places[1] still: security/security.c:811:2: warning: `memcpy' offset 32 is out of the bounds [0, 0] [-Warray-bounds] Lower the GCC version check from 11 to 10. Link: https://lkml.kernel.org/r/[email protected] Reported-by: Lu Yao <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/linux-next/[email protected] [1] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Paul Moore <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Gustavo A. R. Silva" <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Marc Aurèle La France <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nhat Pham <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent fc0c8f9 commit 3e00f58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,14 +876,14 @@ config CC_IMPLICIT_FALLTHROUGH
876876
default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
877877
default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
878878

879-
# Currently, disable gcc-11+ array-bounds globally.
879+
# Currently, disable gcc-10+ array-bounds globally.
880880
# It's still broken in gcc-13, so no upper bound yet.
881-
config GCC11_NO_ARRAY_BOUNDS
881+
config GCC10_NO_ARRAY_BOUNDS
882882
def_bool y
883883

884884
config CC_NO_ARRAY_BOUNDS
885885
bool
886-
default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC11_NO_ARRAY_BOUNDS
886+
default y if CC_IS_GCC && GCC_VERSION >= 100000 && GCC10_NO_ARRAY_BOUNDS
887887

888888
# Currently, disable -Wstringop-overflow for GCC globally.
889889
config GCC_NO_STRINGOP_OVERFLOW

0 commit comments

Comments
 (0)