public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alan Cox <alan@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vhost: Fix warnings and bad type handling
Date: Sun, 22 Nov 2009 11:36:32 +0200	[thread overview]
Message-ID: <20091122093630.GA13160@redhat.com> (raw)
In-Reply-To: <20091117154213.3683.94554.stgit@localhost.localdomain>

On Tue, Nov 17, 2009 at 03:42:15PM +0000, Alan Cox wrote:
> Signed-off-by: Alan Cox <alan@linux.intel.com>

Thanks!
Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
> 
>  drivers/vhost/vhost.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 97233d5..46b20f7 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -334,7 +334,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
>  			r = -EINVAL;
>  			break;
>  		}
> -		r = init_used(vq, (struct vring_used __user *)a.used_user_addr);
> +		/* For 32bit we will ignore the top 32bits of the user
> +		   data */

I am not sure this comment is helpful here: we actually verify that the
top 32 bits are set to 0, a couple of lines above this:

                if ((u64)(unsigned long)a.desc_user_addr != a.desc_user_addr ||
                    (u64)(unsigned long)a.used_user_addr != a.used_user_addr ||
                    (u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) {
                        r = -EFAULT;
                        break;
                }


> +		r = init_used(vq, (struct vring_used __user *)(unsigned long)
> +						a.used_user_addr);
>  		if (r)
>  			break;
>  		vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));

  reply	other threads:[~2009-11-22  9:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 15:42 [PATCH] vhost: Fix warnings and bad type handling Alan Cox
2009-11-22  9:36 ` Michael S. Tsirkin [this message]
2009-11-22 10:28 ` Michael S. Tsirkin
2009-11-23  2:01   ` Rusty Russell

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=20091122093630.GA13160@redhat.com \
    --to=mst@redhat.com \
    --cc=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.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