linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Neeraj Upadhyay <neeraju@codeaurora.org>, mst@redhat.com
Cc: 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 11:21:19 +0800	[thread overview]
Message-ID: <1d7f1fb3-b22c-1ca9-0635-be3f14b97c4a@redhat.com> (raw)
In-Reply-To: <1624361873-6097-1-git-send-email-neeraju@codeaurora.org>


在 2021/6/22 下午7:37, Neeraj Upadhyay 写道:
> As iov->used is incremented when descriptors are processed
> in __vringh_iov(), use it to check for incorrect read
> and write descriptor order.
>
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   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;


  reply	other threads:[~2021-06-23  3:21 UTC|newest]

Thread overview: 4+ 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 [this message]
2021-06-23 16:10 ` Stefano Garzarella
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=1d7f1fb3-b22c-1ca9-0635-be3f14b97c4a@redhat.com \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --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 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).