Skip to content

Commit

Permalink
KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs()
Browse files Browse the repository at this point in the history
Due to a bad merge resolution between commit f298103 ("KVM/x86:
Check input paging mode when cs.l is set") and commit b4ef9d4
("KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_sregs"),
there is a case in kvm_arch_vcpu_ioctl_set_sregs() where vcpu_put() is
not called after vcpu_get().  Fix it.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
  • Loading branch information
Eric Biggers authored and Radim Krčmář committed Feb 2, 2018
1 parent d2b9b20 commit 8dbfb2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -7706,7 +7706,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
goto out;

if (kvm_valid_sregs(vcpu, sregs))
return -EINVAL;
goto out;

apic_base_msr.data = sregs->apic_base;
apic_base_msr.host_initiated = true;
Expand Down

0 comments on commit 8dbfb2b

Please sign in to comment.