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 <>
Reviewed-by: Oleg Nesterov <>
Reviewed-by: Andy Lutomirski <>


Bug: 28020023
Patchset: seccomp

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