- qga/win32: Use rundll for VSS installation - qga/win32: Remove change action from MSI installer - ide: Increment BB in-flight counter for TRIM BH - hw/pci-bridge/pxb: Fix missing swizzle - host-vdpa: make notifiers _init()/_uninit() symmetric - hw/virtio: vdpa: Fix leak of host-notifier memory-region - accel/tcg/cpu-exec: Fix precise single-stepping after interrupt - Allow setting up to 8 bytes with the generic loader - hw/net/virtio-net: make some VirtIONet const - accel/tcg: Optimize jump cache flush during tlb range flush - 9pfs: prevent opening special files (CVE-2023-2861) - tcg: Reduce tcg_assert_listed_vecop() scope - gitlab: Disable plugins for cross-i386-tci - vfio/pci: Fix a segfault in vfio_realize - block/iscsi: fix double-free on BUSY or similar statuses - tests/tcg: fix unused variable in linux-test - hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value - qga/vss-win32: fix warning for clang++-15 - vnc: avoid underflow when accessing user-provided address - block/monitor: Fix crash when executing HMP commit - virtio-gpu: add a FIXME for virtio_gpu_load() - hw/ppc/Kconfig: MAC_NEWWORLD should always select USB_OHCI_PCI - migration: report compress thread pid to libvirt Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
51 lines
1.8 KiB
Diff
51 lines
1.8 KiB
Diff
From 862a150140b95bbd23d174307aacd06f65d36f1c Mon Sep 17 00:00:00 2001
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
|
Date: Fri, 21 Jul 2023 07:26:44 +0000
|
|
Subject: [PATCH] hw/virtio: vdpa: Fix leak of host-notifier memory-region
|
|
mainline inclusion commit 98f7607ecda00dea3cbb2ed7b4427c96846efb83 category:
|
|
bugfix
|
|
|
|
---------------------------------------------------------------
|
|
|
|
If call virtio_queue_set_host_notifier_mr fails, should free
|
|
host-notifier memory-region.
|
|
|
|
This problem can trigger a coredump with some vDPA drivers (mlx5,
|
|
but not with the vdpasim), if we unplug the virtio-net card from
|
|
the guest after a stop/start.
|
|
|
|
The same fix has been done for vhost-user:
|
|
1f89d3b91e3e ("hw/virtio: Fix leak of host-notifier memory-region")
|
|
|
|
Fixes: d0416d487bd5 ("vhost-vdpa: map virtqueue notification area if possible")
|
|
Cc: jasowang@redhat.com
|
|
Resolves: https://bugzilla.redhat.com/2027208
|
|
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
|
Message-Id: <20220211170259.1388734-1-lvivier@redhat.com>
|
|
Cc: qemu-stable@nongnu.org
|
|
Acked-by: Jason Wang <jasowang@redhat.com>
|
|
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/virtio/vhost-vdpa.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
|
|
index f285edb786..225c9b1730 100644
|
|
--- a/hw/virtio/vhost-vdpa.c
|
|
+++ b/hw/virtio/vhost-vdpa.c
|
|
@@ -417,6 +417,7 @@ static int vhost_vdpa_host_notifier_init(struct vhost_dev *dev, int queue_index)
|
|
g_free(name);
|
|
|
|
if (virtio_queue_set_host_notifier_mr(vdev, queue_index, &n->mr, true)) {
|
|
+ object_unparent(OBJECT(&n->mr));
|
|
munmap(addr, page_size);
|
|
goto err;
|
|
}
|
|
--
|
|
2.41.0.windows.1
|
|
|