Skip to content
Commit 6053d8ff authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Will Deacon
Browse files

UPSTREAM: arm64: scs: Disable LTO for SCS patching code



Full LTO takes the '-mbranch-protection=none' passed to the compiler
when generating the dynamic shadow call stack patching code as a hint to
stop emitting PAC instructions altogether. (Thin LTO appears unaffected
by this)

Work around this by disabling LTO for the compilation unit, which
appears to convince the linker that it should still use PAC in the rest
of the kernel..

Fixes: 3b619e22 ("arm64: implement dynamic shadow call stack for Clang")
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
Tested-by: default avatarSami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20240123133052.1417449-6-ardb+git@google.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit d104a6fe)
Bug: 317883735
Change-Id: Ic4bdb0a6e527f8cb2745282b81945aa7b7231502
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent 696293ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment