mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Rekorajski <baggins@sith.mimuw.edu.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] no RLIMIT_NPROC for root, please
Date: Thu, 30 Nov 2000 22:24:22 +0100	[thread overview]
Message-ID: <20001130222422.E2605@sith.mimuw.edu.pl> (raw)
In-Reply-To: <20001128214309.F2680@sith.mimuw.edu.pl> <Pine.LNX.4.21.0011282049470.1940-100000@penguin.homenet> <20001128221155.G2680@sith.mimuw.edu.pl> <20001130010057.B124@bug.ucw.cz>
In-Reply-To: <20001130010057.B124@bug.ucw.cz>; from pavel@suse.cz on Thu, Nov 30, 2000 at 01:00:57AM +0100

On Thu, 30 Nov 2000, Pavel Machek wrote:

> 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.

Fixed :)

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/

  reply	other threads:[~2000-11-30 21:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-28 20:43 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001130222422.E2605@sith.mimuw.edu.pl \
    --to=baggins@sith.mimuw.edu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®