Files
twx-linux/kernel
Jann Horn 4f96b94a83 ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE
commit ee1fee9005 upstream.

Setting PTRACE_O_SUSPEND_SECCOMP is supposed to be a highly privileged
operation because it allows the tracee to completely bypass all seccomp
filters on kernels with CONFIG_CHECKPOINT_RESTORE=y. It is only supposed to
be settable by a process with global CAP_SYS_ADMIN, and only if that
process is not subject to any seccomp filters at all.

However, while these permission checks were done on the PTRACE_SETOPTIONS
path, they were missing on the PTRACE_SEIZE path, which also sets
user-specified ptrace flags.

Move the permissions checks out into a helper function and let both
ptrace_attach() and ptrace_setoptions() call it.

Cc: stable@kernel.org
Fixes: 13c4a90119 ("seccomp: add ptrace options for suspend/resume")
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://lkml.kernel.org/r/20220319010838.1386861-1-jannh@google.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:06:28 +02:00
..
2020-09-23 08:46:14 +02:00
2021-12-14 10:04:48 +01:00
…
…
2019-11-28 18:28:55 +01:00
…
…
…
…
…
…
…
…
2018-08-03 07:55:12 +02:00
…
…
2021-02-10 09:09:25 +01:00
2020-04-02 17:20:26 +02:00
…
…
…
…
…
…
2018-08-03 07:55:24 +02:00
…
2020-01-12 11:24:12 +01:00
…
…
…
…
…
…