]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata
authorOleg Drokin <green@linuxhacker.ru>
Sun, 27 Mar 2016 16:05:03 +0000 (12:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Mar 2016 19:08:45 +0000 (12:08 -0700)
Commit b8ff756bc351 ("staging: lustre: libcfs: merge code from
libcfs_ioctl into libcfs_ioctl_getdata") introduced a problem
copying just a single pointer worth of data from userspace
instead of whole libcfs_ioctl_hdr structure.
Adjust the copying amount.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/libcfs/linux/linux-module.c

index b86e937958460455ffe57de0a105cbd1d8a195ea..d89f71ee45b2920adbd52e2ab62a3049ce77f4c2 100644 (file)
@@ -128,7 +128,7 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp,
        struct libcfs_ioctl_hdr hdr;
        int err = 0;
 
-       if (copy_from_user(&hdr, uhdr, sizeof(uhdr)))
+       if (copy_from_user(&hdr, uhdr, sizeof(hdr)))
                return -EFAULT;
 
        if (hdr.ioc_version != LIBCFS_IOCTL_VERSION &&