Skip to content

Commit af023ef

Browse files
Peter Zijlstrabp3tk0v
authored andcommitted
x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk()
vmlinux.o: warning: objtool: srso_untrain_ret() falls through to next function __x86_return_skl() vmlinux.o: warning: objtool: __x86_return_thunk() falls through to next function __x86_return_skl() This is because these functions (can) end with CALL, which objtool does not consider a terminating instruction. Therefore, replace the INT3 instruction (which is a non-fatal trap) with UD2 (which is a fatal-trap). This indicates execution will not continue past this point. Fixes: fb3bd91 ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230814121148.637802730@infradead.org
1 parent 77f6711 commit af023ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/lib/retpoline.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL)
258258
int3
259259
lfence
260260
call srso_safe_ret
261-
int3
261+
ud2
262262
SYM_CODE_END(srso_safe_ret)
263263
SYM_FUNC_END(srso_untrain_ret)
264264
__EXPORT_THUNK(srso_untrain_ret)
@@ -268,7 +268,7 @@ SYM_CODE_START(__x86_return_thunk)
268268
ANNOTATE_NOENDBR
269269
ALTERNATIVE_2 "jmp __ret", "call srso_safe_ret", X86_FEATURE_SRSO, \
270270
"call srso_safe_ret_alias", X86_FEATURE_SRSO_ALIAS
271-
int3
271+
ud2
272272
SYM_CODE_END(__x86_return_thunk)
273273
EXPORT_SYMBOL(__x86_return_thunk)
274274

0 commit comments

Comments
 (0)