[PATCH] add __user markup in copy_user_handle_tail()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Namhyung Kim
Date: Friday, August 13, 2010 - 9:06 am

__get/put_user_nocheck() requires 2nd arg should be a user pointer but was missing
__user markup. Add it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 arch/x86/lib/usercopy_64.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
index b7c2849..84b0c1b 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -170,14 +170,17 @@ copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
 	unsigned zero_len;
 
 	for (; len; --len) {
-		if (__get_user_nocheck(c, from++, sizeof(char)))
+		if (__get_user_nocheck(c, (u8 __user __force *) from++,
+				       sizeof(char)))
 			break;
-		if (__put_user_nocheck(c, to++, sizeof(char)))
+		if (__put_user_nocheck(c, (u8 __user __force *) to++,
+				       sizeof(char)))
 			break;
 	}
 
 	for (c = 0, zero_len = len; zerorest && zero_len; --zero_len)
-		if (__put_user_nocheck(c, to++, sizeof(char)))
+		if (__put_user_nocheck(c, (u8 __user __force *) to++,
+				       sizeof(char)))
 			break;
 	return len;
 }
-- 
1.7.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] add __user markup in copy_user_handle_tail(), Namhyung Kim, (Fri Aug 13, 9:06 am)