Skip to content

Commit d21918e

Browse files
committed
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 <[email protected]> Link: https://lkml.kernel.org/r/87lf6z6qbd.fsf_-_@disp2133 Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent 307d522 commit d21918e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/seccomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
12641264
seccomp_log(this_syscall, SIGSYS, action, true);
12651265
/* Dump core only if this is the last remaining thread. */
12661266
if (action != SECCOMP_RET_KILL_THREAD ||
1267-
get_nr_threads(current) == 1) {
1267+
(atomic_read(&current->signal->live) == 1)) {
12681268
/* Show the original registers in the dump. */
12691269
syscall_rollback(current, current_pt_regs());
12701270
/* Trigger a coredump with SIGSYS */

0 commit comments

Comments
 (0)