Skip to content

Commit 2350ebe

Browse files
author
Russell King
committed
ARM: uaccess: add further explanation of __range_ok()
Detail the success return condition, and that we rely on KERNEL_DS being zero for this to operate correctly. Signed-off-by: Russell King <[email protected]>
1 parent 6da5238 commit 2350ebe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm/include/asm/uaccess.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ static inline void set_fs(mm_segment_t fs)
7878

7979
#define segment_eq(a, b) ((a) == (b))
8080

81-
/* We use 33-bit arithmetic here... */
81+
/*
82+
* We use 33-bit arithmetic here. Success returns zero, failure returns
83+
* addr_limit. We take advantage that addr_limit will be zero for KERNEL_DS,
84+
* so this will always return success in that case.
85+
*/
8286
#define __range_ok(addr, size) ({ \
8387
unsigned long flag, roksum; \
8488
__chk_user_ptr(addr); \

0 commit comments

Comments
 (0)