Skip to content

Commit d16e0b2

Browse files
achartresuryasaimadhu
authored andcommitted
x86/entry: Remove UNTRAIN_RET from native_irq_return_ldt
UNTRAIN_RET is not needed in native_irq_return_ldt because RET untraining has already been done at this point. In addition, when the RETBleed mitigation is IBPB, UNTRAIN_RET clobbers several registers (AX, CX, DX) so here it trashes user values which are in these registers. Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/35b0d50f-12d1-10c3-f5e8-d6c140486d4a@oracle.com
1 parent 33a8573 commit d16e0b2

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/x86/entry/entry_64.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ native_irq_return_ldt:
727727
pushq %rdi /* Stash user RDI */
728728
swapgs /* to kernel GS */
729729
SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi /* to kernel CR3 */
730-
UNTRAIN_RET
731730

732731
movq PER_CPU_VAR(espfix_waddr), %rdi
733732
movq %rax, (0*8)(%rdi) /* user RAX */

0 commit comments

Comments
 (0)