Skip to content

Commit fd627ac

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 <[email protected]> Signed-off-by: Manuel Andreas <[email protected]> [Adjusted commit message. - Paolo] Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ff7ccaa commit fd627ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode,
14721472
if (kvm_read_guest_virt(vcpu, (gva_t)sched_poll.ports, ports,
14731473
sched_poll.nr_ports * sizeof(*ports), &e)) {
14741474
*r = -EFAULT;
1475-
return true;
1475+
goto out;
14761476
}
14771477

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

0 commit comments

Comments
 (0)