Commit 72d1271
committed
KVM: SVM: Refuse to attempt VRMUN if an SEV-ES+ guest has an invalid VMSA
Explicitly reject KVM_RUN with KVM_EXIT_FAIL_ENTRY if userspace "coerces"
KVM into running an SEV-ES+ guest with an invalid VMSA, e.g. by modifying
a vCPU's mp_state to be RUNNABLE after an SNP vCPU has undergone a Destroy
event. On Destroy or failed Create, KVM marks the vCPU HALTED so that
*KVM* doesn't run the vCPU, but nothing prevents a misbehaving VMM from
manually making the vCPU RUNNABLE via KVM_SET_MP_STATE.
Attempting VMRUN with an invalid VMSA should be harmless, but knowingly
executing VMRUN with bad control state is at best dodgy.
Fixes: e366f92 ("KVM: SEV: Support SEV-SNP AP Creation NAE event")
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Link: https://lore.kernel.org/r/20250227012541.3234589-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent d4b69c3 commit 72d1271
3 files changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3451 | 3451 | | |
3452 | 3452 | | |
3453 | 3453 | | |
3454 | | - | |
| 3454 | + | |
3455 | 3455 | | |
3456 | 3456 | | |
3457 | | - | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
3458 | 3467 | | |
3459 | 3468 | | |
3460 | 3469 | | |
| |||
3467 | 3476 | | |
3468 | 3477 | | |
3469 | 3478 | | |
3470 | | - | |
| 3479 | + | |
3471 | 3480 | | |
3472 | 3481 | | |
3473 | 3482 | | |
3474 | 3483 | | |
| 3484 | + | |
3475 | 3485 | | |
3476 | 3486 | | |
3477 | 3487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3599 | 3599 | | |
3600 | 3600 | | |
3601 | 3601 | | |
3602 | | - | |
| 3602 | + | |
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
| |||
3621 | 3621 | | |
3622 | 3622 | | |
3623 | 3623 | | |
| 3624 | + | |
| 3625 | + | |
3624 | 3626 | | |
3625 | 3627 | | |
3626 | 3628 | | |
| |||
4243 | 4245 | | |
4244 | 4246 | | |
4245 | 4247 | | |
4246 | | - | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
4247 | 4254 | | |
4248 | 4255 | | |
4249 | 4256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| |||
0 commit comments