From 69b28f9335a8295eced5ed2ff8d6bf22d3254442 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 8 Apr 2024 10:29:25 +0200 Subject: [PATCH] 6.6-stable patches added patches: x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch --- queue-6.6/series | 1 + ...ation-to-the-srso-dummy-return-thunk.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 queue-6.6/x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch diff --git a/queue-6.6/series b/queue-6.6/series index 4afd1447bce..de450f275a4 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -199,3 +199,4 @@ sunrpc-fix-a-slow-server-side-memory-leak-with-rpc-o.patch riscv-disable-preemption-when-using-patch_map.patch nfsd-hold-a-lighter-weight-client-reference-over-cb_.patch ice-fix-typo-in-assignment.patch +x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch diff --git a/queue-6.6/x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch b/queue-6.6/x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch new file mode 100644 index 00000000000..bd3954cd28d --- /dev/null +++ b/queue-6.6/x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch @@ -0,0 +1,35 @@ +From b377c66ae3509ccea596512d6afb4777711c4870 Mon Sep 17 00:00:00 2001 +From: "Borislav Petkov (AMD)" +Date: Fri, 5 Apr 2024 16:46:37 +0200 +Subject: x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk + +From: Borislav Petkov (AMD) + +commit b377c66ae3509ccea596512d6afb4777711c4870 upstream. + +srso_alias_untrain_ret() is special code, even if it is a dummy +which is called in the !SRSO case, so annotate it like its real +counterpart, to address the following objtool splat: + + vmlinux.o: warning: objtool: .export_symbol+0x2b290: data relocation to !ENDBR: srso_alias_untrain_ret+0x0 + +Fixes: 4535e1a4174c ("x86/bugs: Fix the SRSO mitigation on Zen3/4") +Signed-off-by: Borislav Petkov (AMD) +Signed-off-by: Ingo Molnar +Cc: Linus Torvalds +Link: https://lore.kernel.org/r/20240405144637.17908-1-bp@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/lib/retpoline.S | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/x86/lib/retpoline.S ++++ b/arch/x86/lib/retpoline.S +@@ -223,6 +223,7 @@ SYM_CODE_END(srso_return_thunk) + /* Dummy for the alternative in CALL_UNTRAIN_RET. */ + SYM_CODE_START(srso_alias_untrain_ret) + ANNOTATE_UNRET_SAFE ++ ANNOTATE_NOENDBR + ret + int3 + SYM_FUNC_END(srso_alias_untrain_ret) -- 2.47.3