Re: forkbombing Linux distributions

Max Kellermann
2005-03-23T14:57:49Z

On 2005/03/23 15:44, Natanael Copa <mlists@tanael.org> wrote:
> Yes, but if
> RLIMIT_NPROC is per user and RLIMIT_CPU is per proc
>
> the theoretical CPU limit per user is RLIMIT_NPROC * RLIMIT_CPU. So if
> you half the RLIMIT_NPROC you will half the theoretical maximum CPU
> limit per user.
>
> Same with memory.

It's even worse with RLIMIT_CPU. Imagine a process forks
RLIMIT_NPROC-1 child processes. These consume all their CPU time, get
killed with SIGXCPU, and the parent process spawns new child processes
again with fresh RLIMIT_CPU counters (the parent process idled
meanwhile, consuming none of its assigned CPU cycles). Again and
again.

You see, RLIMIT_CPU is worthless in its current implementation.

Max