From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Alexander Graf <graf@amazon.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, Dorjoy Chowdhury <dorjoychy111@gmail.com>,
Vikrant Garg <vikrant1garg@gmail.com>,
qemu-stable@nongnu.org
Subject: Re: [PATCH] hw/virtio/virtio-nsm: Respond with correct length
Date: Thu, 13 Feb 2025 16:24:33 +0100 [thread overview]
Message-ID: <53e891f0-1c3b-48fc-985e-4b0e8f0b5802@linaro.org> (raw)
In-Reply-To: <20250213114541.67515-1-graf@amazon.com>
On 13/2/25 12:45, Alexander Graf wrote:
> When we return a response packet from NSM, we need to indicate its
> length according to the content of the response. Prior to this patch, we
> returned the length of the source buffer, which may confuse guest code
> that relies on the response size.
>
> Fix it by returning the response payload size instead.
>
> Fixes: bb154e3e0cc715 ("device/virtio-nsm: Support for Nitro Secure Module device")
> Reported-by: Vikrant Garg <vikrant1garg@gmail.com>
> Signed-off-by: Alexander Graf <graf@amazon.com>
> ---
> hw/virtio/virtio-nsm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/virtio-nsm.c b/hw/virtio/virtio-nsm.c
> index 098e1aeac6..b22aa74e34 100644
> --- a/hw/virtio/virtio-nsm.c
> +++ b/hw/virtio/virtio-nsm.c
> @@ -1596,7 +1596,7 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
> g_free(req.iov_base);
> g_free(res.iov_base);
> virtqueue_push(vq, out_elem, 0);
> - virtqueue_push(vq, in_elem, in_elem->in_sg->iov_len);
> + virtqueue_push(vq, in_elem, sz);
> virtio_notify(vdev, vq);
> return;
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
and per
https://lore.kernel.org/qemu-devel/CAKXOwk2Eba8qnqKQqCN+=2+N=WRPzAwx3LkoccEwR-3xgt32uw@mail.gmail.com/:
Tested-by: Vikrant Garg <vikrant1garg@gmail.com>
next prev parent reply other threads:[~2025-02-13 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 11:45 [PATCH] hw/virtio/virtio-nsm: Respond with correct length Alexander Graf
2025-02-13 11:50 ` Dorjoy Chowdhury
2025-02-13 15:24 ` Philippe Mathieu-Daudé [this message]
2025-02-25 9:32 ` Michael Tokarev
2025-02-25 9:34 ` Michael Tokarev
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=53e891f0-1c3b-48fc-985e-4b0e8f0b5802@linaro.org \
--to=philmd@linaro.org \
--cc=dorjoychy111@gmail.com \
--cc=graf@amazon.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=vikrant1garg@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).