]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Allow #VC exceptions on the VC2 stack
authorJoerg Roedel <jroedel@suse.de>
Thu, 21 Oct 2021 08:08:33 +0000 (10:08 +0200)
committerBorislav Petkov <bp@suse.de>
Thu, 21 Oct 2021 16:29:36 +0000 (18:29 +0200)
commitee977595b22f4df42993f76462dbd36fa6f90fd4
tree9bcb9f62d0100412c4bad71d9ca61de11f75efa4
parenta93ef0e2797a80f5d6180a0b85b5388adb117536
x86/sev: Allow #VC exceptions on the VC2 stack

When code running on the VC2 stack causes a nested VC exception, the
handler will not handle it as expected but goes again into the error
path.

The result is that the panic() call happening when the VC exception
was raised in an invalid context is called recursively. Fix this by
checking the interrupted stack too and only call panic if it is not
the VC2 stack.

 [ bp: Fixup comment. ]

Fixes: c054f4d254d19 ("x86/sev-es: Add a Runtime #VC Exception Handler")
Reported-by: Xinyang Ge <xing@microsoft.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211021080833.30875-3-joro@8bytes.org
arch/x86/kernel/sev.c