]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/srso: Fix return thunks in generated code
authorJosh Poimboeuf <jpoimboe@kernel.org>
Fri, 28 Jul 2023 22:28:43 +0000 (17:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Aug 2023 17:58:34 +0000 (19:58 +0200)
commitdf4c3823cba5c43e2321eface8501bfafe76d0d9
tree341cb322ea1e6cd4faf220fac393ad7785b9d4f0
parent0071b17eb66b12151f83cdbfc9824743004f87eb
x86/srso: Fix return thunks in generated code

Upstream commit: 238ec850b95a02dcdff3edc86781aa913549282f

Set X86_FEATURE_RETHUNK when enabling the SRSO mitigation so that
generated code (e.g., ftrace, static call, eBPF) generates "jmp
__x86_return_thunk" instead of RET.

  [ bp: Add a comment. ]

Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/alternative.c
arch/x86/kernel/cpu/bugs.c