summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-11-10 10:33:55 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-11-10 10:33:55 -0800
commiteccc876724927ff3b9ff91f36f7b6b159e948f0c (patch)
tree034dea9d11432421320e2ed0e5a2d36025cc808a /kernel
parente2f0c565ec70eb9e4d3b98deb5892af62de8b98d (diff)
parent77f6ab8b7768cf5e6bdd0e72499270a0671506ee (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull core dump fix from Al Viro: "Fix for multithreaded coredump playing fast and loose with getting registers of secondary threads; if a secondary gets caught in the middle of exit(2), the conditition it will be stopped in for dumper to examine might be unusual enough for things to go wrong. Quite a few architectures are fine with that, but some are not." * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: don't dump the threads that had been already exiting when zapped.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 87a2d515de0d..1f236ed375f8 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -454,7 +454,10 @@ static void exit_mm(void)
mmap_read_unlock(mm);
self.task = current;
- self.next = xchg(&core_state->dumper.next, &self);
+ if (self.task->flags & PF_SIGNALED)
+ self.next = xchg(&core_state->dumper.next, &self);
+ else
+ self.task = NULL;
/*
* Implies mb(), the result of xchg() must be visible
* to core_state->dumper.