diff options
-rw-r--r-- | arch/parisc/Kconfig | 1 | ||||
-rw-r--r-- | arch/parisc/include/asm/compat.h | 7 | ||||
-rw-r--r-- | arch/parisc/include/asm/syscall.h | 13 | ||||
-rw-r--r-- | arch/parisc/kernel/ptrace.c | 9 | ||||
-rw-r--r-- | arch/parisc/kernel/signal32.c | 5 | ||||
-rw-r--r-- | arch/parisc/kernel/syscall.S | 2 |
6 files changed, 35 insertions, 2 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 989fa14147a9..bd3c873951a1 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -30,6 +30,7 @@ config PARISC | |||
30 | select TTY # Needed for pdc_cons.c | 30 | select TTY # Needed for pdc_cons.c |
31 | select HAVE_DEBUG_STACKOVERFLOW | 31 | select HAVE_DEBUG_STACKOVERFLOW |
32 | select HAVE_ARCH_AUDITSYSCALL | 32 | select HAVE_ARCH_AUDITSYSCALL |
33 | select HAVE_ARCH_SECCOMP_FILTER | ||
33 | select ARCH_NO_COHERENT_DMA_MMAP | 34 | select ARCH_NO_COHERENT_DMA_MMAP |
34 | 35 | ||
35 | help | 36 | help |
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 0448a2c8eafb..3387307cc33e 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h | |||
@@ -183,6 +183,13 @@ typedef struct compat_siginfo { | |||
183 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | 183 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ |
184 | int _fd; | 184 | int _fd; |
185 | } _sigpoll; | 185 | } _sigpoll; |
186 | |||
187 | /* SIGSYS */ | ||
188 | struct { | ||
189 | compat_uptr_t _call_addr; /* calling user insn */ | ||
190 | int _syscall; /* triggering system call number */ | ||
191 | compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */ | ||
192 | } _sigsys; | ||
186 | } _sifields; | 193 | } _sifields; |
187 | } compat_siginfo_t; | 194 | } compat_siginfo_t; |
188 | 195 | ||
diff --git a/arch/parisc/include/asm/syscall.h b/arch/parisc/include/asm/syscall.h index a5eba95d87fe..637ce8d6f375 100644 --- a/arch/parisc/include/asm/syscall.h +++ b/arch/parisc/include/asm/syscall.h | |||
@@ -39,6 +39,19 @@ static inline void syscall_get_arguments(struct task_struct *tsk, | |||
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline void syscall_set_return_value(struct task_struct *task, | ||
43 | struct pt_regs *regs, | ||
44 | int error, long val) | ||
45 | { | ||
46 | regs->gr[28] = error ? error : val; | ||
47 | } | ||
48 | |||
49 | static inline void syscall_rollback(struct task_struct *task, | ||
50 | struct pt_regs *regs) | ||
51 | { | ||
52 | /* do nothing */ | ||
53 | } | ||
54 | |||
42 | static inline int syscall_get_arch(void) | 55 | static inline int syscall_get_arch(void) |
43 | { | 56 | { |
44 | int arch = AUDIT_ARCH_PARISC; | 57 | int arch = AUDIT_ARCH_PARISC; |
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index ce0b2b4075c7..8fb81a391599 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
@@ -270,7 +270,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
270 | long do_syscall_trace_enter(struct pt_regs *regs) | 270 | long do_syscall_trace_enter(struct pt_regs *regs) |
271 | { | 271 | { |
272 | /* Do the secure computing check first. */ | 272 | /* Do the secure computing check first. */ |
273 | secure_computing_strict(regs->gr[20]); | 273 | if (secure_computing() == -1) |
274 | return -1; | ||
274 | 275 | ||
275 | if (test_thread_flag(TIF_SYSCALL_TRACE) && | 276 | if (test_thread_flag(TIF_SYSCALL_TRACE) && |
276 | tracehook_report_syscall_entry(regs)) { | 277 | tracehook_report_syscall_entry(regs)) { |
@@ -296,7 +297,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) | |||
296 | regs->gr[23] & 0xffffffff); | 297 | regs->gr[23] & 0xffffffff); |
297 | 298 | ||
298 | out: | 299 | out: |
299 | return regs->gr[20]; | 300 | /* |
301 | * Sign extend the syscall number to 64bit since it may have been | ||
302 | * modified by a compat ptrace call | ||
303 | */ | ||
304 | return (int) ((u32) regs->gr[20]); | ||
300 | } | 305 | } |
301 | 306 | ||
302 | void do_syscall_trace_exit(struct pt_regs *regs) | 307 | void do_syscall_trace_exit(struct pt_regs *regs) |
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c index 984abbee71ca..c342b2e17492 100644 --- a/arch/parisc/kernel/signal32.c +++ b/arch/parisc/kernel/signal32.c | |||
@@ -371,6 +371,11 @@ copy_siginfo_to_user32 (compat_siginfo_t __user *to, const siginfo_t *from) | |||
371 | val = (compat_int_t)from->si_int; | 371 | val = (compat_int_t)from->si_int; |
372 | err |= __put_user(val, &to->si_int); | 372 | err |= __put_user(val, &to->si_int); |
373 | break; | 373 | break; |
374 | case __SI_SYS >> 16: | ||
375 | err |= __put_user(ptr_to_compat(from->si_call_addr), &to->si_call_addr); | ||
376 | err |= __put_user(from->si_syscall, &to->si_syscall); | ||
377 | err |= __put_user(from->si_arch, &to->si_arch); | ||
378 | break; | ||
374 | } | 379 | } |
375 | } | 380 | } |
376 | return err; | 381 | return err; |
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 | ||