Re: forkbombing Linux distributions

Grant Coady
2005-03-21T05:15:33Z

On Mon, 21 Mar 2005 14:27:55 +1100, Peter Chubb <peterc@gelato.unsw.edu.au> wrote:

>>>>>> "William" == William Beebe <wbeebe@gmail.com> writes:
>
>William> Sure enough, I created the following script and ran it as a
>William> non-root user:
>
>William> #!/bin/bash $0 & $0 &
>
>There are two approaches to fixing this.
> 1. Rate limit fork(). Unfortunately some legitimate usges do a lot
> of forking, and you don't really want to slow them down.
> 2. Limit (per user) the number of processes allowed. This is what's
> currently done; and if you as administrator want to you can set
> RLIMIT_NPROC in /etc/security/limits.conf
>
>On an almost-single-user system such as most desktops, there isn't much
>point in setting this. On shared systems, it can be useful.

Had to try it out of curiosity, five ssh logins at the time,
but I hit Ctrl-S on the terminal running forkbomb, then other
terminals responsive and I could recover, do 'killall forkbomb'.

Even 'top' segfaulted. Machine didn't die though.

slackware-current running 2.4.29-hf5

Just checked logs, messages: --> kernel: VFS: file-max limit 52427 reached
nothing in syslog or debug

Cheers,
Grant.