summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/scall64-o32.S
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2010-09-28 18:50:37 +0100
committerRalf Baechle <ralf@linux-mips.org>2010-10-18 16:59:02 +0100
commit8f5a00eb422ed86e77bb8f67e08b9fe6d30f679a (patch)
tree6b625361c9581fb71fd2d005b5de54804d4f9798 /arch/mips/kernel/scall64-o32.S
parente5b377a8fb7b05f27647698ac739a0504cb2bf80 (diff)
downloadlinux-8f5a00eb422ed86e77bb8f67e08b9fe6d30f679a.tar.bz2
MIPS: Sanitize restart logics
Put the original syscall number into ->regs[0] when we leave syscall with error. Use it in restart logics. Everything else will have it 0 since we pass through SAVE_SOME on all the ways in. Note that in places like bad_stack and inllegal_syscall we leave it 0 - it's not restartable. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1698/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/scall64-o32.S')
-rw-r--r--arch/mips/kernel/scall64-o32.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 813689ef2384..7ce0a3685627 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -93,8 +93,9 @@ NESTED(handle_sys, PT_SIZE, sp)
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f
+ ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
- sd v0, PT_R0(sp) # flag for syscall restarting
+ sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result
o32_syscall_exit:
@@ -142,8 +143,9 @@ trace_a_syscall:
sd t0, PT_R7(sp) # set error flag
beqz t0, 1f
+ ld t1, PT_R2(sp) # syscall number
dnegu v0 # error
- sd v0, PT_R0(sp) # set flag for syscall restarting
+ sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result
j syscall_exit
@@ -155,7 +157,6 @@ trace_a_syscall:
*/
bad_stack:
dnegu v0 # error
- sd v0, PT_R0(sp)
sd v0, PT_R2(sp)
li t0, 1 # set error flag
sd t0, PT_R7(sp)