Posted May 31, 2011 13:15 UTC (Tue) by mehuljv (guest, #52868)
Parent article: Fighting fork bombs
I don't know whether i understood the solution correctly or not. I have below doubt,
How this patch handles below scenario,
Consider history cleanup time is 30 seconds.
Process A starts and forks 9 children. Lets refer all these new children as GROUP-B. Now, Process A exits so that init becomes parent of all GROUP-B processes.
Now, consider if all GROUP-B processes wait for 1 minute so that history of their original parent - PROCESS-A gets cleared. After 1 minute each GROUP-B process does fork of 9 children. So in total GROUP-B will spawn 81 processes. Lets refer these 81 processes as GROUP-C.
Now if all processes in GROUP-B exits, init will become parent of all processes in GROUP-C. Again all GROUP-C processes will wait for 1 minute so that history of all GROUP-B processes gets cleared.. and fork again...
If above iterations continue then after a while there will be many processes waiting/forking/exiting to avoid oom and system is still under fork attack.
Can any one explain me what happens in above scenario ?