Commit 842f2d59 authored by Russell King's avatar Russell King

[ARM] Remove unnecessary get_user/put_user checks.

Remove unnecessary checks for addresses > TI_ADDR_LIMIT in
get_user/put_user.  The MMU will catch out of bounds accesses
for us.
parent ef4ecc64
......@@ -32,59 +32,34 @@
.global __get_user_1
__get_user_1:
bic r1, sp, #0x1f00
bic r1, r1, #0x00ff
ldr r1, [r1, #TI_ADDR_LIMIT]
sub r1, r1, #1
cmp r0, r1
1: ldrlsbt r1, [r0]
movls r0, #0
movls pc, lr
b __get_user_bad
1: ldrbt r1, [r0]
mov r0, #0
mov pc, lr
.global __get_user_2
__get_user_2:
bic r2, sp, #0x1f00
bic r2, r2, #0x00ff
ldr r2, [r2, #TI_ADDR_LIMIT]
sub r2, r2, #2
cmp r0, r2
2: ldrlsbt r1, [r0], #1
3: ldrlsbt r2, [r0]
2: ldrbt r1, [r0], #1
3: ldrbt r2, [r0]
#ifndef __ARMEB__
orrls r1, r1, r2, lsl #8
orr r1, r1, r2, lsl #8
#else
orrls r1, r2, r1, lsl #8
orr r1, r2, r1, lsl #8
#endif
movls r0, #0
movls pc, lr
b __get_user_bad
mov r0, #0
mov pc, lr
.global __get_user_4
__get_user_4:
bic r1, sp, #0x1f00
bic r1, r1, #0x00ff
ldr r1, [r1, #TI_ADDR_LIMIT]
sub r1, r1, #4
cmp r0, r1
4: ldrlst r1, [r0]
movls r0, #0
movls pc, lr
b __get_user_bad
4: ldrt r1, [r0]
mov r0, #0
mov pc, lr
.global __get_user_8
__get_user_8:
bic r2, sp, #0x1f00
bic r2, r2, #0x00ff
ldr r2, [r2, #TI_ADDR_LIMIT]
sub r2, r2, #8
cmp r0, r2
5: ldrlst r1, [r0], #4
6: ldrlst r2, [r0]
movls r0, #0
movls pc, lr
/* fall through */
5: ldrt r1, [r0], #4
6: ldrt r2, [r0]
mov r0, #0
mov pc, lr
__get_user_bad_8:
mov r2, #0
......
......@@ -32,60 +32,35 @@
.global __put_user_1
__put_user_1:
bic ip, sp, #0x1f00
bic ip, ip, #0x00ff
ldr ip, [ip, #TI_ADDR_LIMIT]
sub ip, ip, #1
cmp r0, ip
1: strlsbt r1, [r0]
movls r0, #0
movls pc, lr
b __put_user_bad
1: strbt r1, [r0]
mov r0, #0
mov pc, lr
.global __put_user_2
__put_user_2:
bic ip, sp, #0x1f00
bic ip, ip, #0x00ff
ldr ip, [ip, #TI_ADDR_LIMIT]
sub ip, ip, #2
cmp r0, ip
movls ip, r1, lsr #8
mov ip, r1, lsr #8
#ifndef __ARMEB__
2: strlsbt r1, [r0], #1
3: strlsbt ip, [r0]
2: strbt r1, [r0], #1
3: strbt ip, [r0]
#else
2: strlsbt ip, [r0], #1
3: strlsbt r1, [r0]
2: strbt ip, [r0], #1
3: strbt r1, [r0]
#endif
movls r0, #0
movls pc, lr
b __put_user_bad
mov r0, #0
mov pc, lr
.global __put_user_4
__put_user_4:
bic ip, sp, #0x1f00
bic ip, ip, #0x00ff
ldr ip, [ip, #TI_ADDR_LIMIT]
sub ip, ip, #4
cmp r0, ip
4: strlst r1, [r0]
movls r0, #0
movls pc, lr
b __put_user_bad
4: strt r1, [r0]
mov r0, #0
mov pc, lr
.global __put_user_8
__put_user_8:
bic ip, sp, #0x1f00
bic ip, ip, #0x00ff
ldr ip, [ip, #TI_ADDR_LIMIT]
sub ip, ip, #8
cmp r0, ip
5: strlst r1, [r0], #4
6: strlst r2, [r0]
movls r0, #0
movls pc, lr
/* fall through */
5: strt r1, [r0], #4
6: strt r2, [r0]
mov r0, #0
mov pc, lr
__put_user_bad:
mov r0, #-EFAULT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment