Re: forkbombing Linux distributions

Max Kellermann
2005-03-23T13:58:21Z

On 2005/03/22 12:49, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> What if the few procs that he may spawn also grab so much memory so
> your machine disappears in swap-t(h)rashing?

The number of processes is counted per user, but CPU time and memory
consumption is counted per process.

Going around RLIMIT_CPU is too easy by simply forkbombing. This
renders RLIMIT_CPU unusable.

The memory limits aren't good enough either: if you set them low
enough that memory-forkbombs are unperilous for
RLIMIT_NPROC*RLIMIT_DATA, it's probably too low for serious
applications.

Now what about per-user (or per-session) CPU and memory limits?

Another idea: RLIMIT_FORK (number of allowed fork() calls in that
session). While that may not be useful for interactive login sessions,
I can imagine several situations where it could help (like qmail child
processes).

Max