|
|
60061b |
From 6f84eb3889a7035c07eeb2d337d2c3b06a6777f0 Mon Sep 17 00:00:00 2001
|
|
|
60061b |
From: Laurent Vivier <lvivier@redhat.com>
|
|
|
60061b |
Date: Fri, 11 Feb 2022 18:02:59 +0100
|
|
|
60061b |
Subject: [PATCH 4/6] hw/virtio: vdpa: Fix leak of host-notifier memory-region
|
|
|
60061b |
|
|
|
60061b |
RH-Author: Laurent Vivier <lvivier@redhat.com>
|
|
|
60061b |
RH-MergeRequest: 122: hw/virtio: vdpa: Fix leak of host-notifier memory-region
|
|
|
60061b |
RH-Commit: [1/1] cd8719f57b2eb398cce108e191c7155a112f4fc8
|
|
|
60061b |
RH-Bugzilla: 2027208
|
|
|
60061b |
RH-Acked-by: Jason Wang <None>
|
|
|
60061b |
RH-Acked-by: Cindy Lu <None>
|
|
|
60061b |
RH-Acked-by: MST <None>
|
|
|
60061b |
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
60061b |
|
|
|
60061b |
BZ: https://bugzilla.redhat.com/2027208
|
|
|
60061b |
BRANCH: rhel-8.6.0
|
|
|
60061b |
UPSTREAM: Merged
|
|
|
60061b |
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=43682903
|
|
|
60061b |
|
|
|
60061b |
If call virtio_queue_set_host_notifier_mr fails, should free
|
|
|
60061b |
host-notifier memory-region.
|
|
|
60061b |
|
|
|
60061b |
This problem can trigger a coredump with some vDPA drivers (mlx5,
|
|
|
60061b |
but not with the vdpasim), if we unplug the virtio-net card from
|
|
|
60061b |
the guest after a stop/start.
|
|
|
60061b |
|
|
|
60061b |
The same fix has been done for vhost-user:
|
|
|
60061b |
1f89d3b91e3e ("hw/virtio: Fix leak of host-notifier memory-region")
|
|
|
60061b |
|
|
|
60061b |
Fixes: d0416d487bd5 ("vhost-vdpa: map virtqueue notification area if possible")
|
|
|
60061b |
Cc: jasowang@redhat.com
|
|
|
60061b |
Resolves: https://bugzilla.redhat.com/2027208
|
|
|
60061b |
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
60061b |
Message-Id: <20220211170259.1388734-1-lvivier@redhat.com>
|
|
|
60061b |
Cc: qemu-stable@nongnu.org
|
|
|
60061b |
Acked-by: Jason Wang <jasowang@redhat.com>
|
|
|
60061b |
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
60061b |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
60061b |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
60061b |
(cherry picked from commit 98f7607ecda00dea3cbb2ed7b4427c96846efb83)
|
|
|
60061b |
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
60061b |
---
|
|
|
60061b |
hw/virtio/vhost-vdpa.c | 1 +
|
|
|
60061b |
1 file changed, 1 insertion(+)
|
|
|
60061b |
|
|
|
60061b |
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
|
|
|
60061b |
index bcaf00e09f..78da48a333 100644
|
|
|
60061b |
--- a/hw/virtio/vhost-vdpa.c
|
|
|
60061b |
+++ b/hw/virtio/vhost-vdpa.c
|
|
|
60061b |
@@ -415,6 +415,7 @@ static int vhost_vdpa_host_notifier_init(struct vhost_dev *dev, int queue_index)
|
|
|
60061b |
g_free(name);
|
|
|
60061b |
|
|
|
60061b |
if (virtio_queue_set_host_notifier_mr(vdev, queue_index, &n->mr, true)) {
|
|
|
60061b |
+ object_unparent(OBJECT(&n->mr));
|
|
|
60061b |
munmap(addr, page_size);
|
|
|
60061b |
goto err;
|
|
|
60061b |
}
|
|
|
60061b |
--
|
|
|
60061b |
2.27.0
|
|
|
60061b |
|