]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Inject #UD on attempted emulation for SEV guest w/o insn buffer
authorSean Christopherson <seanjc@google.com>
Thu, 20 Jan 2022 01:07:17 +0000 (01:07 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Jan 2022 17:15:01 +0000 (12:15 -0500)
commit9d9987ebf9478196be2792f75d3051efacd59481
treec46030181a7656c76e9c9e46f28b84188914a49c
parentdc86d630d5c113000e52d0b3e50c36b2f1d458f2
KVM: SVM: Inject #UD on attempted emulation for SEV guest w/o insn buffer

Inject #UD if KVM attempts emulation for an SEV guests without an insn
buffer and instruction decoding is required.  The previous behavior of
allowing emulation if there is no insn buffer is undesirable as doing so
means KVM is reading guest private memory and thus decoding cyphertext,
i.e. is emulating garbage.  The check was previously necessary as the
emulation type was not provided, i.e. SVM needed to allow emulation to
handle completion of emulation after exiting to userspace to handle I/O.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Message-Id: <20220120010719.711476-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c