<linux/uaccess.h>: Fix copy_in_user() declaration
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 23 Aug 2017 22:29:10 +0000 (15:29 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 31 Aug 2017 21:32:39 +0000 (17:32 -0400)
copy_in_user() copies data from user-space address @from to user-
space address @to. Hence declare both @from and @to as user-space
pointers.

Fixes: commit d597580d3737 ("generic ...copy_..._user primitives")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/uaccess.h

index acdd6f915a8d3d1185d8a13e587824313a5dd14f..20ef8e6ec2db93fc2c160f8697ef810385c5bcf2 100644 (file)
@@ -156,7 +156,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n)
 }
 #ifdef CONFIG_COMPAT
 static __always_inline unsigned long __must_check
-copy_in_user(void __user *to, const void *from, unsigned long n)
+copy_in_user(void __user *to, const void __user *from, unsigned long n)
 {
        might_fault();
        if (access_ok(VERIFY_WRITE, to, n) && access_ok(VERIFY_READ, from, n))