Subject: Re: Fork bomb protection patch
To: None <tech-kern@netbsd.org>
From: Lucio De Re <lucio@proxima.alt.za>
List: tech-kern
Date: 12/05/2002 11:24:32
On Thu, Dec 05, 2002 at 09:52:13AM +0100, Havard Eidnes wrote:
> 
> I've been exposed to more than one instance where the fork bomb was
> more of an accident ("novice learning experience") than an actual
> malicious attack.  It's harder to see how the above program could
> first become 2000 processes and then spin doing getpid() as an
> accident or misunderstanding.
> 

So a malicious "non-fork-bomb" reduces (off the cuff) to:

	for (;;) {
		switch (fork()) {
			case 0:
				for (;;)
					getpid ();
				break;
			case -1:
				sleep(1);
				break;
		}
	}

Does this get dealt with adequately by the proposed patch?

++L