diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 5 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 759f68066b5d..34a4dbd76f24 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -262,14 +262,11 @@ bad_alignment: | |||
262 | LEAF(sys_syscall) | 262 | LEAF(sys_syscall) |
263 | subu t0, a0, __NR_O32_Linux # check syscall number | 263 | subu t0, a0, __NR_O32_Linux # check syscall number |
264 | sltiu v0, t0, __NR_O32_Linux_syscalls + 1 | 264 | sltiu v0, t0, __NR_O32_Linux_syscalls + 1 |
265 | beqz t0, einval # do not recurse | ||
265 | sll t1, t0, 3 | 266 | sll t1, t0, 3 |
266 | beqz v0, einval | 267 | beqz v0, einval |
267 | |||
268 | lw t2, sys_call_table(t1) # syscall routine | 268 | lw t2, sys_call_table(t1) # syscall routine |
269 | 269 | ||
270 | li v1, 4000 - __NR_O32_Linux # index of sys_syscall | ||
271 | beq t0, v1, einval # do not recurse | ||
272 | |||
273 | /* Some syscalls like execve get their arguments from struct pt_regs | 270 | /* Some syscalls like execve get their arguments from struct pt_regs |
274 | and claim zero arguments in the syscall table. Thus we have to | 271 | and claim zero arguments in the syscall table. Thus we have to |
275 | assume the worst case and shuffle around all potential arguments. | 272 | assume the worst case and shuffle around all potential arguments. |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 6c7ef8313ebd..facb41a76d1b 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -174,14 +174,12 @@ not_o32_scall: | |||
174 | END(handle_sys) | 174 | END(handle_sys) |
175 | 175 | ||
176 | LEAF(sys32_syscall) | 176 | LEAF(sys32_syscall) |
177 | sltu v0, a0, __NR_O32_Linux + __NR_O32_Linux_syscalls + 1 | 177 | subu t0, a0, __NR_O32_Linux # check syscall number |
178 | sltiu v0, t0, __NR_O32_Linux_syscalls + 1 | ||
179 | beqz t0, einval # do not recurse | ||
180 | dsll t1, t0, 3 | ||
178 | beqz v0, einval | 181 | beqz v0, einval |
179 | 182 | ld t2, sys_call_table(t1) # syscall routine | |
180 | dsll v0, a0, 3 | ||
181 | ld t2, (sys_call_table - (__NR_O32_Linux * 8))(v0) | ||
182 | |||
183 | li v1, 4000 # indirect syscall number | ||
184 | beq a0, v1, einval # do not recurse | ||
185 | 183 | ||
186 | move a0, a1 # shift argument registers | 184 | move a0, a1 # shift argument registers |
187 | move a1, a2 | 185 | move a1, a2 |