mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Al Boldi <a1426z@gawab.com>
Cc: LKML Kernel <linux-kernel@vger.kernel.org>,
	g@0xff.cl, Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Subject: Re: [PATCH] Reserve N process to root
Date: Thu, 11 Oct 2007 22:42:57 -0400	[thread overview]
Message-ID: <46B8DC5E-CD66-40B3-BF82-05259F9D7288@mac.com> (raw)
In-Reply-To: <200710120002.37341.a1426z@gawab.com>

Please don't trim CC lists

On Oct 11, 2007, at 17:02:37, Al Boldi wrote:
> David Newall wrote:
>> Valdis.Kletnieks@vt.edu wrote:
>>> What David meant was that "root will always have a slot" doesn't  
>>> *actually* help unless you *also* have a way to actually *spawn*  
>>> such a process.  In order to do the ps, kill, and so on that you  
>>> need to recover, you need to already have either a root shell  
>>> available, or a way to *get* a root shell that doesn't rely on a  
>>> non-root process (so /bin/su doesn't help here).
>>
>> That's right, although it's worse than that.  You need to have a  
>> process with CAP_SYS_ADMIN.  If root processes normally have that  
>> capability then the reserved slots may well disappear before you  
>> notice a problem.  If root processes normally don't have it, then  
>> you need to guarantee that one is already running.
>
> I once posted a patch to handle this DoS, but, as usual, it wasn't  
> accepted.  Go figure...

This isn't really necessary any more with the new CFS scheduler.  If  
you want to prevent excess memory usage then you limit memory usage,  
not process count, so just set the system max process count to  
something absurdly high and leave the user counts down at the maximum  
a user might run.  Then as long as the sum of the user processes is  
less than the max number of processes (which you just set absurdly  
high or unlimited), you may still log in.  With the per-user  
scheduling enabled CFS allows you to run an optimistically-real-time  
game as one user and several thousand busy-loops as another user and  
get almost picture perfect 50% CPU distribution between the users.   
To me that seems a much better DoS-prevention system than limits  
which don't scale based on how many people are requesting resources.

Cheers,
Kyle Moffett


  reply	other threads:[~2007-10-12  2:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 21:02 Al Boldi
2007-10-12  2:42 ` Kyle Moffett [this message]
2007-10-12  5:37   ` Al Boldi
2007-10-12  5:49     ` Kyle Moffett
2007-10-12  6:29       ` Al Boldi
2007-10-13  1:34         ` Gustavo Chain
2007-10-13  5:01           ` Al Boldi
  -- strict thread matches above, loose matches on Subject: below --
2007-10-09 23:48 Gustavo Chain
2007-10-10  1:49 ` David Newall
2007-10-10  5:15   ` Gustavo Chain
2007-10-10  5:44     ` David Newall
2007-10-10 13:46       ` Gustavo Chain
2007-10-10 14:13         ` David Newall
2007-10-10 19:50         ` Valdis.Kletnieks
2007-10-10 21:02           ` g
2007-10-11  0:05           ` David Newall

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=46B8DC5E-CD66-40B3-BF82-05259F9D7288@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=a1426z@gawab.com \
    --cc=g@0xff.cl \
    --cc=linux-kernel@vger.kernel.org \
    /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®