Bug#505718: grep: Ridiculous memory usage

2008-11-17 Thread Laurent Fousse
reassign 505718 chkrootkit severity 505718 normal retitle 505718 Please limit grep output, can cause automatic DOS. thanks Hello, While checking e.g. for php based rootkit, the invocation of grep does not limit the amount of output returned, for example in: fileshead=`${find} ${ROOTDIR}tmp

Bug#505718: grep: Ridiculous memory usage

2008-11-15 Thread Laurent Fousse
Hello, * Nicolas François [Fri, Nov 14, 2008 at 08:45:57PM +0100]: grep is line-based, so I'm not really surprised it eats all the memory when it receives only zeroes. What other big file did you tested this on? A 2Gb swap file. It could be that the first newline in this file is far from

Bug#505718: grep: Ridiculous memory usage

2008-11-14 Thread Laurent Fousse
Package: grep Version: 2.5.1.ds2-6 Severity: important Hello, A grep for a simple pattern on a big file results in a similarly big memory consumption, rendering the machine unusable as it swaps as hell and/or a memory allocation failure occurs. E.g.: $ grep foo /dev/zero grep:

Bug#505718: grep: Ridiculous memory usage

2008-11-14 Thread Aioanei Rares
On Fri, Nov 14, 2008 at 5:41 PM, Laurent Fousse [EMAIL PROTECTED] wrote: Package: grep Version: 2.5.1.ds2-6 Severity: important Hello, A grep for a simple pattern on a big file results in a similarly big memory consumption, rendering the machine unusable as it swaps as hell and/or a

Bug#505718: grep: Ridiculous memory usage

2008-11-14 Thread Laurent Fousse
Hello, * Aioanei Rares [Fri, Nov 14, 2008 at 05:49:35PM +0200]: Maybe the kernel is at fault? The particular argument `/dev/zero/' I supplied to grep in my example is not necessary, if this is what you mean. I can reproduce it with any big file. Since /dev/zero is infinite in size, it will

Bug#505718: grep: Ridiculous memory usage

2008-11-14 Thread Nicolas François
On Fri, Nov 14, 2008 at 05:03:30PM +0100, Laurent Fousse wrote: Hello, * Aioanei Rares [Fri, Nov 14, 2008 at 05:49:35PM +0200]: Maybe the kernel is at fault? The particular argument `/dev/zero/' I supplied to grep in my example is not necessary, if this is what you mean. I can reproduce