]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.26/x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch
Linux 6.6.26
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / x86-retpoline-add-noendbr-annotation-to-the-srso-dummy-return-thunk.patch
1 From b377c66ae3509ccea596512d6afb4777711c4870 Mon Sep 17 00:00:00 2001
2 From: "Borislav Petkov (AMD)" <bp@alien8.de>
3 Date: Fri, 5 Apr 2024 16:46:37 +0200
4 Subject: x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk
5
6 From: Borislav Petkov (AMD) <bp@alien8.de>
7
8 commit b377c66ae3509ccea596512d6afb4777711c4870 upstream.
9
10 srso_alias_untrain_ret() is special code, even if it is a dummy
11 which is called in the !SRSO case, so annotate it like its real
12 counterpart, to address the following objtool splat:
13
14 vmlinux.o: warning: objtool: .export_symbol+0x2b290: data relocation to !ENDBR: srso_alias_untrain_ret+0x0
15
16 Fixes: 4535e1a4174c ("x86/bugs: Fix the SRSO mitigation on Zen3/4")
17 Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
18 Signed-off-by: Ingo Molnar <mingo@kernel.org>
19 Cc: Linus Torvalds <torvalds@linux-foundation.org>
20 Link: https://lore.kernel.org/r/20240405144637.17908-1-bp@kernel.org
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 arch/x86/lib/retpoline.S | 1 +
24 1 file changed, 1 insertion(+)
25
26 --- a/arch/x86/lib/retpoline.S
27 +++ b/arch/x86/lib/retpoline.S
28 @@ -223,6 +223,7 @@ SYM_CODE_END(srso_return_thunk)
29 /* Dummy for the alternative in CALL_UNTRAIN_RET. */
30 SYM_CODE_START(srso_alias_untrain_ret)
31 ANNOTATE_UNRET_SAFE
32 + ANNOTATE_NOENDBR
33 ret
34 int3
35 SYM_FUNC_END(srso_alias_untrain_ret)