]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/seccomp.c
scripts/spelling.txt: add "an user" pattern and fix typo instances
[karo-tx-linux.git] / kernel / seccomp.c
index f8f88ebcb3baa9d29c2607ff9024c43da43ab0be..e15185c28de5649fc20e6b7238430cd42205b11c 100644 (file)
@@ -643,11 +643,14 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
        default: {
                siginfo_t info;
                audit_seccomp(this_syscall, SIGSYS, action);
-               /* Show the original registers in the dump. */
-               syscall_rollback(current, task_pt_regs(current));
-               /* Trigger a manual coredump since do_exit skips it. */
-               seccomp_init_siginfo(&info, this_syscall, data);
-               do_coredump(&info);
+               /* Dump core only if this is the last remaining thread. */
+               if (get_nr_threads(current) == 1) {
+                       /* Show the original registers in the dump. */
+                       syscall_rollback(current, task_pt_regs(current));
+                       /* Trigger a manual coredump since do_exit skips it. */
+                       seccomp_init_siginfo(&info, this_syscall, data);
+                       do_coredump(&info);
+               }
                do_exit(SIGSYS);
        }
        }