Skip to content

Commit b4642c1

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull seccomp fix from James Morris: "A fix for a regression in the seccomp code (it was supposed to be in the first pull req but I had it queued in the wrong branch)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: seccomp: Only dump core when single-threaded
2 parents a27fcb0 + d7276e3 commit b4642c1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kernel/seccomp.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,14 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
643643
default: {
644644
siginfo_t info;
645645
audit_seccomp(this_syscall, SIGSYS, action);
646-
/* Show the original registers in the dump. */
647-
syscall_rollback(current, task_pt_regs(current));
648-
/* Trigger a manual coredump since do_exit skips it. */
649-
seccomp_init_siginfo(&info, this_syscall, data);
650-
do_coredump(&info);
646+
/* Dump core only if this is the last remaining thread. */
647+
if (get_nr_threads(current) == 1) {
648+
/* Show the original registers in the dump. */
649+
syscall_rollback(current, task_pt_regs(current));
650+
/* Trigger a manual coredump since do_exit skips it. */
651+
seccomp_init_siginfo(&info, this_syscall, data);
652+
do_coredump(&info);
653+
}
651654
do_exit(SIGSYS);
652655
}
653656
}

0 commit comments

Comments
 (0)