diff options
author | Christopher Covington <cov@codeaurora.org> | 2014-03-19 12:29:37 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-03-20 13:41:27 -0400 |
commit | 31b1e940c5d47ee1a01baeccfb1b2b8890822d1a (patch) | |
tree | d80caf209aa2c68f96365e0c3bcb7a14719fb4c7 | |
parent | 74397174989e5f704bcefde7af02e12cc32cb164 (diff) |
arm64: Fix __range_ok macro
Without this, the following scenario is incorrectly determined
to be invalid.
addr 0x7f_ffffe000 size 8192 addr_limit 0x80_00000000
This behavior was observed while trying to vmsplice the stack
as part of a CRIU dump of a process on a system started with the
norandmaps kernel parameter.
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/include/asm/uaccess.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index 6c0f684aca81..3bf8f4e99a51 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h | |||
@@ -83,7 +83,7 @@ static inline void set_fs(mm_segment_t fs) | |||
83 | * Returns 1 if the range is valid, 0 otherwise. | 83 | * Returns 1 if the range is valid, 0 otherwise. |
84 | * | 84 | * |
85 | * This is equivalent to the following test: | 85 | * This is equivalent to the following test: |
86 | * (u65)addr + (u65)size < (u65)current->addr_limit | 86 | * (u65)addr + (u65)size <= current->addr_limit |
87 | * | 87 | * |
88 | * This needs 65-bit arithmetic. | 88 | * This needs 65-bit arithmetic. |
89 | */ | 89 | */ |
@@ -91,7 +91,7 @@ static inline void set_fs(mm_segment_t fs) | |||
91 | ({ \ | 91 | ({ \ |
92 | unsigned long flag, roksum; \ | 92 | unsigned long flag, roksum; \ |
93 | __chk_user_ptr(addr); \ | 93 | __chk_user_ptr(addr); \ |
94 | asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, cc" \ | 94 | asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, ls" \ |
95 | : "=&r" (flag), "=&r" (roksum) \ | 95 | : "=&r" (flag), "=&r" (roksum) \ |
96 | : "1" (addr), "Ir" (size), \ | 96 | : "1" (addr), "Ir" (size), \ |
97 | "r" (current_thread_info()->addr_limit) \ | 97 | "r" (current_thread_info()->addr_limit) \ |