___ some stability proposal

Yuri Kuzmenko (yuri@killer.cracksoft.kiev.ua)
Sun, 21 Dec 97 22:05:22 +0200


I have the small proposal for Linux-IPC. The fact is that I have try to create
the _stable_ system for "bad" users. ulimit (for limit the memory size and cpu
time) is good, but not works for IPC shared memory allocating (shmget()). In
result, programm below allocates 100mb of memory, and system can't work
further. I offer to make ulimit-like routines for shared-memory or simple
register procfs elements like as /etc/hosts.allow and /etc/hosts.deny (for
this, there is lists of allowed/disabled uids for shmget syscall).

Also I have small question about RLIMIT_CPU. I want to limit CPU-load for the
given user. But RLIMIT_CPU limit only *time* in seconds. Maybe needed to make
addition to sheduler for limit the summary of all realtime/cputime for given
user?

/* ipcsuck.c */

#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>

void main()
{
int i; char *p;
for(i=0;i<100;i++)
{
p=shmat(shmget(0,1024*1024,IPC_CREAT|IPC_PRIVATE|0666),NULL,0);
memset(p,0,1024*1024);
}
}