UN*X systems are commonly known for their stability, reliability and robustness. However, you can make these systems unusable by running the following program. Here’s the pseudocode:
while true fork
Fork is a system call in UN*X to copy the running process. If the above code is run in one process, it will become two, then four, then eight, then sixteen, growing exponentially then your system will become unresponsive because too many processes issue system calls which run in the kernel at the same time.
If the system allows users to run their own programs, there are few ways to prevent the DoS (denial-of-service) attack from happening. Replacing the fork() in the C library is not enough, malicious users can directly write assemblies to issue system call interrupts to fork. The only feasible way is to limit the process count for a user.