Commit 16529ad1 authored by Borislav Petkov's avatar Borislav Petkov Committed by Kleber Sacilotto de Souza

x86/mitigations: Clear CPU buffers on the SYSCALL fast path

BugLink: https://bugs.launchpad.net/bugs/1875905

The fast SYSCALL exit path returns with SYSRET to userspace after
verifying that there's no pending work. MDS mitigation mandates that CPU
buffers must be cleared on transition from kernel to userspace so do
that here too.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 29843e3d
......@@ -222,6 +222,8 @@ entry_SYSCALL_64_fastpath:
testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
jnz int_ret_from_sys_call_irqs_off /* Go to the slow path */
call mds_user_clear_buffers
movq RIP(%rsp), %rcx
movq EFLAGS(%rsp), %r11
RESTORE_C_REGS_EXCEPT_RCX_R11
......
......@@ -85,4 +85,6 @@ static inline void speculative_store_bypass_ht_init(void) { }
extern void speculation_ctrl_update(unsigned long tif);
extern void speculation_ctrl_update_current(void);
extern void mds_user_clear_buffers(void);
#endif
......@@ -307,6 +307,11 @@ static int __init mds_cmdline(char *str)
}
early_param("mds", mds_cmdline);
void mds_user_clear_buffers(void)
{
mds_user_clear_cpu_buffers();
}
#undef pr_fmt
#define pr_fmt(fmt) "TAA: " fmt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment