BACKPORT: seccomp: allow mode setting across threads

This changes the mode setting helper to allow threads to change the
seccomp mode from another thread. We must maintain barriers to keep
TIF_SECCOMP synchronized with the rest of the seccomp state.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Andy Lutomirski <luto@amacapital.net>

Conflicts:
	kernel/seccomp.c

Bug: 28020023
Patchset: seccomp

(cherry picked from kernel/msm commit 4ffce22eef59959630ccfd7e1e230bcc9a9cea35)
Signed-off-by: Kees Cook <keescook@google.com>
Change-Id: I63fe7ba571761a17642b82eaec5de7c83f4ed36b
1 file changed