Commit 5a30e8a
committed
KVM: VMX: check validity of VMCS controls when returning from SMM
The VMCS12 is not available while in SMM. However, it can be overwritten
if userspace manages to trigger copy_enlightened_to_vmcs12() - for example
via KVM_GET_NESTED_STATE.
Because of this, the VMCS12 has to be checked for validity before it is
used to generate the VMCS02. Move the check code out of vmx_set_nested_state()
(the other "not a VMLAUNCH/VMRESUME" path that emulates a nested vmentry)
and reuse it in vmx_leave_smm().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 87d0f90 commit 5a30e8a
3 files changed
Lines changed: 32 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6856 | 6856 | | |
6857 | 6857 | | |
6858 | 6858 | | |
| 6859 | + | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
| 6871 | + | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
| 6876 | + | |
| 6877 | + | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
6859 | 6881 | | |
6860 | 6882 | | |
6861 | 6883 | | |
6862 | 6884 | | |
6863 | 6885 | | |
6864 | 6886 | | |
6865 | | - | |
6866 | 6887 | | |
6867 | 6888 | | |
6868 | 6889 | | |
| |||
6993 | 7014 | | |
6994 | 7015 | | |
6995 | 7016 | | |
6996 | | - | |
6997 | 7017 | | |
6998 | 7018 | | |
6999 | 7019 | | |
7000 | 7020 | | |
| 7021 | + | |
7001 | 7022 | | |
7002 | 7023 | | |
7003 | 7024 | | |
7004 | 7025 | | |
7005 | 7026 | | |
| 7027 | + | |
7006 | 7028 | | |
7007 | 7029 | | |
7008 | | - | |
7009 | | - | |
7010 | | - | |
7011 | | - | |
7012 | | - | |
7013 | | - | |
7014 | | - | |
| 7030 | + | |
7015 | 7031 | | |
7016 | 7032 | | |
7017 | 7033 | | |
| |||
7022 | 7038 | | |
7023 | 7039 | | |
7024 | 7040 | | |
7025 | | - | |
7026 | | - | |
7027 | | - | |
| 7041 | + | |
| 7042 | + | |
7028 | 7043 | | |
7029 | 7044 | | |
7030 | 7045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8528 | 8528 | | |
8529 | 8529 | | |
8530 | 8530 | | |
| 8531 | + | |
| 8532 | + | |
| 8533 | + | |
| 8534 | + | |
8531 | 8535 | | |
8532 | 8536 | | |
8533 | 8537 | | |
| |||
0 commit comments