summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Andreas <manuel.andreas@tum.de>2025-07-23 17:51:20 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-24 08:53:22 +0200
commit3ee59c38ae7369ad1f7b846e05633ccf0d159fab (patch)
tree3d8a6536e66eddc63e57f3a40c9f1896f500c437
parent48e8791843206baf76827df1b6ee3cb88a2a17d8 (diff)
KVM: x86/xen: Fix cleanup logic in emulation of Xen schedop poll hypercalls
commit 5a53249d149f48b558368c5338b9921b76a12f8c 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: 92c58965e965 ("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>
-rw-r--r--arch/x86/kvm/xen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index c4a158758cb7..94c7fee7a225 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -1260,7 +1260,7 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode,
if (kvm_read_guest_virt(vcpu, (gva_t)sched_poll.ports, ports,
sched_poll.nr_ports * sizeof(*ports), &e)) {
*r = -EFAULT;
- return true;
+ goto out;
}
for (i = 0; i < sched_poll.nr_ports; i++) {