From: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
To: Daniel Lezcano <daniel.lezcano-GANU6spQydw@public.gmane.org>
Cc: Mike Hommey <mh-YmoObPS1fuhg9hUCZPvPmw@public.gmane.org>,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: Containers and /proc/sys/vm/drop_caches
Date: Wed, 5 Jan 2011 08:01:59 -0600 [thread overview]
Message-ID: <20110105140159.GC2718@hallyn.com> (raw)
In-Reply-To: <4D243EC3.1050101-GANU6spQydw@public.gmane.org>
Quoting Daniel Lezcano (daniel.lezcano-GANU6spQydw@public.gmane.org):
> On 01/05/2011 10:40 AM, Mike Hommey wrote:
> >[Copy/pasted from a previous message to lkml, where it was suggested to
> > try containers@]
> >
> >Hi,
> >
> >I noticed that from within a lxc container, writing "3" to
> >/proc/sys/vm/drop_caches would flush the host page cache. That sounds a
> >little dangerous for VPS offerings that would be based on lxc, as in one
> >VPS instance root user could impact the overall performance of the host.
> >I don't know about other containers but I've been told openvz isn't
> >subject to this problem.
> >I only tested the current Debian Squeeze kernel, which is based on
> >2.6.32.27.
>
> There is definitively a big work to do with /proc.
>
> Some files should be not accessible (/proc/sys/vm/drop_caches,
> /proc/sys/kernel/sysrq, ...) and some other should be virtualized
> (/proc/meminfo, /proc/cpuinfo, ...).
>
> Serge suggested to create something similar to the cgroup device
> whitelist but for /proc, maybe it is a good approach for denying
> access a specific proc's file.
Long-term, user namespaces should fix this - /proc will be owned
by the user namespace which mounted it, but we can tell proc to
always have some files (like drop_caches) be owned by init_user_ns.
I'm hoping to push my final targeted capabilities prototype in the
next few weeks, and after that I start seriously attacking VFS
interaction.
In the meantime, though, you can use SELinux/Smack, or a custom
cgroup file does sound useful. Can cgroups be modules nowadays?
(I can't keep up) If so, an out of tree proc-cgroup module seems
like a good interim solution.
-serge
next prev parent reply other threads:[~2011-01-05 14:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 9:40 Containers and /proc/sys/vm/drop_caches Mike Hommey
[not found] ` <20110105094022.GA5366-YmoObPS1fuhg9hUCZPvPmw@public.gmane.org>
2011-01-05 9:49 ` Daniel Lezcano
[not found] ` <4D243EC3.1050101-GANU6spQydw@public.gmane.org>
2011-01-05 14:01 ` Serge Hallyn [this message]
[not found] ` <20110105140159.GC2718-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
2011-01-05 14:16 ` Balbir Singh
[not found] ` <AANLkTi=x=6gUZTxJC8LXxYNu029+firyzKqjMa6m+R-x-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-06 21:43 ` Matt Helsley
[not found] ` <20110106214315.GJ29064-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2011-01-06 21:50 ` Dave Hansen
2011-01-06 22:08 ` Matt Helsley
[not found] ` <20110106220841.GK29064-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2011-01-06 22:15 ` Dave Hansen
2011-01-07 13:03 ` Rob Landley
[not found] ` <4D270F34.8080305-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-01-07 15:12 ` Serge Hallyn
[not found] ` <20110107151241.GB4962-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
2011-01-08 12:39 ` Rob Landley
[not found] ` <4D285B03.6050708-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2011-01-11 16:28 ` Serge Hallyn
-- strict thread matches above, loose matches on Subject: below --
2010-12-30 7:59 Mike Hommey
2010-12-30 8:57 ` Rob Landley
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=20110105140159.GC2718@hallyn.com \
--to=serge.hallyn-z7wlfzj8ewms+fvcfc7uqw@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=daniel.lezcano-GANU6spQydw@public.gmane.org \
--cc=mh-YmoObPS1fuhg9hUCZPvPmw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.