提交 1985296a 编写于 作者: A Al Viro

fix the __user misannotations in asm-generic get_user/put_user

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 b9ea557e
......@@ -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); \
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册