From: Matt Helsley <matthltc@us.ibm.com>
To: Glauber Costa <glommer@parallels.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org,
containers@lists.linux-foundation.org,
Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH] new cgroup controller "fork"
Date: Thu, 3 Nov 2011 13:08:56 -0700 [thread overview]
Message-ID: <20111103200856.GK21134@count0.beaverton.ibm.com> (raw)
In-Reply-To: <4EB2E3E6.6070401@parallels.com>
On Thu, Nov 03, 2011 at 04:56:38PM -0200, Glauber Costa wrote:
> On 11/03/2011 04:51 PM, Max Kellermann wrote:
> >On 2011/11/03 19:21, Alan Cox<alan@lxorguk.ukuu.org.uk> wrote:
> >>>After little discussion, nobody seemed to be interested in it, and
> >>>nobody merged it. I reposted it today, not knowing somebody else had
> >>>come up with a similar idea meanwhile.
> >>
> >>I don't really see a meaningful use case for this. Why should millions of
> >>users have this stuff in their kernel. What's the general purpose use
> >>case we should all be excited about ?
> >
> >Putting a reasonable limit on jobs that are expected to run only for a
> >limited amount of time, with a limited amount of total resources. For
> >example: CGI, cron jobs, backup, munin plugins, virus scanners and
> >other email filters, procmail, ... - when the job is done, the group
> >can be deleted, and new instances will run in a new group.
> >
> >With just RLIMIT_NPROC or task_counter, you can limit the total number
> >of processes, but it will not stop a fork bomb - it will only slow it
> >down. The fork bomb will still bounce between 1 and the limit, and
> >consume lots of resources for forking and exiting.
> >
> >(Glauber: the above should answer your last email, too)
>
> Yet, the damage a fork bomb can pose into the system this way is
> severely limited. Combined with the cpu controller to guarantee that
> this group of process will never take the whole cpu for themselves,
> you have almost everything you need, if not everything.
Assuming we're only talking about fork bombs, I tend to agree.
Using Frederic's cgroup subsystem we can adjust the limit to the number of
legitimate tasks in the cgroup (0 if you can't distinguish them) and then
start killing the fork bombs. If the forkbomb goes into a fork-then-exit
loop in order to eat cpu once it's reached the task limit the cpu
controller becomes more useful.
However, isn't it possible that forking an extra task could be a sign of
a security issue other than a fork bomb? Imagine a CGI module that could
set the fork limit (not number of tasks) to the precise or maximum
number of tasks that CGI script should create (perhaps a per-script
limit known and configured somewhere by an admin). If the CGI script
attempts to go over that limit it could be a sign of an exploit attempt.
The fork limit could prevent the CGI script from creating a shell with
unintended privileges. Or the shell might be created but no non-builtin
commands could be executed. The exploit would not be able to kill an
existing task to make room. Anyhow, that's purely hypothetical --
I can imagine a use for this feature but I don't know that it's
been implemented or how practical it really is. Also, depending on how
such a CGI module+script drops privileges, there still may be acceptable
alternatives like syscall filtering...
Cheers,
-Matt Helsley
next prev parent reply other threads:[~2011-11-03 20:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 16:22 Max Kellermann
2011-11-03 16:43 ` Frederic Weisbecker
2011-11-03 17:16 ` Max Kellermann
2011-11-03 17:26 ` Glauber Costa
2011-11-03 17:48 ` Max Kellermann
2011-11-03 17:50 ` Glauber Costa
2011-11-03 18:30 ` Max Kellermann
2011-11-03 18:34 ` Glauber Costa
2011-11-03 16:43 ` Glauber Costa
2011-11-03 16:59 ` Max Kellermann
2011-11-03 17:05 ` Frederic Weisbecker
2011-11-03 18:21 ` Alan Cox
2011-11-03 18:51 ` Max Kellermann
2011-11-03 18:56 ` Glauber Costa
2011-11-03 20:08 ` Matt Helsley [this message]
2011-11-03 19:03 ` Alan Cox
2011-11-03 19:20 ` Max Kellermann
2011-11-03 19:25 ` Glauber Costa
2011-11-03 20:13 ` Brian K. White
2011-11-03 21:54 ` Glauber Costa
2011-11-04 3:03 ` Li Zefan
2011-11-04 4:37 ` KAMEZAWA Hiroyuki
2011-11-04 13:11 ` Glauber Costa
2011-11-04 13:38 ` Max Kellermann
2011-11-04 13:59 ` Lennart Poettering
2011-11-03 17:31 ` richard -rw- weinberger
-- strict thread matches above, loose matches on Subject: below --
2011-02-17 13:31 Max Kellermann
2011-02-17 13:50 ` KAMEZAWA Hiroyuki
2011-02-17 14:09 ` Max Kellermann
2011-02-18 0:59 ` Paul Menage
2011-02-18 9:26 ` Max Kellermann
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=20111103200856.GK21134@count0.beaverton.ibm.com \
--to=matthltc@us.ibm.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=containers@lists.linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=glommer@parallels.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
all inboxes | Powered by JetHome®