[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1214602486-17080-36-git-send-email-gcosta@redhat.com>
Date: Fri, 27 Jun 2008 18:34:42 -0300
From: Glauber Costa <gcosta@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, mingo@...e.hu, x86@...nel.org
Subject: [PATCH 35/39] turn __put_user_check directly into put_user.
We also check user pointer in x86_64 put_user, the way i386 does.
in a separate patch for bisecting purposes.
Signed-off-by: Glauber Costa <gcosta@...hat.com>
---
include/asm-x86/uaccess_64.h | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 42a9769..9139854 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -23,9 +23,6 @@ extern void __put_user_bad(void);
:"c" (ptr),"a" (x) \
:"ebx")
-#define put_user(x, ptr) \
- __put_user_check((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
-
#define __get_user(x, ptr) \
__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
#define __put_user(x, ptr) \
@@ -34,11 +31,12 @@ extern void __put_user_bad(void);
#define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user
-#define __put_user_check(x, ptr, size) \
+#define put_user(x, ptr) \
({ \
int __pu_err; \
typeof(*(ptr)) __user *__pu_addr = (ptr); \
- switch (size) { \
+ __chk_user_ptr(ptr); \
+ switch (sizeof(*(ptr))) { \
case 1: \
__put_user_x(1, __pu_err, x, __pu_addr); \
break; \
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists