[PATCH] fix vhost ioctl handling for 32-bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



VHOST_GET_FEATURES returns high-order garbage on 32-bit
machines. This patch fixes it to use 64 bits throughout.

                                        +-DLS

[in-line for viewing, attached to avoid whitespace mangling]

Signed-off-by: David L Stevens <dlstevens@xxxxxxxxxx>

--- a/drivers/vhost/net.c       2009-11-17 22:51:56.000000000 -0800
+++ b/drivers/vhost/net.c       2009-12-17 11:31:51.000000000 -0800
@@ -563,7 +563,7 @@
 {
        struct vhost_net *n = f->private_data;
        void __user *argp = (void __user *)arg;
-       u32 __user *featurep = argp;
+       u64 __user *featurep = (u64 __user *)argp;
        struct vhost_vring_file backend;
        u64 features;
        int r;
@@ -577,7 +577,7 @@
                features = VHOST_FEATURES;
                return put_user(features, featurep);
        case VHOST_SET_FEATURES:
-               r = get_user(features, featurep);
+               r = copy_from_user(&features, featurep, sizeof features);
                /* No features for now */
                if (r < 0)
                        return r;

Attachment: VH1.patch
Description: Binary data


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux