lkml.org 
[lkml]   [2005]   [Mar]   [21]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 21 Mar 2005 08:41:24 +0100 (MET)
FromJan Engelhardt <>
SubjectRe: forkbombing Linux distributions
>>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()
>>  2.  Limit (per user) the number of processes allowed>>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'.
By the time you killed a handful of procs, the other half spawned new ones.

You can try stopping forkbombs by "killall -STOP nameofprog" and then 
"killall -9 nameofprog".

But you probably won't get to run killall in case of a thrasher running within 
the limits of `ulimit -m` and `ulimit -u`:
  perl -e 'fork,$_="x"x 10E6 while 1'


Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:11    [from the cache]
©2003-2008