public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Boldi <a1426z@gawab.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Reserve N process to root
Date: Fri, 12 Oct 2007 00:02:37 +0300	[thread overview]
Message-ID: <200710120002.37341.a1426z@gawab.com> (raw)

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

Here is an excerpt:

Re: [PATCH 1/1] threads_max: Simple lockout prevention patch

From: Al Boldi <a1426z@gawab.com>
To: Andrew Morton <akpm@osdl.org>
CC: linux-kernel@vger.kernel.org
Date: 04/24/06 02:12 pm

Andrew Morton wrote:
> Al Boldi <a1426z@gawab.com> wrote:
> > This is a another resend, which was ignored before w/o comment.
> > Andrew, can you at least comment on it?  Thanks!
>
> I don't have a clue what it's for.

Quoting from the 'Resource limits' thread on lkml on 27/09/05:
>>>>> Consider this dilemma:
>>>>> Runaway proc/s hit the limit.
>>>>> Try to kill some and you are denied due to the resource limit.
>>>>> Use some previously running app like top, hope it hasn't been killed
>>>>> by some OOM situation, try killing some procs and another one takes
>>>>> it's place because of the runaway situation.
>>>>> Raise the limit, and it gets filled by the runaways.
>>>>> You are pretty much stuck.
>>>>
>>>> Not really, this is the sort of thing ulimit is meant for.  To keep
>>>> processes from any one user from running away.  It lets you limit the
>>>> damage it can do, until such time as you can control it and fix the
>>>> runaway application.
>>>
>>> threads-max = 1024
>>> ulimit = 100 forks
>>> 11 runaway procs hitting the threads-max limit
>>
>> This is incorrect.  If you ulimit a user to 100 forks, and 11 processes
>> running with that uid
> 
> Different uid.
> 
Then yes, if you set a system-wide limit that is less than the sum of the 
limits imposed on each accountable part of the system you can have lock out.  
But thats your fault for misconfiguring the system.  Don't do that.

-- end of quote

Thanks!

--
Al


             reply	other threads:[~2007-10-11 21:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 21:02 Al Boldi [this message]
2007-10-12  2:42 ` [PATCH] Reserve N process to root Kyle Moffett
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=200710120002.37341.a1426z@gawab.com \
    --to=a1426z@gawab.com \
    --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