]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 14 Aug 2023 11:44:28 +0000 (13:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Aug 2023 12:23:38 +0000 (14:23 +0200)
commit0d810eff090c30535f5cb8db6a6cfbaed7aa499a
treea4d26ee7302e298fcffd7aaef9f8fb163e35c354
parent8089aae6020e51d556dcc6af54495c9aa99a761c
x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk()

commit af023ef335f13c8b579298fc432daeef609a9e60 upstream.

  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: fb3bd914b3ec ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/lib/retpoline.S