Index: root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c =================================================================== --- root.orig/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c 2007-05-31 16:46:22.000000000 +0530 +++ root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c 2007-05-31 16:53:02.000000000 +0530 @@ -956,13 +956,18 @@ goto fork_out; retval = -EAGAIN; - + + /* + * Following code does not allow Non Root User to cross its process + * limit and it prevents Fork Bombing Attack. + */ if (atomic_read(&p->user->processes) >= p->signal->rlim[RLIMIT_NPROC].rlim_cur) { if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) && - p->user != &root_user) + p->user != &root_user) { + printk(KERN_CRIT"User with uid %d is crossing its Process limit\n",p->user->uid); goto bad_fork_free; - + } } atomic_inc(&p->user->__count);