From: Kees Cook <keescook@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>,
Oleg Nesterov <oleg@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
Alexei Starovoitov <ast@plumgrid.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Daniel Borkmann <dborkman@redhat.com>,
Will Drewry <wad@chromium.org>, Julien Tinnes <jln@chromium.org>,
David Drysdale <drysdale@google.com>,
linux-api@vger.kernel.org, x86@kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org,
linux-arch@vger.kernel.org,
linux-security-module@vger.kernel.org
Subject: [PATCH v10 0/11] seccomp: add thread sync ability
Date: Thu, 10 Jul 2014 11:40:20 -0700 [thread overview]
Message-ID: <1405017631-27346-1-git-send-email-keescook@chromium.org> (raw)
This adds the ability for threads to request seccomp filter
synchronization across their thread group (at filter attach time).
For example, for Chrome to make sure graphic driver threads are fully
confined after seccomp filters have been attached.
To support this, locking on seccomp changes via thread-group-shared
sighand lock is introduced, along with refactoring of no_new_privs. Races
with thread creation are handled via delayed duplication of the seccomp
task struct field and cred_guard_mutex.
This includes a new syscall (instead of adding a new prctl option),
as suggested by Andy Lutomirski and Michael Kerrisk.
Thanks!
-Kees
v10:
- dropped pending-kill checks (oleg)
- tweaked memory barriers (oleg)
v9:
- rearranged/split patches to make things more reviewable
- added use of cred_guard_mutex to solve exec race (oleg, luto)
- added barriers for TIF_SECCOMP vs seccomp.mode race (oleg, luto)
- fixed missed copying of nnp state after v8 refactor (oleg)
v8:
- drop use of tasklist_lock, appears redundant against sighand (oleg)
- reduced use of smp_load_acquire to logical minimum (oleg)
- change nnp to a task struct held atomic flags field (oleg, luto)
- drop needless irqflags changes in fork.c for holding sighand lock (oleg)
- cleaned up use of thread for-each loop (oleg)
- rearranged patch order to keep syscall changes adjacent
- added example code to manpage (mtk)
v7:
- rebase on Linus's tree (merged with network bpf changes)
- wrote manpage text documenting API (follows this series)
v6:
- switch from seccomp-specific lock to thread-group lock to gain atomicity
- implement seccomp syscall across all architectures with seccomp filter
- clean up sparse warnings around locking
v5:
- move includes around (drysdale)
- drop set_nnp return value (luto)
- use smp_load_acquire/store_release (luto)
- merge nnp changes to seccomp always, fewer ifdef (luto)
v4:
- cleaned up locking further, as noticed by David Drysdale
v3:
- added SECCOMP_EXT_ACT_FILTER for new filter install options
v2:
- reworked to avoid clone races
next reply other threads:[~2014-07-10 18:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 18:40 Kees Cook [this message]
2014-07-10 18:40 ` [PATCH v10 01/11] seccomp: create internal mode-setting function Kees Cook
2014-07-10 18:40 ` [PATCH v10 02/11] seccomp: extract check/assign mode helpers Kees Cook
2014-07-10 18:40 ` [PATCH v10 03/11] seccomp: split mode setting routines Kees Cook
2014-07-10 18:40 ` [PATCH v10 04/11] seccomp: add "seccomp" syscall Kees Cook
2014-07-10 18:40 ` [PATCH v10 05/11] ARM: add seccomp syscall Kees Cook
2014-07-10 18:40 ` [PATCH v10 06/11] MIPS: " Kees Cook
2014-07-10 18:40 ` [PATCH v10 07/11] sched: move no_new_privs into new atomic flags Kees Cook
2014-07-10 18:40 ` [PATCH v10 08/11] seccomp: split filter prep from check and apply Kees Cook
2014-07-10 18:40 ` [PATCH v10 09/11] seccomp: introduce writer locking Kees Cook
2014-07-10 18:40 ` [PATCH v10 10/11] seccomp: allow mode setting across threads Kees Cook
2014-07-10 18:40 ` [PATCH v10 11/11] seccomp: implement SECCOMP_FILTER_FLAG_TSYNC Kees Cook
2014-07-11 16:49 ` [PATCH v10 0/11] seccomp: add thread sync ability Oleg Nesterov
2014-07-11 17:55 ` Kees Cook
[not found] ` <CAGXu5jK-x0=Rr7kX2a=b4Z8ueA77uwmhNZZAayG8cwmNOKa8Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-14 18:59 ` Kees Cook
2014-07-15 1:53 ` James Morris
[not found] ` <53C48986.5010109-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-07-17 21:39 ` Andy Lutomirski
2014-07-14 19:04 ` Andy Lutomirski
[not found] ` <CALCETrVXgA9a2f7VwnCYW4_XB+JAPRSR8xsuH_ZYbA82=ZozRw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-14 20:34 ` Kees Cook
2014-07-16 17:54 ` Kees Cook
2014-07-16 19:45 ` Andy Lutomirski
2014-07-16 21:23 ` Kees Cook
2014-07-16 21:27 ` Andy Lutomirski
2014-07-16 16:44 ` James Morris
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=1405017631-27346-1-git-send-email-keescook@chromium.org \
--to=keescook@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=ast@plumgrid.com \
--cc=dborkman@redhat.com \
--cc=drysdale@google.com \
--cc=jln@chromium.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-security-module@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
--cc=oleg@redhat.com \
--cc=wad@chromium.org \
--cc=x86@kernel.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).