author: Oleg Nesterov <oleg@redhat.com> 2013-04-30 15:28:10 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2013-04-30 17:04:06 -0700
commit: 403bad72b67d8b3f5a0240af5023adfa48132a65
parent: 66e5b7e1948cdbdca2b0cc6ddc6d69ee84583fb4
Commit Summary:
Diffstat:
1 file changed, 5 insertions, 8 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index d52f6bd5ad8e..f91cfd8cd5f2 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -280,8 +280,8 @@ static int zap_process(struct task_struct *start, int exit_code)
return nr;
}
-static inline int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
- struct core_state *core_state, int exit_code)
+static int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
+ struct core_state *core_state, int exit_code)
{
struct task_struct *g, *p;
unsigned long flags;
@@ -291,6 +291,9 @@ static inline int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
if (!signal_group_exit(tsk->signal)) {
mm->core_state = core_state;
nr = zap_process(tsk, exit_code);
+ /* ignore all signals except SIGKILL, see prepare_signal() */
+ tsk->signal->flags |= SIGNAL_GROUP_COREDUMP;
+ clear_tsk_thread_flag(tsk, TIF_SIGPENDING);
}
spin_unlock_irq(&tsk->sighand->siglock);
if (unlikely(nr < 0))
@@ -514,12 +517,6 @@ void do_coredump(siginfo_t *siginfo)
old_cred = override_creds(cred);
- /*
- * Clear any false indication of pending signals that might
- * be seen by the filesystem code called to write the core file.
- */
- clear_thread_flag(TIF_SIGPENDING);
-
ispipe = format_corename(&cn, &cprm);
if (ispipe) {