]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86/xen: Fix cleanup logic in emulation of Xen schedop poll hypercalls
authorManuel Andreas <manuel.andreas@tum.de>
Wed, 23 Jul 2025 15:51:20 +0000 (17:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:56:38 +0000 (08:56 +0200)
commitfd627ac8a5cff4d45269f164b13ddddc0726f2cc
treec3ad7deb952004a2ce724bc93d84a8c97389677c
parentff7ccaadb0bf6b79a871e63ab6c50d3d68f83084
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>
arch/x86/kvm/xen.c