lkml.org 
[lkml]   [1997]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Reserved PID's
On Thu, 24 Jul 1997, B. James Phillippe wrote:

> I've considered writing a simple PID reservation patch that would
> reserve a number of PID's (controlled on the fly by echo'ing an int to
> /proc/sys/kernel/reserved-pids) for root use only. It sounds easy enough
> to implement. If all non-reserved PID's are in use and a process attempts
> to be created under a UID >0, kernel would return EGAIN. This would allow
> only root-owned processes to fill the process table. In other cases, the
> superuser would be able to log in and fix the problem.

Isn't that already basically done via:

[kernel/fork.c]
static inline int find_empty_process(void)
{
int i;

if (nr_tasks >= NR_TASKS - MIN_TASKS_LEFT_FOR_ROOT) {
if (current->uid)
return -EAGAIN;
}

in include/linux/tasks.h MIN_TASKS_LEFT_FOR_ROOT defaults to 4, but I
generally raise it to 64. Ideally, this should stop anyone but root (or
root owned processes) from filling the process table...if you have enough
processes reserved for root.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Unsolicited commercial e-mail will
Network Administrator | be proof-read for $199/message.
Florida Digital Turnpike |
________Finger jlewis@inorganic5.fdt.net for PGP public key_______


\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.046 / U:6.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site