I think it's necessary to reserve some pids to the super user.
5 must be sufficient.
Signed-off-by: Gustavo Chain <g@0xff.cl>
---
kernel/fork.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 33f12f4..db23cb3 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1367,11 +1367,17 @@ long do_fork(unsigned long clone_flags,
int __user *parent_tidptr,
int __user *child_tidptr)
{
+#define RESERVED_PIDS 5
+
struct task_struct *p;
int trace = 0;
struct pid *pid = alloc_pid();
long nr;
+ if (!capable(CAP_SYS_ADMIN) && nr_threads >= max_threads
- RESERVED_PIDS) {
+ return -EAGAIN;
+ }
+
if (!pid)
return -EAGAIN;
nr = pid->nr;
--
Gustavo Chaín Dumit
-
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Hiten Pandya | Re: up? (emacs docbook xml ide) |
| Martin Michlmayr | Network slowdown due to CFS |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Yaroslav Tarasenko | Re: PC-BSD |
| Ben Cadieux | DragonFly MBR |
| justin | Re: dragonfly pdf documentation |
| dark0s Optik | DragonFly over Sony Vaio |
