x86/sev: Harden #VC instruction emulation somewhat
authorBorislav Petkov (AMD) <bp@alien8.de>
Fri, 5 Jan 2024 10:14:07 +0000 (11:14 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 29 Jan 2024 16:08:22 +0000 (17:08 +0100)
commite3ef461af35a8c74f2f4ce6616491ddb355a208f
tree105ccfe4c6c6774dfde29111f36ae23427f69227
parent41bccc98fb7931d63d03f326a746ac4d429c1dd3
x86/sev: Harden #VC instruction emulation somewhat

Compare the opcode bytes at rIP for each #VC exit reason to verify the
instruction which raised the #VC exception is actually the right one.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240105101407.11694-1-bp@alien8.de
arch/x86/boot/compressed/sev.c
arch/x86/kernel/sev-shared.c
arch/x86/kernel/sev.c