Skip to content

Commit 3ee59c3

Browse files
styxsgregkh
authored andcommitted
KVM: x86/xen: Fix cleanup logic in emulation of Xen schedop poll hypercalls
commit 5a53249 upstream. kvm_xen_schedop_poll does a kmalloc_array() when a VM polls the host for more than one event channel potr (nr_ports > 1). After the kmalloc_array(), the error paths need to go through the "out" label, but the call to kvm_read_guest_virt() does not. Fixes: 92c5896 ("KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly") Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Manuel Andreas <manuel.andreas@tum.de> [Adjusted commit message. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 48e8791 commit 3ee59c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kvm/xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode,
12601260
if (kvm_read_guest_virt(vcpu, (gva_t)sched_poll.ports, ports,
12611261
sched_poll.nr_ports * sizeof(*ports), &e)) {
12621262
*r = -EFAULT;
1263-
return true;
1263+
goto out;
12641264
}
12651265

12661266
for (i = 0; i < sched_poll.nr_ports; i++) {

0 commit comments

Comments
 (0)