diff options
Diffstat (limited to 'arch/arm/lib/getuser.S')
-rw-r--r-- | arch/arm/lib/getuser.S | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index 11093a7c3e32..9b06bb41fca6 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S | |||
@@ -16,8 +16,9 @@ | |||
16 | * __get_user_X | 16 | * __get_user_X |
17 | * | 17 | * |
18 | * Inputs: r0 contains the address | 18 | * Inputs: r0 contains the address |
19 | * r1 contains the address limit, which must be preserved | ||
19 | * Outputs: r0 is the error code | 20 | * Outputs: r0 is the error code |
20 | * r2, r3 contains the zero-extended value | 21 | * r2 contains the zero-extended value |
21 | * lr corrupted | 22 | * lr corrupted |
22 | * | 23 | * |
23 | * No other registers must be altered. (see <asm/uaccess.h> | 24 | * No other registers must be altered. (see <asm/uaccess.h> |
@@ -27,33 +28,39 @@ | |||
27 | * Note also that it is intended that __get_user_bad is not global. | 28 | * Note also that it is intended that __get_user_bad is not global. |
28 | */ | 29 | */ |
29 | #include <linux/linkage.h> | 30 | #include <linux/linkage.h> |
31 | #include <asm/assembler.h> | ||
30 | #include <asm/errno.h> | 32 | #include <asm/errno.h> |
31 | #include <asm/domain.h> | 33 | #include <asm/domain.h> |
32 | 34 | ||
33 | ENTRY(__get_user_1) | 35 | ENTRY(__get_user_1) |
36 | check_uaccess r0, 1, r1, r2, __get_user_bad | ||
34 | 1: TUSER(ldrb) r2, [r0] | 37 | 1: TUSER(ldrb) r2, [r0] |
35 | mov r0, #0 | 38 | mov r0, #0 |
36 | mov pc, lr | 39 | mov pc, lr |
37 | ENDPROC(__get_user_1) | 40 | ENDPROC(__get_user_1) |
38 | 41 | ||
39 | ENTRY(__get_user_2) | 42 | ENTRY(__get_user_2) |
40 | #ifdef CONFIG_THUMB2_KERNEL | 43 | check_uaccess r0, 2, r1, r2, __get_user_bad |
41 | 2: TUSER(ldrb) r2, [r0] | 44 | #ifdef CONFIG_CPU_USE_DOMAINS |
42 | 3: TUSER(ldrb) r3, [r0, #1] | 45 | rb .req ip |
46 | 2: ldrbt r2, [r0], #1 | ||
47 | 3: ldrbt rb, [r0], #0 | ||
43 | #else | 48 | #else |
44 | 2: TUSER(ldrb) r2, [r0], #1 | 49 | rb .req r0 |
45 | 3: TUSER(ldrb) r3, [r0] | 50 | 2: ldrb r2, [r0] |
51 | 3: ldrb rb, [r0, #1] | ||
46 | #endif | 52 | #endif |
47 | #ifndef __ARMEB__ | 53 | #ifndef __ARMEB__ |
48 | orr r2, r2, r3, lsl #8 | 54 | orr r2, r2, rb, lsl #8 |
49 | #else | 55 | #else |
50 | orr r2, r3, r2, lsl #8 | 56 | orr r2, rb, r2, lsl #8 |
51 | #endif | 57 | #endif |
52 | mov r0, #0 | 58 | mov r0, #0 |
53 | mov pc, lr | 59 | mov pc, lr |
54 | ENDPROC(__get_user_2) | 60 | ENDPROC(__get_user_2) |
55 | 61 | ||
56 | ENTRY(__get_user_4) | 62 | ENTRY(__get_user_4) |
63 | check_uaccess r0, 4, r1, r2, __get_user_bad | ||
57 | 4: TUSER(ldr) r2, [r0] | 64 | 4: TUSER(ldr) r2, [r0] |
58 | mov r0, #0 | 65 | mov r0, #0 |
59 | mov pc, lr | 66 | mov pc, lr |