linux-stable/tools/objtool
Borislav Petkov (AMD) acdc883eb6 x86/srso: Add a Speculative RAS Overflow mitigation
Upstream commit: fb3bd914b3

Add a mitigation for the speculative return address stack overflow
vulnerability found on AMD processors.

The mitigation works by ensuring all RET instructions speculate to
a controlled location, similar to how speculation is controlled in the
retpoline sequence.  To accomplish this, the __x86_return_thunk forces
the CPU to mispredict every function return using a 'safe return'
sequence.

To ensure the safety of this mitigation, the kernel must ensure that the
safe return sequence is itself free from attacker interference.  In Zen3
and Zen4, this is accomplished by creating a BTB alias between the
untraining function srso_untrain_ret_alias() and the safe return
function srso_safe_ret_alias() which results in evicting a potentially
poisoned BTB entry and using that safe one for all function returns.

In older Zen1 and Zen2, this is accomplished using a reinterpretation
technique similar to Retbleed one: srso_untrain_ret() and
srso_safe_ret().

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 20:04:51 +02:00
..
arch x86/srso: Add a Speculative RAS Overflow mitigation 2023-08-08 20:04:51 +02:00
Documentation docs: move x86 documentation into Documentation/arch/ 2023-03-30 12:58:51 -06:00
include/objtool objtool: Add symbol iteration helpers 2023-04-14 16:08:29 +02:00
.gitignore objtool: Install libsubcmd in build 2023-01-30 16:27:46 -08:00
Build objtool: Install libsubcmd in build 2023-01-30 16:27:46 -08:00
builtin-check.c objtool: Make struct check_options static 2023-02-01 09:15:23 -08:00
check.c Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
elf.c objtool: Add symbol iteration helpers 2023-04-14 16:08:29 +02:00
Makefile objtool: Fix HOSTCC flag usage 2023-02-01 09:15:18 -08:00
objtool.c objtool: Remove instruction::list 2023-02-23 09:21:44 +01:00
orc_dump.c x86,objtool: Split UNWIND_HINT_EMPTY in two 2023-03-23 23:18:58 +01:00
orc_gen.c objtool: Add WARN_INSN() 2023-04-14 16:08:28 +02:00
special.c objtool: Make struct entries[] static and const 2023-02-01 09:15:22 -08:00
sync-check.sh objtool: Add objtool_types.h 2023-03-23 23:18:56 +01:00
weak.c objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00