linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Kalvatchev <iive@yahoo.com>
To: kernelbug <linux-kernel@vger.kernel.org>
Subject: DoS tmpfs,ramfs, malloc, saga continues
Date: Tue, 14 Aug 2001 06:29:56 -0700 (PDT)	[thread overview]
Message-ID: <20010814132956.94720.qmail@web13608.mail.yahoo.com> (raw)

As Alan Cox pointed me, tmpfs bug is a VM bug. I was
able to reproduce the bug with a simple memory
"eating" program. (for the lazy ones copy-paste from
bottom).
As oom_kill.c says:
"...
*If we run out of memory, we have the choice between
either
 * killing a random task (bad), letting the system
crash (worse)
 * OR try to be smart about which process to kill.
Note that we
 * don't have to be perfect here, we just have to be
good.
 *
..."
Oh, how dumb. Now the system kills random tasks and
hangs with 50% probability. Just run the sample
program twice. Oh, system hangs while waiting for kill
(I wont wait for months). 
Good job for Alan Cox, with his patch i could run the
sample program 20 times before it crashed the system.
I cannot belive that instead of keeping this
masskiller for deathlocks, no way out situation, and
as last resort, You The Great Kernel Hackers use it
for every day and every body solution. Is it so hard
to make more memory checks for user level malloc?
Windows does. Every other OS does. Why linux doesn't? 
Fix it in the next kernel!

//-------------------eatmem.c-------------------
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
void *p;
	for(i=0;;i++)
	{
		p=malloc(4096);
		printf("malloc #%d (%p)\n",i,p);
		if(p==NULL) break;
	}
	printf("I can't free mem:)");
return 0;
}


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

             reply	other threads:[~2001-08-14 18:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-14 13:29 Ivan Kalvatchev [this message]
     [not found] <no.id>
2001-08-14 20:42 ` DoS tmpfs,ramfs, malloc, saga continues Alan Cox
2001-08-15 14:20   ` Szabolcs Szakacsits
2001-08-20 13:48     ` Andrey Savochkin

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=20010814132956.94720.qmail@web13608.mail.yahoo.com \
    --to=iive@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).