aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/syscall.S
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-03-30 08:14:31 -0400
committerHelge Deller <deller@gmx.de>2016-03-31 06:28:38 -0400
commit910cd32e552ea09caa89cdbe328e468979b030dd (patch)
tree02cc8c1d9d0202d76f988ae242ccbc328a8e43cd /arch/parisc/kernel/syscall.S
parent4f4acc9472e54ce702f1d85fc9e6d57767dec91f (diff)
parisc: Fix and enable seccomp filter support
The seccomp filter support requires careful handling of task registers. This includes reloading of the return value (%r28) and proper syscall exit if secure_computing() returned -1. Additionally we need to sign-extend the syscall number from signed 32bit to signed 64bit in do_syscall_trace_enter() since the ptrace interface only allows storing 32bit values in compat mode. Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v4.5
Diffstat (limited to 'arch/parisc/kernel/syscall.S')
-rw-r--r--arch/parisc/kernel/syscall.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index fbafa0d0e2bf..c976ebfe2269 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -329,6 +329,7 @@ tracesys_next:
329 329
330 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ 330 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
331 LDREG TI_TASK(%r1), %r1 331 LDREG TI_TASK(%r1), %r1
332 LDREG TASK_PT_GR28(%r1), %r28 /* Restore return value */
332 LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */ 333 LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */
333 LDREG TASK_PT_GR25(%r1), %r25 334 LDREG TASK_PT_GR25(%r1), %r25
334 LDREG TASK_PT_GR24(%r1), %r24 335 LDREG TASK_PT_GR24(%r1), %r24
@@ -342,6 +343,7 @@ tracesys_next:
342 stw %r21, -56(%r30) /* 6th argument */ 343 stw %r21, -56(%r30) /* 6th argument */
343#endif 344#endif
344 345
346 cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */
345 comiclr,>>= __NR_Linux_syscalls, %r20, %r0 347 comiclr,>>= __NR_Linux_syscalls, %r20, %r0
346 b,n .Ltracesys_nosys 348 b,n .Ltracesys_nosys
347 349