All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] coredump: fix pipe coredump when core limit is 0
@ 2011-08-21 11:25 bookjovi
  2011-08-21 15:25 ` Oleg Nesterov
  0 siblings, 1 reply; 22+ messages in thread
From: bookjovi @ 2011-08-21 11:25 UTC (permalink / raw)
  To: bookjovi; +Cc: oleg, dhowells, nhorman, roland, viro, akpm, linux-kernel

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


^ permalink raw reply related	[flat|nested] 22+ messages in thread
* Re: [PATCH] coredump: fix pipe coredump when core limit is 0
@ 2011-08-21 22:36 Neil Horman
  2011-08-22 13:23 ` Jovi Zhang
  2011-08-22 15:32 ` Pádraig Brady
  0 siblings, 2 replies; 22+ messages in thread
From: Neil Horman @ 2011-08-21 22:36 UTC (permalink / raw)
  To: Oleg Nesterov, bookjovi; +Cc: dhowells, roland, viro, akpm, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 752 bytes --]

Concur.  The comment should be changed
Neil

Oleg Nesterov <oleg@redhat.com> wrote:

>On 08/21, Oleg Nesterov wrote:
>>
>> On 08/21, bookjovi@gmail.com wrote:
>> >
>> > For non-pipe case, limit 0 also means drop the coredump, so just put
>> > the zero limit check at do_coredump function begining.
>>
>> Neil, what do you think? Should we change the code or the comment?
>
>Personally I think we should fix the comment. I think RLIMIT_CORE
>doesn't apply in this case, limit == 1 check is very special. And
>this is what linux always did, except between 725eae32 and 898b374a.
>
>
>Oleg.
>
>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-07-07 11:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 11:25 [PATCH] coredump: fix pipe coredump when core limit is 0 bookjovi
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.