From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935188Ab3BOAIJ (ORCPT ); Thu, 14 Feb 2013 19:08:09 -0500 Received: from mail-gh0-f202.google.com ([209.85.160.202]:40619 "EHLO mail-gh0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759753Ab3BOAIH (ORCPT ); Thu, 14 Feb 2013 19:08:07 -0500 From: Mandeep Singh Baines To: linux-kernel@vger.kernel.org Cc: Ben Chan , Mandeep Singh Baines , Oleg Nesterov , Tejun Heo , Andrew Morton , "Rafael J. Wysocki" , Ingo Molnar Subject: [PATCH 5/5] coredump: abort core dump piping only due to a fatal signal Date: Thu, 14 Feb 2013 15:38:16 -0800 Message-Id: <1360885096-21207-5-git-send-email-msb@chromium.org> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360885096-21207-1-git-send-email-msb@chromium.org> References: <1360885096-21207-1-git-send-email-msb@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Chan This patch makes wait_for_dump_helpers() not to abort piping the core dump data when the crashing process has received any but a fatal signal (SIGKILL). The rationale is that a crashing process may still receive uninteresting signals such as SIGCHLD when its core dump data is being redirected to a helper application. While it's necessary to allow terminating the core dump piping via SIGKILL, it's practically more useful for the purpose of debugging and crash reporting if the core dump piping is not aborted due to other non-fatal signals. Signed-off-by: Ben Chan Signed-off-by: Mandeep Singh Baines CC: Oleg Nesterov CC: Tejun Heo CC: Andrew Morton CC: Rafael J. Wysocki CC: Ingo Molnar --- fs/coredump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/coredump.c b/fs/coredump.c index 1774932..54e31a3 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -417,10 +418,13 @@ static void wait_for_dump_helpers(struct file *file) pipe->readers++; pipe->writers--; - while ((pipe->readers > 1) && (!signal_pending(current))) { + while ((pipe->readers > 1) && (!fatal_signal_pending(current))) { wake_up_interruptible_sync(&pipe->wait); kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); pipe_wait(pipe); + pipe_unlock(pipe); + try_to_freeze(); + pipe_lock(pipe); } pipe->readers--; -- 1.8.1