All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: fix string functions on !MMU
@ 2014-04-21 18:10 Rabin Vincent
  2014-04-22  9:44 ` Will Deacon
  2014-04-28  7:51 ` Uwe Kleine-König
  0 siblings, 2 replies; 10+ messages in thread
From: Rabin Vincent @ 2014-04-21 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

8c56cc8be5b38e ("ARM: 7449/1: use generic strnlen_user and
strncpy_from_user functions") apparently broken those string operations
for !MMU.  USER_DS == KERNEL_DS on !MMU, so user_addr_max() always
restricts the addresses to TASK_SIZE.

TASK_SIZE has anyway no meaning on !MMU, so make user_addr_max() not
restrict anything.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 arch/arm/include/asm/uaccess.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 12c3a5d..c3a65f1 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -199,6 +199,9 @@ extern int __put_user_8(void *, unsigned long long);
 		__put_user_check(x,p);					\
 	 })
 
+#define user_addr_max() \
+	(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
+
 #else /* CONFIG_MMU */
 
 /*
@@ -210,6 +213,7 @@ extern int __put_user_8(void *, unsigned long long);
 #define __addr_ok(addr)		((void)(addr),1)
 #define __range_ok(addr,size)	((void)(addr),0)
 #define get_fs()		(KERNEL_DS)
+#define user_addr_max()		(~0UL)
 
 static inline void set_fs(mm_segment_t fs)
 {
@@ -222,9 +226,6 @@ static inline void set_fs(mm_segment_t fs)
 
 #define access_ok(type,addr,size)	(__range_ok(addr,size) == 0)
 
-#define user_addr_max() \
-	(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
-
 /*
  * The "__xxx" versions of the user access functions do not verify the
  * address space - it must have been done previously with a separate
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-06-03 19:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21 18:10 [PATCH] ARM: fix string functions on !MMU Rabin Vincent
2014-04-22  9:44 ` Will Deacon
2014-04-24 15:43   ` Rabin Vincent
2014-04-25  9:12     ` Will Deacon
2014-04-25 18:45       ` Rabin Vincent
2014-04-28 19:10         ` Will Deacon
2014-04-28  7:51 ` Uwe Kleine-König
2014-06-02 16:53   ` Rabin Vincent
2014-06-03  7:51     ` Uwe Kleine-König
2014-06-03 19:47       ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.