lkml.org 
[lkml]   [2009]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] vhost: Fix warnings and bad type handling
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));


\
 
 \ /
  Last update: 2009-11-22 10:41    [W:0.057 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site