]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/bugs: Make Safe-RET robust against interrupt injection
authorBorislav Petkov (AMD) <bp@alien8.de>
Wed, 3 Jun 2026 04:26:44 +0000 (21:26 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sun, 26 Jul 2026 14:21:37 +0000 (07:21 -0700)
commit7e7f81cf6f5ca3311e526308f55d7c54d3ba71f9
treebdef8bcc4a6e4a54ff379e969d1c2147cc2c8a44
parent1590cf0329716306e948a8fc29f1d3ee87d3989f
x86/bugs: Make Safe-RET robust against interrupt injection

An attacker injecting interrupts while the Safe-RET mitigation executes
on machines affected by SRSO can neutralize the safe return sequence,
potentially leading to data leakage through speculative execution.

Fixup register state as if the Safe-RET sequence executed successfully
by "emulating" it, in a manner of speaking, and avoid executing a RET
instruction after returning from the interrupt.

Co-developed-by: David Kaplan <David.Kaplan@amd.com>
Signed-off-by: David Kaplan <David.Kaplan@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
arch/x86/entry/entry_64.S
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c
arch/x86/lib/retpoline.S