mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk
@ 2024-04-05 14:46 bp
  2024-04-05 17:50 ` Borislav Petkov
  2024-04-06 11:07 ` [tip: x86/urgent] " tip-bot2 for Borislav Petkov (AMD)
  0 siblings, 2 replies; 3+ messages in thread
From: bp @ 2024-04-05 14:46 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov (AMD)

From: "Borislav Petkov (AMD)" <bp@alien8.de>

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

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
 arch/x86/lib/retpoline.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index 0795b3464058..e674ccf720b9 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -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)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk
  2024-04-05 14:46 [PATCH] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk bp
@ 2024-04-05 17:50 ` Borislav Petkov
  2024-04-06 11:07 ` [tip: x86/urgent] " tip-bot2 for Borislav Petkov (AMD)
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2024-04-05 17:50 UTC (permalink / raw)
  To: bp; +Cc: X86 ML, LKML

On Fri, Apr 05, 2024 at 04:46:37PM +0200, bp@kernel.org wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
> 
> 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")

> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> ---
>  arch/x86/lib/retpoline.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
> index 0795b3464058..e674ccf720b9 100644
> --- a/arch/x86/lib/retpoline.S
> +++ b/arch/x86/lib/retpoline.S
> @@ -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)
> -- 
> 2.43.0
> 

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: x86/urgent] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk
  2024-04-05 14:46 [PATCH] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk bp
  2024-04-05 17:50 ` Borislav Petkov
@ 2024-04-06 11:07 ` tip-bot2 for Borislav Petkov (AMD)
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Borislav Petkov (AMD) @ 2024-04-06 11:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Borislav Petkov (AMD), Ingo Molnar, Linus Torvalds, x86, linux-kernel

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) <bp@alien8.de>
AuthorDate:    Fri, 05 Apr 2024 16:46:37 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
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")
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240405144637.17908-1-bp@kernel.org
---
 arch/x86/lib/retpoline.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index 0795b34..e674ccf 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-06 11:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 14:46 [PATCH] x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk bp
2024-04-05 17:50 ` Borislav Petkov
2024-04-06 11:07 ` [tip: x86/urgent] " tip-bot2 for Borislav Petkov (AMD)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®