aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 21:08:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 21:08:50 -0500
commitb4642c109f9bbf62b2ee10babf5c4221c48480aa (patch)
treee62e8f6132377c687517ffddd79bbf7c6ffb9010
parenta27fcb0cd1bcc812017192bdde41cc456dcd6afe (diff)
parentd7276e321ff8a53106a59c85ca46d03e34288893 (diff)
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
-rw-r--r--kernel/seccomp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index f8f88ebcb3ba..e15185c28de5 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -643,11 +643,14 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
643 default: { 643 default: {
644 siginfo_t info; 644 siginfo_t info;
645 audit_seccomp(this_syscall, SIGSYS, action); 645 audit_seccomp(this_syscall, SIGSYS, action);
646 /* Show the original registers in the dump. */ 646 /* Dump core only if this is the last remaining thread. */
647 syscall_rollback(current, task_pt_regs(current)); 647 if (get_nr_threads(current) == 1) {
648 /* Trigger a manual coredump since do_exit skips it. */ 648 /* Show the original registers in the dump. */
649 seccomp_init_siginfo(&info, this_syscall, data); 649 syscall_rollback(current, task_pt_regs(current));
650 do_coredump(&info); 650 /* Trigger a manual coredump since do_exit skips it. */
651 seccomp_init_siginfo(&info, this_syscall, data);
652 do_coredump(&info);
653 }
651 do_exit(SIGSYS); 654 do_exit(SIGSYS);
652 } 655 }
653 } 656 }