Commit Graph

71 Commits

Author SHA1 Message Date
Jann Horn bec56ee2bb seccomp.2: Add note about alarm(2) not being sufficient to limit runtime
On Wed, Mar 11, 2015 at 10:43:50PM +0100, Mikael Pettersson wrote:
> Jann Horn writes:
>  > Or should I throw this patch away and write a patch
>  > for the prctl() manpage instead that documents that
>  > being able to call sigreturn() implies being able to
>  > effectively call sigprocmask(), at least on some
>  > architectures like X86?
>
> Well, that is the semantics of sigreturn().  It is essentially
> setcontext() [which includes the actions of sigprocmask()], but
> with restrictions on parameter placement (at least on x86).
>
> You could introduce some setting to restrict that aspect for
> seccomp processes, but you can't change this for normal processes
> without breaking things.

Then I think it's probably better and easier to just document the
existing behavior? If a new setting would have to be introduced
and developers would need to be aware of that, it's probably
easier to just tell everyone to use SIGKILL.

Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Mikael Pettersson <mikpelinux@gmail.com>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 20:25:03 +01:00
Michael Kerrisk aea38298b3 seccomp.2: Add mention of libseccomp
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-15 09:51:44 +01:00
Michael Kerrisk 71bb61ecf6 seccomp.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-10 10:47:22 +01:00
Kees Cook 3b4a59c4b5 ptrace.2, sigaction.2, seccomp.2: Ptrace and siginfo details
While writing some additional seccomp tests, I realized
PTRACE_EVENT_SECCOMP wasn't documented yet. Fixed this, and added
additional notes related to ptrace events SIGTRAP details.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-18 12:04:32 +01:00
Michael Kerrisk dff539545a seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-16 07:55:21 +01:00
Michael Kerrisk 1ac80024c9 perf_event_open.2, seccomp.2, setns.2, shmget.2, memchr.3, pthread_tryjoin_np.3, strstr.3, random.4, epoll.7, netlink.7, pid_namespaces.7, tcp.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 16:05:01 +01:00
Michael Kerrisk 5ac5e03b0d seccomp.2: srcfix: Remove a FIXME
Quoting Daniel's response to my FIXME

> Still hoping to hear from Will Drewy regarding this FIXME in the
> page source:
>
> .\" FIXME What is the significance of the line
> .\"           ftest->code = BPF_LDX | BPF_W | BPF_ABS;
> .\"       in kernel/seccomp.c::seccomp_check_filter()?

This came in from our rework via commit bd4cf0ed331a ("net: filter:
rework/optimize internal BPF interpreter's instruction set"), and
is kernel-internal only, and unused in classic BPF. It translates
into A = *(u32 *) (ctx + K) and will basically load an offset from
the populated seccomp_data (= ctx) to A. For the man-page itself
it has therefore no relevance, hope that clarifies it.

Reviewed-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk a79566fba6 seccomp.2: wfix
Revert a wording change, as suggested by Kees Cook.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 1367a60afb seccomp.2: A process's seccomp mode is viewable via /proc/PID/status "Seccomp"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 068653012c seccomp.2: Changes after review feedback by Kees Cook
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 36931cfc80 seccomp.2: srcfx: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk ef05ec712f seccomp.2: Minor fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 699996321d seccomp.2: Tweak an argument name
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 6426723630 seccomp.2: EXAMPLE: Expand comments in the BPF program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 86ae10e3bd seccomp.2: Rename arguments inside example program
Rename the arguments to install_filter() to improve readability
a little and to remove a little ambiguity. In particular, rename
'arch' to 't_arch' so that it does not get confused with the
seccomp_data field of the same name.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk cecc8c48ba seccomp.2: Add subsection on seccomp-specific BPF details
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 93b9a9eeff seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 882cf566d8 seccomp.2: ERRORS: add an EINVAL case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 043ed1c6d3 seccomp.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 0c2e01b788 seccomp.2: Rework discussion of 'seccomp_data' buffer
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk e28e21fea0 seccomp.2: SEE ALSO: add Documentation/prctl/seccomp_filter.txt
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk f74fd424c1 seccomp.2: Add reference to original Usenix BPF paper
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 65a1328c75 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 5b95c4aba5 seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk a0a0c98bdc seccomp.2: Mention <linux/audit.h>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 43b265ff16 seccomp.2: wfix for EFAULT error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 0e27eb0cd4 seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 3edfdb10b2 seccomp.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 30d8060bd7 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:10 +01:00
Michael Kerrisk 76db415686 seccomp.2: Minor tweak to wording of ENOSYS error 2015-01-10 09:38:09 +01:00
Michael Kerrisk cf690e13ff seccomp.2: Rework discussion of 'siginfo_t' fields
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 41bf4e32e0 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk db99c0648c seccomp.2: Add reference to sigaction(2) under SECCOMP_RET_TRAP discussion
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 1da13d158d seccomp.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk ce67ca2364 seccomp.2: Minor tweak to ENOMEM error text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 29efefece6 seccomp.2: Add some ERRORS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 5c8dd0e971 seccomp.2: Add a comment to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 610082d992 seccomp.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 880bc4eb2d seccomp.2: Clarify thread ID returned on SECCOMP_FILTER_FLAG_TSYNC failure
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk cbffd6ae44 seccomp.2: Fixes after review comments from Kees Cook
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk b8ffefd766 seccomp.2: Clarifications from Andy Lutomirski
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 87aa1b2cd8 seccomp.2: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 1268c887a7 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 4c43ddd29b seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 886a865181 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk d4438093f3 seccomp.2: srcfix: add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 35e4506b05 seccomp.2: Add sample runs for example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 5e97e9b10c seccomp.2: Tweaks to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 0a1b868c77 seccomp.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00
Michael Kerrisk 5b84640229 seccomp.2: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-01-10 09:38:09 +01:00