RE: [PATCH] staging/lustre/libcfs: Copy correct amount in libcfs_ioctl_getdata

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

 



>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@xxxxxxxxxxxxxx>

Acked- by: James Simmons <jsimmons@xxxxxxxxxxxxx>

>---
> drivers/staging/lustre/lnet/libcfs/linux/linux-module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
>index b86e937..d89f71e 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 &&
>-- 
>2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux