]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit629736fd7ad106ed9a106ae50dce4fd6acf46a6c
treec6b66cbc91c6b6438bac5fb53b9f0ff98af1ad18
parentf2e44b157b40054568e7832e74a8678b98aaab55
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