lkml.org 
[lkml]   [2011]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] coredump: fix pipe coredump when core limit is 0
Date
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


\
 
 \ /
  Last update: 2011-08-21 05:27    [W:0.038 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site