summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/scall64-o32.S
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-01-22 14:40:02 +0000
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 23:09:08 +0100
commit9d37c405ed7e4bb10798c37ef4e642b682425c4e (patch)
tree78769bc0db8669af7e51832412908b3af3ff351e /arch/mips/kernel/scall64-o32.S
parent1225eb825208b529fd4c01d07faf9db48e68cd33 (diff)
MIPS: kernel: scalls: Skip the syscall if denied by the seccomp filter
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Reviewed-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6399/ 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.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 6788727d91af..67dc022f6826 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -114,6 +114,8 @@ trace_a_syscall:
move a0, sp
jal syscall_trace_enter
+ bltz v0, 2f # seccomp failed? Skip syscall
+
move t0, s0
RESTORE_STATIC
ld a0, PT_R4(sp) # Restore argument registers
@@ -136,7 +138,7 @@ trace_a_syscall:
sd t1, PT_R0(sp) # save it for syscall restarting
1: sd v0, PT_R2(sp) # result
- j syscall_exit
+2: j syscall_exit
/* ------------------------------------------------------------------------ */