seccomp: Invalidate seccomp mode to catch death failures
authorKees Cook <keescook@chromium.org>
Tue, 8 Feb 2022 04:21:13 +0000 (20:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:38 +0000 (12:56 +0100)
commitf7a56fcca2e45917ea40ac2e864bf4e9fb2a51e4
treeb0fa932b5730d21dccdc0513be8a8feddfb55f89
parent956cf21cd1ae1de63dd5850e2e287641cb4cc34a
seccomp: Invalidate seccomp mode to catch death failures

commit 495ac3069a6235bfdf516812a2a9b256671bbdf9 upstream.

If seccomp tries to kill a process, it should never see that process
again. To enforce this proactively, switch the mode to something
impossible. If encountered: WARN, reject all syscalls, and attempt to
kill the process again even harder.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Fixes: 8112c4f140fa ("seccomp: remove 2-phase API")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/seccomp.c