fork bomb no respects limits in freebsd 7.0, freebsd is buged ?

Java Nunes javanunes at gmail.com
Thu Dec 11 08:50:45 PST 2008


Hi,
#>cat /boot/loader.conf
kern.maxfiles="3000"
kern.maxproc="666" <<<<<<<<<---------


root at bbb9 #>limits
Resource limits (current):
  cputime          infinity secs
  filesize          5242880 kB
  datasize          5242880 kB
  stacksize          524288 kB
  coredumpsize      1022976 kB
  memoryuse         1024000 kB
  memorylocked       683008 kB
  maxprocesses          599 <<<<<<<<<<-
  openfiles             677
  sbsize           infinity bytes
  vmemoryuse         693248 kB


in /etc/login.conf
:nologin=/var/run/nologin:\
        :cputime=unlimited:\
        :datasize=5G:\
        :stacksize=667M:\
        :memorylocked=667M:\
        :memoryuse=1000M:\
        :filesize=5G:\
        :coredumpsize=999M:\
        :openfiles=677:\
        :maxproc=666:\ <<<<<<<<<<-
        :sbsize=unlimited:\
        :vmemoryuse=677M:\
        :priority=0:\
        :idletime=2m\
        :ignoretime@:\
        :umask=022:

su - bozo

vi bomb.c
#include <unistd.h>

int main(int argc, char* argv[])
{
  while(1)
    fork();
  return 0;
}
~ gcc bomb.c -o bomb
~./bomb
and my freebsd box shutdown with this error:

maxproc limit exceeded by uid 1001, please see tuning(7) and login.conf(5).
maxproc limit exceeded by uid 1001, please see tuning(7) and login.conf(5).
maxproc limit exceeded by uid 1001, please see tuning(7) and login.conf(5).
maxproc limit exceeded by uid 1001, please see tuning(7) and login.conf(5).
panic: get_pv_entry : increase vm.pmap.shgperproc
cpuid =0
uptime 19m
physical memory: 1024MB
Dumping 923 blah blah blha!
Automatic reboot in 15 secounds = press blah blha blha lol!

fBSD gives memory in spite of all limits. Is there any limit, which can stop
adding memory for that forks ?
limit it does not function in bsd?

:0


More information about the freebsd-bugs mailing list