diff options
author | Kevin Wolf <kwolf@redhat.com> | 2012-02-08 08:34:38 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-08 07:10:26 -0500 |
commit | 7f3d35fddd173e52886d03bc34b5b5d6f5bea343 (patch) | |
tree | 9561913495a92c398b9b8e372d4e9a5c1d55c7f4 /arch/x86/kvm/x86.c | |
parent | 9cc815e46911486f52bec60517d0f7b40d323bbc (diff) |
KVM: x86 emulator: Fix task switch privilege checks
Currently, all task switches check privileges against the DPL of the
TSS. This is only correct for jmp/call to a TSS. If a task gate is used,
the DPL of this take gate is used for the check instead. Exceptions,
external interrupts and iret shouldn't perform any check.
[avi: kill kvm-kmod remnants]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ca74c1dadf3a..490a1b1a255f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5655,15 +5655,15 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
5655 | return 0; | 5655 | return 0; |
5656 | } | 5656 | } |
5657 | 5657 | ||
5658 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason, | 5658 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index, |
5659 | bool has_error_code, u32 error_code) | 5659 | int reason, bool has_error_code, u32 error_code) |
5660 | { | 5660 | { |
5661 | struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt; | 5661 | struct x86_emulate_ctxt *ctxt = &vcpu->arch.emulate_ctxt; |
5662 | int ret; | 5662 | int ret; |
5663 | 5663 | ||
5664 | init_emulate_ctxt(vcpu); | 5664 | init_emulate_ctxt(vcpu); |
5665 | 5665 | ||
5666 | ret = emulator_task_switch(ctxt, tss_selector, reason, | 5666 | ret = emulator_task_switch(ctxt, tss_selector, idt_index, reason, |
5667 | has_error_code, error_code); | 5667 | has_error_code, error_code); |
5668 | 5668 | ||
5669 | if (ret) | 5669 | if (ret) |