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-06-05 19:16:28.000000000 +0530 +++ root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c 2007-06-05 19:18:07.000000000 +0530 @@ -958,11 +958,18 @@ retval = -EAGAIN; + /* + * following code does not allow Non Root User to cross its process + * limit. it alerts administrator about fork bombing attack and prevents + * it. + */ 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) { + if (printk_ratelimit()) + 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);