[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1313925904-5935-1-git-send-email-bookjovi@gmail.com>
Date: Sun, 21 Aug 2011 07:25:04 -0400
From: bookjovi@...il.com
To: bookjovi@...il.com
Cc: oleg@...hat.com, dhowells@...hat.com, nhorman@...driver.com,
roland@...hat.com, viro@...iv.linux.org.uk,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH] coredump: fix pipe coredump when core limit is 0
From: Jovi Zhang <bookjovi@...il.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@...hat.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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists