linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
To: <benh@kernel.crashing.org>, <paulus@samba.org>,
	<linuxppc-dev@lists.ozlabs.org>, <mpe@ellerman.id.au>
Cc: pmoore@redhat.com, linux-kernel@vger.kernel.org,
	Bogdan Purcareata <bogdan.purcareata@freescale.com>,
	strosake@linux.vnet.ibm.com
Subject: [PATCH v4 2/3] powerpc: Relax secure computing on syscall entry trace
Date: Wed, 18 Feb 2015 08:16:52 +0000	[thread overview]
Message-ID: <1424247413-20753-3-git-send-email-bogdan.purcareata@freescale.com> (raw)
In-Reply-To: <1424247413-20753-1-git-send-email-bogdan.purcareata@freescale.com>

The secure_computing_strict will just force the kernel to panic on
secure_computing failure. Once SECCOMP_FILTER support is enabled in the kernel,
syscalls can be denied without system failure.

v4:
- rebase on top of 3.19

v3,v2: no changes

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
---
 arch/powerpc/kernel/ptrace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 2edae06..cb9fd33 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1772,7 +1772,9 @@ long do_syscall_trace_enter(struct pt_regs *regs)
 
 	user_exit();
 
-	secure_computing_strict(regs->gpr[0]);
+	/* Do the secure computing check first; failures should be fast. */
+	if (secure_computing() == -1)
+		return -1L;
 
 	if (test_thread_flag(TIF_SYSCALL_TRACE) &&
 	    tracehook_report_syscall_entry(regs)) {
-- 
2.1.4

  parent reply	other threads:[~2015-02-18  8:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18  8:16 [PATCH v4 0/3] powerpc: Enable seccomp filter support Bogdan Purcareata
2015-02-18  8:16 ` [PATCH v4 1/3] powerpc: Don't force ENOSYS as error on syscall fail Bogdan Purcareata
2015-02-18  8:16 ` Bogdan Purcareata [this message]
2015-02-18  8:16 ` [PATCH v4 3/3] powerpc: Enable HAVE_ARCH_SECCOMP_FILTER Bogdan Purcareata
2015-02-27  7:28 ` [PATCH v4 0/3] powerpc: Enable seccomp filter support Purcareata Bogdan
2015-02-27 20:54   ` Benjamin Herrenschmidt
2015-03-09  8:26     ` Purcareata Bogdan
2015-03-23 11:44     ` Purcareata Bogdan
2015-03-25  9:31       ` Michael Ellerman

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=1424247413-20753-3-git-send-email-bogdan.purcareata@freescale.com \
    --to=bogdan.purcareata@freescale.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=pmoore@redhat.com \
    --cc=strosake@linux.vnet.ibm.com \
    /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).