[PATCH] ppc64: fix seccomp with 32-bit userland
authorAndrea Arcangeli <andrea@cpushare.com>
Fri, 24 Jun 2005 05:00:45 +0000 (22:00 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 24 Jun 2005 07:05:18 +0000 (00:05 -0700)
The seccomp check has to happen when entering the syscall and not when
exiting it or regs->gpr[0] contains garabge during signal handling in
ppc64_rt_sigreturn (this actually might be a bug too, but an orthogonal
one, since we really have to run the check before invoking the syscall and
not after it).

Signed-off-by: Andrea Arcangeli <andrea@cpushare.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/ptrace.c

index 9f8c6087ae568aaa9a7a2dd999ce65d3ea9828b9..2993f108d96d309f6f333bb47b38c86373551239 100644 (file)
@@ -305,6 +305,8 @@ static void do_syscall_trace(void)
 
 void do_syscall_trace_enter(struct pt_regs *regs)
 {
+       secure_computing(regs->gpr[0]);
+
        if (test_thread_flag(TIF_SYSCALL_TRACE)
            && (current->ptrace & PT_PTRACED))
                do_syscall_trace();
@@ -320,8 +322,6 @@ void do_syscall_trace_enter(struct pt_regs *regs)
 
 void do_syscall_trace_leave(struct pt_regs *regs)
 {
-       secure_computing(regs->gpr[0]);
-
        if (unlikely(current->audit_context))
                audit_syscall_exit(current, 
                                   (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,