Science Fair Projects Ideas - Fork bomb

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Fork bomb

The fork bomb is a form of denial of service attack against a computer system that uses the fork function. It relies on the assumption that the number of programs and processes which may be simultaneously executed on a computer has a limit. A fork bomb works by creating a large number of processes very quickly in order to saturate the available space in the list of processes kept by the computer's operating system. Once saturated, no new programs may be started until another terminates, which is not likely since the instances of the bomb program are each waiting to do just that. The system becomes much more difficult (slow), or even impossible, to use.

Fork bombs can be considered as a special type of Wabbit (a program that self-replicates without using hosts or network functionality).

Canonical forkbombs include perl -e "fork while fork" (forking using the Perl interpreter) and :(){ :|:& };: (using the Bash shell).
Or in C:


#include <sys/types.h>
#include <unistd.h>
int main (int argc, char *argv[]) 
{ 
  while(1) 
  { 
    fork(); 
  } 
  return 0; 
} 

Difficulty of cure

Once a successful fork bomb has been activated in a system it may not be possible to resume normal operation without rebooting, as the only solution to a fork bomb is to destroy all instances of it. Trying to use a program to kill the rogue processes requires another process be created, which may not be possible if there are no empty slots in the process table, or space in memory structures.

Prevention

The way in which a fork bomb functions is to spawn as many processes as possible; thus, to prevent a fork bomb one simply needs to limit the number of processes which may be produced by a single program or user. By allowing untrusted users to run only a relatively small number of processes, the danger of a fork bomb, malicious or unintentional, is reduced. However, this does not prevent the possibility of a group of users collaborating to consume process slots.

One way to prevent it is to add limits on users and groups in PAM (Solaris, Linux, and FreeBSD), like this @users hard nproc 50.

See also a note at cookie monster.

10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice