diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-19 06:02:28 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-25 11:14:43 -0400 |
| commit | 3fba7e23f754a9a6e639b640fa2a393712ffe1b8 (patch) | |
| tree | c9a472b59b67700bdde134a4dc707ae607837faa /arch/arm/lib | |
| parent | 08446b129bbde34665c423d882f857a45b8c3aed (diff) | |
ARM: uaccess: provide uaccess_save_and_enable() and uaccess_restore()
Provide uaccess_save_and_enable() and uaccess_restore() to permit
control of userspace visibility to the kernel, and hook these into
the appropriate places in the kernel where we need to access
userspace.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/lib')
| -rw-r--r-- | arch/arm/lib/clear_user.S | 6 | ||||
| -rw-r--r-- | arch/arm/lib/copy_from_user.S | 6 | ||||
| -rw-r--r-- | arch/arm/lib/copy_to_user.S | 6 | ||||
| -rw-r--r-- | arch/arm/lib/uaccess_with_memcpy.c | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S index 1710fd7db2d5..970d6c043774 100644 --- a/arch/arm/lib/clear_user.S +++ b/arch/arm/lib/clear_user.S | |||
| @@ -12,14 +12,14 @@ | |||
| 12 | 12 | ||
| 13 | .text | 13 | .text |
| 14 | 14 | ||
| 15 | /* Prototype: int __clear_user(void *addr, size_t sz) | 15 | /* Prototype: unsigned long arm_clear_user(void *addr, size_t sz) |
| 16 | * Purpose : clear some user memory | 16 | * Purpose : clear some user memory |
| 17 | * Params : addr - user memory address to clear | 17 | * Params : addr - user memory address to clear |
| 18 | * : sz - number of bytes to clear | 18 | * : sz - number of bytes to clear |
| 19 | * Returns : number of bytes NOT cleared | 19 | * Returns : number of bytes NOT cleared |
| 20 | */ | 20 | */ |
| 21 | ENTRY(__clear_user_std) | 21 | ENTRY(__clear_user_std) |
| 22 | WEAK(__clear_user) | 22 | WEAK(arm_clear_user) |
| 23 | stmfd sp!, {r1, lr} | 23 | stmfd sp!, {r1, lr} |
| 24 | mov r2, #0 | 24 | mov r2, #0 |
| 25 | cmp r1, #4 | 25 | cmp r1, #4 |
| @@ -44,7 +44,7 @@ WEAK(__clear_user) | |||
| 44 | USER( strnebt r2, [r0]) | 44 | USER( strnebt r2, [r0]) |
| 45 | mov r0, #0 | 45 | mov r0, #0 |
| 46 | ldmfd sp!, {r1, pc} | 46 | ldmfd sp!, {r1, pc} |
| 47 | ENDPROC(__clear_user) | 47 | ENDPROC(arm_clear_user) |
| 48 | ENDPROC(__clear_user_std) | 48 | ENDPROC(__clear_user_std) |
| 49 | 49 | ||
| 50 | .pushsection .text.fixup,"ax" | 50 | .pushsection .text.fixup,"ax" |
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 7a235b9952be..1512bebfbf1b 100644 --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | /* | 17 | /* |
| 18 | * Prototype: | 18 | * Prototype: |
| 19 | * | 19 | * |
| 20 | * size_t __copy_from_user(void *to, const void *from, size_t n) | 20 | * size_t arm_copy_from_user(void *to, const void *from, size_t n) |
| 21 | * | 21 | * |
| 22 | * Purpose: | 22 | * Purpose: |
| 23 | * | 23 | * |
| @@ -89,11 +89,11 @@ | |||
| 89 | 89 | ||
| 90 | .text | 90 | .text |
| 91 | 91 | ||
| 92 | ENTRY(__copy_from_user) | 92 | ENTRY(arm_copy_from_user) |
| 93 | 93 | ||
| 94 | #include "copy_template.S" | 94 | #include "copy_template.S" |
| 95 | 95 | ||
| 96 | ENDPROC(__copy_from_user) | 96 | ENDPROC(arm_copy_from_user) |
| 97 | 97 | ||
| 98 | .pushsection .fixup,"ax" | 98 | .pushsection .fixup,"ax" |
| 99 | .align 0 | 99 | .align 0 |
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S index 9648b0675a3e..caf5019d8161 100644 --- a/arch/arm/lib/copy_to_user.S +++ b/arch/arm/lib/copy_to_user.S | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | /* | 17 | /* |
| 18 | * Prototype: | 18 | * Prototype: |
| 19 | * | 19 | * |
| 20 | * size_t __copy_to_user(void *to, const void *from, size_t n) | 20 | * size_t arm_copy_to_user(void *to, const void *from, size_t n) |
| 21 | * | 21 | * |
| 22 | * Purpose: | 22 | * Purpose: |
| 23 | * | 23 | * |
| @@ -93,11 +93,11 @@ | |||
| 93 | .text | 93 | .text |
| 94 | 94 | ||
| 95 | ENTRY(__copy_to_user_std) | 95 | ENTRY(__copy_to_user_std) |
| 96 | WEAK(__copy_to_user) | 96 | WEAK(arm_copy_to_user) |
| 97 | 97 | ||
| 98 | #include "copy_template.S" | 98 | #include "copy_template.S" |
| 99 | 99 | ||
| 100 | ENDPROC(__copy_to_user) | 100 | ENDPROC(arm_copy_to_user) |
| 101 | ENDPROC(__copy_to_user_std) | 101 | ENDPROC(__copy_to_user_std) |
| 102 | 102 | ||
| 103 | .pushsection .text.fixup,"ax" | 103 | .pushsection .text.fixup,"ax" |
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 3e58d710013c..77f020e75ccd 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c | |||
| @@ -136,7 +136,7 @@ out: | |||
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | unsigned long | 138 | unsigned long |
| 139 | __copy_to_user(void __user *to, const void *from, unsigned long n) | 139 | arm_copy_to_user(void __user *to, const void *from, unsigned long n) |
| 140 | { | 140 | { |
| 141 | /* | 141 | /* |
| 142 | * This test is stubbed out of the main function above to keep | 142 | * This test is stubbed out of the main function above to keep |
| @@ -190,7 +190,7 @@ out: | |||
| 190 | return n; | 190 | return n; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | unsigned long __clear_user(void __user *addr, unsigned long n) | 193 | unsigned long arm_clear_user(void __user *addr, unsigned long n) |
| 194 | { | 194 | { |
| 195 | /* See rational for this in __copy_to_user() above. */ | 195 | /* See rational for this in __copy_to_user() above. */ |
| 196 | if (n < 64) | 196 | if (n < 64) |
