Re: fork() DoS?

Peter Wächtler (pwaechtler@loewe-komp.de)
Fri, 22 Mar 2002 16:25:41 +0100


Little, John wrote:

> I'm really not a programmer, just learning, but was able to bring the system
> to it's knees. This is a redhat 7.2 kernel. Is there anyway of preventing
> this?
>
> #include <unistd.h>
>
> void do_fork()
> {
> pid_t p;
>
> p = fork();
> do_fork();
> }
>
> void main()
> {
> for(;;)
> do_fork();
> }
>

in bash: help ulimit
ulimit: ulimit [-SHacdflmnpstuv] [limit]
Ulimit provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
option is given, it is interpreted as follows:

-S use the `soft' resource limit
-H use the `hard' resource limit
-a all current limits are reported
-c the maximum size of core files created
-d the maximum size of a process's data segment
-f the maximum size of files created by the shell
-l the maximum size a process may lock into memory
-m the maximum resident set size
-n the maximum number of open file descriptors
-p the pipe buffer size
-s the maximum stack size
-t the maximum amount of cpu time in seconds
-u the maximum number of user processes

-
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/