From: "Michael S. Tsirkin" <mst@redhat.com>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
Date: Wed, 23 Jun 2021 16:09:52 -0400 [thread overview]
Message-ID: <20210623160923-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1624361873-6097-1-git-send-email-neeraju@codeaurora.org>
On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
> As iov->used is incremented when descriptors are processed
> in __vringh_iov(), use it to check for incorrect read
> and write descriptor order.
Could the commit log be clearer? why is wiov->i incorrect here?
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---
> drivers/vhost/vringh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
> index 4af8fa2..14e2043 100644
> --- a/drivers/vhost/vringh.c
> +++ b/drivers/vhost/vringh.c
> @@ -359,7 +359,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
> iov = wiov;
> else {
> iov = riov;
> - if (unlikely(wiov && wiov->i)) {
> + if (unlikely(wiov && wiov->used)) {
> vringh_bad("Readable desc %p after writable",
> &descs[i]);
> err = -EINVAL;
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
Date: Wed, 23 Jun 2021 16:09:52 -0400 [thread overview]
Message-ID: <20210623160923-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1624361873-6097-1-git-send-email-neeraju@codeaurora.org>
On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
> As iov->used is incremented when descriptors are processed
> in __vringh_iov(), use it to check for incorrect read
> and write descriptor order.
Could the commit log be clearer? why is wiov->i incorrect here?
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---
> drivers/vhost/vringh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
> index 4af8fa2..14e2043 100644
> --- a/drivers/vhost/vringh.c
> +++ b/drivers/vhost/vringh.c
> @@ -359,7 +359,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
> iov = wiov;
> else {
> iov = riov;
> - if (unlikely(wiov && wiov->i)) {
> + if (unlikely(wiov && wiov->used)) {
> vringh_bad("Readable desc %p after writable",
> &descs[i]);
> err = -EINVAL;
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
next prev parent reply other threads:[~2021-06-23 20:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 11:37 [PATCH] vringh: Use wiov->used to check for read/write desc order Neeraj Upadhyay
2021-06-23 3:21 ` Jason Wang
2021-06-23 3:21 ` Jason Wang
2021-06-23 16:10 ` Stefano Garzarella
2021-06-23 16:10 ` Stefano Garzarella
2021-06-23 20:09 ` Michael S. Tsirkin [this message]
2021-06-23 20:09 ` Michael S. Tsirkin
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=20210623160923-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraju@codeaurora.org \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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.