]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 4 Sep 2023 09:19:32 +0000 (11:19 +0200)
commit0f3e899eec304b859ff8558b089a5cb3dedb87a3
treecec56faf0050987d05f0414587f4a8693d49da87
parente4438efb478fe2c40f54fab027fb0635c0a8354b
x86/srso: Fix return thunks in generated code

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>
CVE-2023-20569
(cherry picked from commit 238ec850b95a02dcdff3edc86781aa913549282f)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/alternative.c
arch/x86/kernel/cpu/bugs.c