]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev-es: Handle string port IO to kernel memory properly
authorHyunwook (Wooky) Baek <baekhw@google.com>
Sun, 10 Jan 2021 07:11:02 +0000 (23:11 -0800)
committerBorislav Petkov <bp@suse.de>
Mon, 11 Jan 2021 19:01:52 +0000 (20:01 +0100)
commit43b74c7c7640cbdb22621136b72a3ae888f0faa3
tree3bf2c1c34dbeec98425e8da054e5e7410dc61438
parent0de845ca16708c4f084d3b978cd0e2e7dcbb43df
x86/sev-es: Handle string port IO to kernel memory properly

Don't assume dest/source buffers are userspace addresses when manually
copying data for string I/O or MOVS MMIO, as {get,put}_user() will fail
if handed a kernel address and ultimately lead to a kernel panic.

When invoking INSB/OUTSB instructions in kernel space in a
SEV-ES-enabled VM, the kernel crashes with the following message:

  "SEV-ES: Unsupported exception in #VC instruction emulation - can't continue"

Handle that case properly.

 [ bp: Massage commit message. ]

Fixes: 9439a3a1ab8b ("x86/sev-es: Compile early handler code into kernel image")
Signed-off-by: Hyunwook (Wooky) Baek <baekhw@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: David Rientjes <rientjes@google.com>
Link: https://lkml.kernel.org/r/20210110071102.2576186-1-baekhw@google.com
arch/x86/kernel/sev-es.c