]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero
authorKees Cook <keescook@chromium.org>
Fri, 30 Sep 2022 05:57:43 +0000 (22:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Oct 2022 07:51:23 +0000 (09:51 +0200)
commit3b760c94de19c8296a6aa861845b348f14f335f7
tree0ad4c8c9a669bc8d67508a6fe36d13dda5b559b1
parent19a4cb1c4eb8f15a72700a20f778c52028e687b7
hardening: Remove Clang's enable flag for -ftrivial-auto-var-init=zero

commit 607e57c6c62c00965ae276902c166834ce73014a upstream.

Now that Clang's -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
option is no longer required, remove it from the command line. Clang 16
and later will warn when it is used, which will cause Kconfig to think
it can't use -ftrivial-auto-var-init=zero at all. Check for whether it
is required and only use it when so.

Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kbuild@vger.kernel.org
Cc: llvm@lists.linux.dev
Cc: stable@vger.kernel.org
Fixes: f02003c860d9 ("hardening: Avoid harmless Clang option under CONFIG_INIT_STACK_ALL_ZERO")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Makefile
security/Kconfig.hardening