linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wad-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org
Subject: [PATCH] prctl: update seccomp sections
Date: Tue, 5 Jun 2012 11:12:09 -0700	[thread overview]
Message-ID: <20120605181209.GP29466@outflux.net> (raw)

This adds a short summary of the arguments used for "mode 2" (BPF)
seccomp.

Signed-off-by: Kees Cook <kees-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
---
 man2/prctl.2 |   37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/man2/prctl.2 b/man2/prctl.2
index 215b945..4005054 100644
--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -235,11 +235,17 @@ in the location pointed to by
 .\" See http://thread.gmane.org/gmane.linux.kernel/542632
 .\" [PATCH 0 of 2] seccomp updates
 .\" andrea-Vyt77T80VFVWk0Htik3J/w@public.gmane.org
-Set the secure computing mode for the calling thread.
-In the current implementation,
+Set the secure computing mode for the calling thread, to limit
+the available syscalls.
+The seccomp mode is selected via
+.IR arg2 .
+(The seccomp constants are defined in
+.IR <linux/seccomp.h> .)
+
+With
 .IR arg2
-must be 1.
-After the secure computing mode has been set to 1,
+set to
+.BR SECCOMP_MODE_STRICT
 the only system calls that the thread is permitted to make are
 .BR read (2),
 .BR write (2),
@@ -249,22 +255,35 @@ and
 Other system calls result in the delivery of a
 .BR SIGKILL
 signal.
-Secure computing mode is useful for number-crunching applications
+Strict secure computing mode is useful for number-crunching applications
 that may need to execute untrusted byte code,
 perhaps obtained by reading from a pipe or socket.
 This operation is only available
 if the kernel is configured with CONFIG_SECCOMP enabled.
+
+With
+.IR arg2
+set to
+.BR SECCOMP_MODE_FILTER " (since Linux 3.5)"
+the system calls allowed are
+defined by a pointer passed in
+.IR arg3
+to a Berkeley Packet Filter, which can be designed to filter
+arbitrary syscalls and syscall arguments.
+This mode is only available if the kernel is configured with
+CONFIG_SECCOMP_FILTER enabled.
+
 .TP
 .BR PR_GET_SECCOMP " (since Linux 2.6.23)"
 Return the secure computing mode of the calling thread.
-Not very useful for the current implementation (mode equals 1),
-but may be useful for other possible future modes:
-if the caller is not in secure computing mode, this operation returns 0;
-if the caller is in secure computing mode, then the
+If the caller is not in secure computing mode, this operation returns 0;
+if the caller is in strict secure computing mode, then the
 .BR prctl ()
 call will cause a
 .B SIGKILL
 signal to be sent to the process.
+If the caller is in filter mode, and this syscall is allowed by the
+seccomp filters, it returns 2.
 This operation is only available
 if the kernel is configured with CONFIG_SECCOMP enabled.
 .TP
-- 
1.7.9.5

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2012-06-05 18:12 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=20120605181209.GP29466@outflux.net \
    --to=keescook-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=wad-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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).