x86/sev: Mark the code returning to user space as syscall gap
authorLai Jiangshan <jiangshan.ljs@antgroup.com>
Tue, 12 Apr 2022 12:49:08 +0000 (20:49 +0800)
committerBorislav Petkov <bp@suse.de>
Thu, 19 May 2022 08:56:46 +0000 (10:56 +0200)
commit47f33de4aafb2f5e43d480d590a939d0f1d566a9
treec6b66cbc91c6b6438bac5fb53b9f0ff98af1ad18
parentc42b145181aafd59ed31ccd879493389e3ea5a08
x86/sev: Mark the code returning to user space as syscall gap

When returning to user space, %rsp is user-controlled value.

If it is a SNP-guest and the hypervisor decides to mess with the
code-page for this path while a CPU is executing it, a potential #VC
could hit in the syscall return path and mislead the #VC handler.

So make ip_within_syscall_gap() return true in this case.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Joerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20220412124909.10467-1-jiangshanlai@gmail.com
arch/x86/entry/entry_64.S
arch/x86/entry/entry_64_compat.S
arch/x86/include/asm/proto.h
arch/x86/include/asm/ptrace.h