[PATCH 12/12] arm64/bti: Enable kernel BTI for GCC

Josh Poimboeuf <[email protected]>
Newsgroups org.kernel.vger.linux-toolchains,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching
Message-ID <c08ef46772d364db9b904fac0861adbb3a3bd4e2.1786768375.git.jpoimboe@kernel.org>
Commit c0a454b9044f ("arm64/bti: Disable in kernel BTI when cross
section thunks are broken") disabled in-kernel BTI for GCC because it
omits a function's BTI landing pad when it determines that a function
can only ever reached by a direct branch.  The observed failure was a
module whose init text landed far enough from its core text to need a
PLT, whose "br x16" then hit a function with no "bti c".

Note that behavior isn't GCC-specific: Clang 21 has started ommitting
landing pads as well.

Now that all the known BTI bugs have been sorted out, re-enable it for
GCC.

Signed-off-by: Josh Poimboeuf <[email protected]>
---
 arch/arm64/Kconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 2687b71438661..e150807b03016 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2114,8 +2114,6 @@ config ARM64_BTI_KERNEL
 	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
 	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
 	depends on !CC_IS_GCC || GCC_VERSION >= 100100
-	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
-	depends on !CC_IS_GCC
 	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_ARGS)
 	help
 	  Build the kernel with Branch Target Identification annotations
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.