diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 7 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 16 | ||||
-rw-r--r-- | arch/mips/kernel/vpe.c | 2 |
4 files changed, 11 insertions, 16 deletions
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 759f68066b5..d0916a55cd7 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. |
@@ -627,7 +624,7 @@ einval: li v0, -ENOSYS | |||
627 | sys sys_pselect6 6 | 624 | sys sys_pselect6 6 |
628 | sys sys_ppoll 5 | 625 | sys sys_ppoll 5 |
629 | sys sys_unshare 1 | 626 | sys sys_unshare 1 |
630 | sys sys_splice 4 | 627 | sys sys_splice 6 |
631 | sys sys_sync_file_range 7 /* 4305 */ | 628 | sys sys_sync_file_range 7 /* 4305 */ |
632 | sys sys_tee 4 | 629 | sys sys_tee 4 |
633 | sys sys_vmsplice 4 | 630 | sys sys_vmsplice 4 |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index e266b3aa656..30f3b6317a8 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -390,7 +390,7 @@ EXPORT(sysn32_call_table) | |||
390 | PTR sys_splice | 390 | PTR sys_splice |
391 | PTR sys_sync_file_range | 391 | PTR sys_sync_file_range |
392 | PTR sys_tee | 392 | PTR sys_tee |
393 | PTR sys_vmsplice /* 6270 */ | 393 | PTR compat_sys_vmsplice /* 6270 */ |
394 | PTR sys_move_pages | 394 | PTR sys_move_pages |
395 | PTR compat_sys_set_robust_list | 395 | PTR compat_sys_set_robust_list |
396 | PTR compat_sys_get_robust_list | 396 | PTR compat_sys_get_robust_list |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 6c7ef8313eb..fefef4af859 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 |
@@ -198,7 +196,7 @@ LEAF(sys32_syscall) | |||
198 | jr t2 | 196 | jr t2 |
199 | /* Unreached */ | 197 | /* Unreached */ |
200 | 198 | ||
201 | einval: li v0, -EINVAL | 199 | einval: li v0, -ENOSYS |
202 | jr ra | 200 | jr ra |
203 | END(sys32_syscall) | 201 | END(sys32_syscall) |
204 | 202 | ||
@@ -512,7 +510,7 @@ sys_call_table: | |||
512 | PTR sys_splice | 510 | PTR sys_splice |
513 | PTR sys32_sync_file_range /* 4305 */ | 511 | PTR sys32_sync_file_range /* 4305 */ |
514 | PTR sys_tee | 512 | PTR sys_tee |
515 | PTR sys_vmsplice | 513 | PTR compat_sys_vmsplice |
516 | PTR compat_sys_move_pages | 514 | PTR compat_sys_move_pages |
517 | PTR compat_sys_set_robust_list | 515 | PTR compat_sys_set_robust_list |
518 | PTR compat_sys_get_robust_list /* 4310 */ | 516 | PTR compat_sys_get_robust_list /* 4310 */ |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 972b2d2b840..a1b3da6bad5 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1134,7 +1134,7 @@ static int vpe_release(struct inode *inode, struct file *filp) | |||
1134 | 1134 | ||
1135 | /* It's good to be able to run the SP and if it chokes have a look at | 1135 | /* It's good to be able to run the SP and if it chokes have a look at |
1136 | the /dev/rt?. But if we reset the pointer to the shared struct we | 1136 | the /dev/rt?. But if we reset the pointer to the shared struct we |
1137 | loose what has happened. So perhaps if garbage is sent to the vpe | 1137 | lose what has happened. So perhaps if garbage is sent to the vpe |
1138 | device, use it as a trigger for the reset. Hopefully a nice | 1138 | device, use it as a trigger for the reset. Hopefully a nice |
1139 | executable will be along shortly. */ | 1139 | executable will be along shortly. */ |
1140 | if (ret < 0) | 1140 | if (ret < 0) |