From: Oleg Drokin Date: Sun, 27 Mar 2016 16:05:03 +0000 (-0400) Subject: staging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=78ab125e63115a7f42d598a2113cd75092a40335;p=linux-beck.git staging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata 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 Acked-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c index b86e93795846..d89f71ee45b2 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c @@ -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 &&