OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Not executing code
From: Kevin Breit (battery841USERS.SOURCEFORGE.NET)
Date: Fri Dec 29 2000 - 14:26:41 CST


Greetings,
    My friend last night was askinga bout how to stop people from running a
program that does a fork bomb. The code looks like this:

#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

using namespace std;

int main()
{
        while(1<2){
                int pid=fork();
                int i=3^100;
        }
        return 0;
}

My question is, how can we stop users from running this program. I told him
to make /tmp and /home noexec,nosuid and I feel that _does_ go a long way.
However, I am curious about other ways of preventing this. Does Linux or
other Unix systems have a way to create a ceiling of how many times an app
can fork itself? What other precautions can he take to make sure that this
code, and other malicious code doesn't get executed?
Thanks a lot
Kevin Breit

--
"Curiously enough, the dolphins had long known of the impending destruction
of the planet Earth and had made many attempts to alert mankind to the danger;
but most of their communications were misinterpreted as amusing attempts to
punch footballs..." - Hitchiker's Guide to the Galaxy