Skip to content

Commit

Permalink
[PATCH] ppc64: fix seccomp with 32-bit userland
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
aagit authored and Linus Torvalds committed Jun 24, 2005
1 parent 16822e6 commit 7286aa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/ppc64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand Down

0 comments on commit 7286aa9

Please sign in to comment.