security: Restrict CONFIG_ZERO_CALL_USED_REGS to gcc or clang > 15.0.6
authorNathan Chancellor <nathan@kernel.org>
Wed, 14 Dec 2022 23:26:03 +0000 (16:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:10 +0000 (13:33 +0100)
commit21ca0bfa11bbb9a9207f5d2104f47d3d71b4616e
tree36c86511937a85179401431df4cbd9b37d1403e2
parent967fc34f297e40fd2e068cf6b0c3eb4916228539
security: Restrict CONFIG_ZERO_CALL_USED_REGS to gcc or clang > 15.0.6

commit d6a9fb87e9d18f3394a9845546bbe868efdccfd2 upstream.

A bad bug in clang's implementation of -fzero-call-used-regs can result
in NULL pointer dereferences (see the links above the check for more
information). Restrict CONFIG_CC_HAS_ZERO_CALL_USED_REGS to either a
supported GCC version or a clang newer than 15.0.6, which will catch
both a theoretical 15.0.7 and the upcoming 16.0.0, which will both have
the bug fixed.

Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221214232602.4118147-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/Kconfig.hardening