]> 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)
commit9de3e20d4d36549839881338c0a71034d0f40684
tree9bcb9f62d0100412c4bad71d9ca61de11f75efa4
parentf855940166d291ed80e6f0749edcb16c40d7cad4
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: 6caf56f2db409 ("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