All of lore.kernel.org
 help / color / mirror / Atom feed
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 04/11] vfio-user: reject malformed migration capabilities
Date: Wed, 20 May 2026 18:21:08 +0200	[thread overview]
Message-ID: <20260520162115.1613601-5-clg@redhat.com> (raw)
In-Reply-To: <20260520162115.1613601-1-clg@redhat.com>

From: GuoHan Zhao <zhaoguohan@kylinos.cn>

check_migr() sets an error when the migration capability is not an object,
but still returns true.  This lets version negotiation continue with an
Error set and reports the wrong capability name in the diagnostic.

Return false for the malformed capability, and report the migration
capability name.

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/20260424031259.289211-1-zhaoguohan@kylinos.cn
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio-user/proxy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c
index 314dfd23d8af385532bb87219fb3153961942cba..8b7cc36231ab276493e252064b560dcea13ae749 100644
--- a/hw/vfio-user/proxy.c
+++ b/hw/vfio-user/proxy.c
@@ -1190,8 +1190,8 @@ static bool check_migr(VFIOUserProxy *proxy, QObject *qobj, Error **errp)
     QDict *qdict = qobject_to(QDict, qobj);
 
     if (qdict == NULL) {
-        error_setg(errp, "malformed %s", VFIO_USER_CAP_MAX_FDS);
-        return true;
+        error_setg(errp, "malformed %s", VFIO_USER_CAP_MIGR);
+        return false;
     }
     return caps_parse(proxy, qdict, caps_migr, errp);
 }
-- 
2.54.0



  parent reply	other threads:[~2026-05-20 16:22 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 ` [PULL 03/11] vfio-user: avoid leaking duplicate device name Cédric Le Goater
2026-05-20 16:21 ` Cédric Le Goater [this message]
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-5-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.