From: bookjovi@gmail.com
To: bookjovi@gmail.com
Cc: oleg@redhat.com, dhowells@redhat.com, nhorman@tuxdriver.com,
roland@redhat.com, viro@zeniv.linux.org.uk,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH] coredump: fix pipe coredump when core limit is 0
Date: Sun, 21 Aug 2011 07:25:04 -0400 [thread overview]
Message-ID: <1313925904-5935-1-git-send-email-bookjovi@gmail.com> (raw)
From: Jovi Zhang <bookjovi@gmail.com>
Regressing from 2.6.35
In pipe coredump case, normally core limits are irrelevant,
since we're not writing to the file system, but core limit 0
is a special value, kernel should skip the dump when limit is 0.
Note that most Linux distribution set default core file limit as 0,
because many user don't want to get core file even process crash,
wahtever pipe coredump pattern used or not.
This error intruduced by commit c71354 in 2.6.35, that commit put
core limit zero check into non-pipe code branch.
commit c713541125002b8bc9e681af3b09118e771e2d8a
Author: Oleg Nesterov <oleg@redhat.com>
Date: Wed May 26 14:43:05 2010 -0700
coredump: factor out the not-ispipe file checks
For non-pipe case, limit 0 also means drop the coredump, so just put
the zero limit check at do_coredump function begining.
Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
---
fs/exec.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index 25dcbe5..c33085d 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2119,6 +2119,10 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
if (!__get_dumpable(cprm.mm_flags))
goto fail;
+ /* Core limit as 0 should skip the dump */
+ if (cprm.limit == 0)
+ goto fail;
+
cred = prepare_creds();
if (!cred)
goto fail;
--
1.7.2.3
next reply other threads:[~2011-08-21 3:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-21 11:25 bookjovi [this message]
2011-08-21 15:25 ` Oleg Nesterov
2011-08-21 15:57 ` Oleg Nesterov
2011-08-21 22:36 Neil Horman
2011-08-22 13:23 ` Jovi Zhang
2011-08-22 13:27 ` Oleg Nesterov
2011-08-22 15:32 ` Pádraig Brady
2011-08-22 16:19 ` Oleg Nesterov
2011-08-24 10:14 ` Jovi Zhang
2011-08-24 10:17 ` Jovi Zhang
2011-08-24 11:01 ` Neil Horman
2011-08-25 10:03 ` Pádraig Brady
2011-08-25 10:55 ` Neil Horman
2011-08-26 9:15 ` Pádraig Brady
2011-08-25 15:57 ` Oleg Nesterov
2011-08-25 18:43 ` Neil Horman
2011-08-26 14:11 ` Oleg Nesterov
2011-08-26 15:39 ` Neil Horman
2011-08-26 9:09 ` Pádraig Brady
2011-08-26 14:10 ` Oleg Nesterov
2011-11-14 5:49 ` Jovi Zhang
2012-07-07 11:35 ` Jovi Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313925904-5935-1-git-send-email-bookjovi@gmail.com \
--to=bookjovi@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=oleg@redhat.com \
--cc=roland@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®