linux/arch/x86/entry
Lai Jiangshan 1367afaa2e x86/entry: Use the correct fence macro after swapgs in kernel CR3
The commit

  c758907004 ("x86/entry/64: Remove unneeded kernel CR3 switching")

removed a CR3 write in the faulting path of load_gs_index().

But the path's FENCE_SWAPGS_USER_ENTRY has no fence operation if PTI is
enabled, see spectre_v1_select_mitigation().

Rather, it depended on the serializing CR3 write of SWITCH_TO_KERNEL_CR3
and since it got removed, add a FENCE_SWAPGS_KERNEL_ENTRY call to make
sure speculation is blocked.

 [ bp: Massage commit message and comment. ]

Fixes: c758907004 ("x86/entry/64: Remove unneeded kernel CR3 switching")
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211126101209.8613-3-jiangshanlai@gmail.com
2021-12-03 19:13:53 +01:00
..
syscalls futex,x86: Wire up sys_futex_waitv() 2021-10-07 13:51:11 +02:00
vdso x86/build/vdso: fix missing FORCE for *.so build rule 2021-09-03 08:17:19 +09:00
vsyscall signal: Replace force_fatal_sig with force_exit_sig when in doubt 2021-11-19 09:15:58 -06:00
calling.h x86/entry: Split PUSH_AND_CLEAR_REGS into two submacros 2021-05-12 10:49:15 +02:00
common.c X86 entry code related updates: 2021-06-29 12:44:51 -07:00
entry_32.S - turn the stack canary into a normal __percpu variable on 32-bit which 2021-04-27 17:45:09 -07:00
entry_64_compat.S x86/sev-es: Introduce ip_within_syscall_gap() helper 2021-03-08 14:22:17 +01:00
entry_64.S x86/entry: Use the correct fence macro after swapgs in kernel CR3 2021-12-03 19:13:53 +01:00
Makefile x86/syscalls: Don't adjust CFLAGS for syscall tables 2021-05-25 16:59:23 +02:00
syscall_32.c x86/syscalls: Stop filling syscall arrays with *_sys_ni_syscall 2021-05-20 15:03:59 +02:00
syscall_64.c x86/syscalls: Stop filling syscall arrays with *_sys_ni_syscall 2021-05-20 15:03:59 +02:00
syscall_x32.c x86/syscalls: Stop filling syscall arrays with *_sys_ni_syscall 2021-05-20 15:03:59 +02:00
thunk_32.S x86/entry: Remove unused THUNKs 2020-08-26 12:41:54 +02:00
thunk_64.S x86/entry: Remove put_ret_addr_in_rdi THUNK macro argument 2021-01-19 11:06:14 +01:00