From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org
Cc: "GuoHan Zhao" <zhaoguohan@kylinos.cn>,
"John Levon" <john.levon@nutanix.com>,
"Cédric Le Goater" <clg@redhat.com>
Subject: [PULL 03/11] vfio-user: avoid leaking duplicate device name
Date: Wed, 20 May 2026 18:21:07 +0200 [thread overview]
Message-ID: <20260520162115.1613601-4-clg@redhat.com> (raw)
In-Reply-To: <20260520162115.1613601-1-clg@redhat.com>
From: GuoHan Zhao <zhaoguohan@kylinos.cn>
vfio_user_pci_realize() assigns vbasedev->name before connecting to the
server, then assigns the same name again after installing the request
handler. The second assignment overwrites the first allocation, so only
the second string can be freed later by vfio_device_free_name().
Drop the duplicate assignment and keep the first name allocation, which is
also available on connection failures for error reporting.
Fixes: 36227628d824 ("vfio-user: implement message send infrastructure")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: John Levon <john.levon@nutanix.com>
Link: https://lore.kernel.org/qemu-devel/20260424032209.297458-1-zhaoguohan@kylinos.cn
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/vfio-user/pci.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c
index facc79727acb82c35fec5b4bef79e78b3878531a..e7573d4a9f088c1afc8ed2709932842247abf6ac 100644
--- a/hw/vfio-user/pci.c
+++ b/hw/vfio-user/pci.c
@@ -280,8 +280,6 @@ static void vfio_user_pci_realize(PCIDevice *pdev, Error **errp)
vbasedev->proxy = proxy;
vfio_user_set_handler(vbasedev, vfio_user_pci_process_req, vdev);
- vbasedev->name = g_strdup_printf("vfio-user:%s", sock_name);
-
if (udev->send_queued) {
proxy->flags |= VFIO_PROXY_FORCE_QUEUED;
}
--
2.54.0
next prev parent reply other threads:[~2026-05-20 16:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 16:21 [PULL 00/11] vfio queue Cédric Le Goater
2026-05-20 16:21 ` [PULL 01/11] target/s390x: restore cpu_models for system builds Cédric Le Goater
2026-05-20 16:21 ` [PULL 02/11] hw/vfio: Drop superfluous inclusion of hw-error.h Cédric Le Goater
2026-05-20 16:21 ` Cédric Le Goater [this message]
2026-05-20 16:21 ` [PULL 04/11] vfio-user: reject malformed migration capabilities Cédric Le Goater
2026-05-20 16:21 ` [PULL 05/11] hw/remote: update libvfio-user subproject Cédric Le Goater
2026-05-20 16:21 ` [PULL 06/11] vfio/pci: Replace abort() with g_assert_not_reached() Cédric Le Goater
2026-05-20 16:21 ` [PULL 07/11] vfio/ap: Return false when IRQ notifier setup fails Cédric Le Goater
2026-05-20 16:21 ` [PULL 08/11] vfio/ccw: " Cédric Le Goater
2026-05-20 16:21 ` [PULL 09/11] update-linux-headers: Inject VIRTIO_RING_NO_LEGACY in virtio_ring.h Cédric Le Goater
2026-05-20 16:21 ` [PULL 10/11] vfio/migration: Detect and report overflow in migration size queries Cédric Le Goater
2026-05-20 16:21 ` [PULL 11/11] scripts/update-linux-headers: Add typelimits.h Cédric Le Goater
2026-05-20 22:21 ` [PULL 00/11] vfio queue Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520162115.1613601-4-clg@redhat.com \
--to=clg@redhat.com \
--cc=john.levon@nutanix.com \
--cc=qemu-devel@nongnu.org \
--cc=zhaoguohan@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.