Skip to contentSkip to conversation

x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk

PATCH Applied [email protected] 3 participants 3 messages Apr 5, 2024 – Apr 6, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk

From: "Borislav Petkov (AMD)" <[email protected]>

It 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:

vmlinux.o: warning: objtool: .export_symbol+0x2b290: data relocation to !ENDBR: srso_alias_untrain_ret+0x0

---
 arch/x86/lib/retpoline.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/lib/retpoline.S +1 -0
index 0795b3464058..e674ccf720b9 100644
@@ -229,6 +229,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)
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 7 lines · On Fri, Apr 05, 2024 at 04:46:37PM +0200, [email protected] wrote:

From: "Borislav Petkov (AMD)" <[email protected]>

It 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:

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")
Quoted 20 lines
---
 arch/x86/lib/retpoline.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/lib/retpoline.S +1 -0
index 0795b3464058..e674ccf720b9 100644
@@ -229,6 +229,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)
Signature · 1 line
2.43.0
Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
In reply to [email protected]
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     b377c66ae3509ccea596512d6afb4777711c4870
Gitweb:        https://git.kernel.org/tip/b377c66ae3509ccea596512d6afb4777711c4870
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Fri, 05 Apr 2024 16:46:37 +02:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Sat, 06 Apr 2024 13:01:50 +02:00

x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk

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")
Cc Linus Torvalds <[email protected]>
---
 arch/x86/lib/retpoline.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/lib/retpoline.S +1 -0
index 0795b34..e674ccf 100644
@@ -229,6 +229,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)