Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378339

Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field

From Aditya Kali <adityakali@google.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field
Date 2016-04-14 01:40 +0200
Message-ID <rnCy6-MZ-1@gated-at.bofh.it> (permalink)
References <rfhKa-4mP-27@gated-at.bofh.it> <rnxf5-4Yd-23@gated-at.bofh.it> <rny1s-5Eb-1@gated-at.bofh.it> <rnyb8-5I5-15@gated-at.bofh.it> <rnykO-65O-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 13, 2016 at 12:01 PM, Serge E. Hallyn <serge@hallyn.com> wrote:
> Quoting Tejun Heo (tj@kernel.org):
>> Hello, Serge.
>>
>> On Wed, Apr 13, 2016 at 01:46:39PM -0500, Serge E. Hallyn wrote:
>> > It's not a leak of any information we're trying to hide.  I realize
>> > something like 8 years have passed, but I still basically go by the
>> > ksummit guidance that containers are ok but the kernel's first priority
>> > is to facilitate containers but not trick containers into thinking
>> > they're not containerized.  So long as the container is properly set
>> > up, I don't think there's anything the workload could do with the
>> > nsroot= info other than *know* that it is in a ns cgroup.
>> >
>> > If we did change that guidance, there's a slew of proc info that we
>> > could better virtualize :)
>>
>> I see.  I'm just wondering because the information here seems a bit
>> gratuituous.  Isn't the only thing necessary telling whether the root
>> is bind mounted or namescoped?  Wouldn't simple "nsroot" work for that
>> purpose?
>
> I don't think so - we could be in a cgroup namespace but still have
> access only to bind-mounted cgroups.  So we need to compare the
> superblock dentry root field to the nsroot= value.

Umm, I don't think this is such a good idea. The main purpose of
cgroup namespace was to prevent this exposure of system cgroup
hierarchy that used to happen because of /proc/self/cgroup. Wouldn't
showing that information in /proc/self/mountinfo defeat the purpose?

> One practical problem I've found with cgroup namespaces is that there
> is no way to disambiguate between a cgroupfs mount which was done in
> a cgroup namespace, and a bind mount of a cgroupfs directory.

Thats actually by design, no? Namespaced apps should not know/care if
they are running inside namespace. If they can find it out today, its
just because of certain side-effects. I fear adding explicit "nsroot"
or something in /proc/self/mountinfo now becomes an API making it hard
to virtualize user-apps again.

-- 
Aditya

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Tejun Heo <tj@kernel.org> - 2016-04-13 20:00 +0200
  Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-13 20:50 +0200
    Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Tejun Heo <tj@kernel.org> - 2016-04-13 21:00 +0200
      Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-13 21:10 +0200
        Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Tejun Heo <tj@kernel.org> - 2016-04-13 21:20 +0200
        Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Aditya Kali <adityakali@google.com> - 2016-04-14 01:40 +0200
          Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-14 02:00 +0200
  [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-14 06:10 +0200
    Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field ebiederm@xmission.com (Eric W. Biederman) - 2016-04-14 17:00 +0200
      Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-14 17:30 +0200
        Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field ebiederm@xmission.com (Eric W. Biederman) - 2016-04-14 18:30 +0200
          Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-14 18:40 +0200
            Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field ebiederm@xmission.com (Eric W. Biederman) - 2016-04-14 19:00 +0200
        Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Aditya Kali <adityakali@google.com> - 2016-04-15 18:00 +0200
          Re: [PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field "Serge E. Hallyn" <serge@hallyn.com> - 2016-04-15 18:10 +0200

csiph-web