public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] no RLIMIT_NPROC for root, please
@ 2000-11-28 20:43 Jan Rekorajski
  2000-11-28 20:52 ` Tigran Aivazian
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jan Rekorajski @ 2000-11-28 20:43 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel


Why is RLIMIT_NPROC apllied to root(uid 0) processes? It's not kernel job to
prevent admin from shooting him/her self in the foot.

root should be able to do fork() regardless of any limits,
and IMHO the following patch is the right thing.


--- linux/kernel/fork.c~	Tue Sep  5 23:48:59 2000
+++ linux/kernel/fork.c	Sun Nov 26 20:22:20 2000
@@ -560,7 +560,8 @@
 	*p = *current;
 
 	retval = -EAGAIN;
-	if (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur)
+	if (p->user->uid &&
+	   (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur))
 		goto bad_fork_free;
 	atomic_inc(&p->user->__count);
 	atomic_inc(&p->user->processes);

Jan
-- 
Jan Rękorajski            |  ALL SUSPECTS ARE GUILTY. PERIOD!
baggins<at>mimuw.edu.pl   |  OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY?
BOFH, type MANIAC         |                   -- TROOPS by Kevin Rubio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2000-11-30 22:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-28 20:43 [PATCH] no RLIMIT_NPROC for root, please Jan Rekorajski
2000-11-28 20:52 ` Tigran Aivazian
2000-11-28 20:58   ` Tigran Aivazian
2000-11-28 21:11   ` Jan Rekorajski
2000-11-30  0:00     ` Pavel Machek
2000-11-30 21:24       ` Jan Rekorajski
2000-11-30 21:57       ` Tigran Aivazian
2000-11-28 21:08 ` Andreas Dilger
2000-11-28 21:11 ` Andreas Schwab
2000-11-28 21:20   ` Jan Rekorajski
2000-11-28 21:58     ` Alan Cox
2000-11-28 22:13       ` Frank v Waveren
2000-11-28 23:23         ` Miquel van Smoorenburg
2000-11-28 21:54 ` Alan Cox
2000-11-29  0:34   ` Jan Rekorajski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox