linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] Fix PPC32 SECCOMP, unexport do_syscall_trace_{enter,leave}
Date: Fri, 22 Sep 2006 09:32:45 +0100	[thread overview]
Message-ID: <1158913965.24527.659.camel@pmac.infradead.org> (raw)

The secure_computing() call which automatically aborts a process if it
tries to execute a syscall it shouldn't is much more useful if we
actually do it _before_ the syscall, rather than afterwards. PPC64 got
this right, but the original incorrect behaviour inherited from arch/ppc
was preserved by ifdefs. Make it the same on PPC32 too.

Also, I see no need to export do_syscall_trace_{leave,enter} on ppc32 --
they were only exported because the old do_syscall_trace() (which they
replaced) used to be.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index dea75d7..9c78009 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -526,9 +526,7 @@ static void do_syscall_trace(void)
 
 void do_syscall_trace_enter(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC64
 	secure_computing(regs->gpr[0]);
-#endif
 
 	if (test_thread_flag(TIF_SYSCALL_TRACE)
 	    && (current->ptrace & PT_PTRACED))
@@ -548,10 +546,6 @@ #endif
 
 void do_syscall_trace_leave(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC32
-	secure_computing(regs->gpr[0]);
-#endif
-
 	if (unlikely(current->audit_context))
 		audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
 				   regs->result);
@@ -561,8 +555,3 @@ #endif
 	    && (current->ptrace & PT_PTRACED))
 		do_syscall_trace();
 }
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(do_syscall_trace_enter);
-EXPORT_SYMBOL(do_syscall_trace_leave);
-#endif

-- 
dwmw2

                 reply	other threads:[~2006-09-22  8:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1158913965.24527.659.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).