lkml.org 
[lkml]   [2000]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] no RLIMIT_NPROC for root, please
Hi!

> > On Tue, 28 Nov 2000, Jan Rekorajski wrote:
> > > --- 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))
> >
> > Jan,
> >
> > Hardcoding things signifying special treatment of uid=0 is almost always a
> > bad idea. If you _really_ think that superuser (whatever entity that might
> > be) should be exempt from RLIMIT_NPROC and can prove that (SuSv2 seems to
> > be silent so you may be right), then you should use capable() to do proper
> > capability test and not that horrible explicit uid test as in your patch
> > above.
>
> Ok, how about setting limits on login? When this looks like:
>
> --- uid = 0 here
> setrlimit(RLIMIT_NPROC, n)
> fork() <- this will fail if root has >n processes
> setuid(user)
>
> and it is hard to change this sequence, all PAM enabled apps depend
> on it :(

So PAM dictates kernel changes? Fix pam, do not break kernel.
Pavel
--
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
-
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/

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