vhost: fix high 32 bit in FEATURES ioctls
Subsystems (3)
Michael S. Tsirkin
maintainerPATCH 1/1 vhost: fix high 32 bit in FEATURES ioctls
From: David Stevens <[email protected]>
Subject: vhost: fix high 32 bit in FEATURES ioctls
VHOST_GET_FEATURES fails to initialize high-order 32 bits in the returned value, and VHOST_SET_FEATURES fails to check them. This patch fixes it to use 64 bits throughout.
Signed-off-by David L Stevens <[email protected]>
Signed-off-by Michael S. Tsirkin <[email protected]>
---
Rusty, can you queue this for 2.6.33 as well please?
drivers/vhost/net.c +3 -4
@@ -563,7 +563,7 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, {struct vhost_net *n = f->private_data;void __user *argp = (void __user *)arg; -u32 __user *featurep = argp; +u64 __user *featurep = argp;struct vhost_vring_file backend;u64 features;int r;
@@ -575,10 +575,9 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,return vhost_net_set_backend (n, backend.index, backend.fd);case VHOST_GET_FEATURES : features =VHOST_FEATURES ; -return put_user (features, featurep); +return copy_to_user (featurep, &features,sizeof features);case VHOST_SET_FEATURES : - r =get_user (features, featurep); -/* No features for now */ + r =copy_from_user (&features, featurep,sizeof features);if (r <0 )return r;if (features & ~VHOST_FEATURES )
Signature · 1 line
MST
Rusty Russell
AppliedQuoted 2 lines · Michael S. Tsirkin
From: David Stevens <[email protected]>
Subject: vhost: fix high 32 bit in FEATURES ioctls
Thanks, applied.
Rusty.
Rusty Russell
AppliedQuoted 2 lines · Michael S. Tsirkin
From: David Stevens <[email protected]>
Subject: vhost: fix high 32 bit in FEATURES ioctls
Thanks, applied.
Rusty.