Commit a476cad
KVM: x86: Check that the high 32bits are clear in kvm_arch_vcpu_ioctl_run()
The "kvm_run->kvm_valid_regs" and "kvm_run->kvm_dirty_regs" variables are
u64 type. We are only using the lowest 3 bits but we want to ensure that
the users are not passing invalid bits so that we can use the remaining
bits in the future.
However "sync_valid_fields" and kvm_sync_valid_fields() are u32 type so
the check only ensures that the lower 32 bits are clear. Fix this by
changing the types to u64.
Fixes: 74c1807 ("KVM: x86: block KVM_CAP_SYNC_REGS if guest state is protected")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ec25aad1-113e-4c6e-8941-43d432251398@stanley.mountain
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent a2620f8 commit a476cad
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4597 | 4597 | | |
4598 | 4598 | | |
4599 | 4599 | | |
4600 | | - | |
| 4600 | + | |
4601 | 4601 | | |
4602 | 4602 | | |
4603 | 4603 | | |
| |||
11493 | 11493 | | |
11494 | 11494 | | |
11495 | 11495 | | |
11496 | | - | |
| 11496 | + | |
11497 | 11497 | | |
11498 | 11498 | | |
11499 | 11499 | | |
| |||
0 commit comments