OSDN Git Service

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)
commitce47d0c00ff5621ae5825c9d81722b23b0df395e
tree9bcb9f62d0100412c4bad71d9ca61de11f75efa4
parent5681981fb788281b09a4ea14d310d30b2bd89132
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: 0786138c78e79 ("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