fix the __user misannotations in asm-generic get_user/put_user
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Sep 2017 16:07:24 +0000 (12:07 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Sep 2017 16:07:24 +0000 (12:07 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/asm-generic/uaccess.h

index 723e81a6c162052e82849864d37794541ac82f38..2e51f6e7b3c26d4f6102db05211b5e7a88306dda 100644 (file)
@@ -75,10 +75,10 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
 
 #define put_user(x, ptr)                                       \
 ({                                                             \
-       void *__p = (ptr);                                      \
+       void __user *__p = (ptr);                               \
        might_fault();                                          \
        access_ok(VERIFY_WRITE, __p, sizeof(*ptr)) ?            \
-               __put_user((x), ((__typeof__(*(ptr)) *)__p)) :  \
+               __put_user((x), ((__typeof__(*(ptr)) __user *)__p)) :   \
                -EFAULT;                                        \
 })
 
@@ -137,10 +137,10 @@ extern int __put_user_bad(void) __attribute__((noreturn));
 
 #define get_user(x, ptr)                                       \
 ({                                                             \
-       const void *__p = (ptr);                                \
+       const void __user *__p = (ptr);                         \
        might_fault();                                          \
        access_ok(VERIFY_READ, __p, sizeof(*ptr)) ?             \
-               __get_user((x), (__typeof__(*(ptr)) *)__p) :    \
+               __get_user((x), (__typeof__(*(ptr)) __user *)__p) :\
                ((x) = (__typeof__(*(ptr)))0,-EFAULT);          \
 })