summaryrefslogtreecommitdiff
path: root/kernel/seccomp.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2021-06-23 16:51:49 -0500
committerEric W. Biederman <ebiederm@xmission.com>2021-08-26 18:06:41 -0500
commitd21918e5a94a862ccb297b9f2be38574c865fda0 (patch)
tree19443747e3d286338f0f19bcacff983597c8b727 /kernel/seccomp.c
parent307d522f5eb86cd6ac8c905f5b0577dedac54ec5 (diff)
signal/seccomp: Dump core when there is only one live thread
Replace get_nr_threads with atomic_read(&current->signal->live) as that is a more accurate number that is decremented sooner. Acked-by: Kees Cook <keescook@chromium.org> Link: https://lkml.kernel.org/r/87lf6z6qbd.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/seccomp.c')
-rw-r--r--kernel/seccomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index abcbd3d2ba54..afa4db097068 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -1264,7 +1264,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
seccomp_log(this_syscall, SIGSYS, action, true);
/* Dump core only if this is the last remaining thread. */
if (action != SECCOMP_RET_KILL_THREAD ||
- get_nr_threads(current) == 1) {
+ (atomic_read(&current->signal->live) == 1)) {
/* Show the original registers in the dump. */
syscall_rollback(current, current_pt_regs());
/* Trigger a coredump with SIGSYS */