All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: James Morris <jmorris@namei.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-security-module@vger.kernel.org, Greg KH <greg@kroah.com>,
	Stephen Smalley <sds@epoch.ncsc.mil>,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [RFC] cgroups: implement device whitelist lsm (v2)
Date: Fri, 14 Mar 2008 17:05:14 +0300	[thread overview]
Message-ID: <47DA861A.2020905@openvz.org> (raw)
In-Reply-To: <20080314135817.GE8744@sergelap.austin.ibm.com>

Serge E. Hallyn wrote:
> Quoting Pavel Emelyanov (xemul@openvz.org):
>> Serge E. Hallyn wrote:
>>> Quoting James Morris (jmorris@namei.org):
>>>> On Thu, 13 Mar 2008, Serge E. Hallyn wrote:
>>>>
>>>>> Quoting James Morris (jmorris@namei.org):
>>>>>> On Thu, 13 Mar 2008, Serge E. Hallyn wrote:
>>>>>>
>>>>>>> True, but while this change simplifies the code a bit, the semantics
>>>>>>> seem more muddled - devcg will be enforcing when CONFIG_CGROUP_DEV=y
>>>>>>> and:
>>>>>>>
>>>>>>> 	SECURITY=n or
>>>>>>> 	rootplug is enabled
>>>>>>> 	capabilities is enabled
>>>>>>> 	smack is enabled
>>>>>>> 	selinux+capabilities is enabled
>>>>>> Well, this is how real systems are going to be deployed.
>>>>> Sorry, do you mean with capabilities?
>>>> Yes.
>>>>
>>>> All Fedora, RHEL, CentOS etc. ship with SELinux+capabilities.  I can't 
>>>> imagine not enabling them on other kernels.
>>>>
>>>>>> It becomes confusing, IMHO, if you have to change which secondary LSM you 
>>>>>> stack with SELinux to enable a cgroup feature.
>>>>> So you're saying selinux without capabilities should still be able to
>>>>> use dev_cgroup?  (Just making sure I understand right)
>>>> Nope, SELinux always stacks with capabilities, so havng the cgroup hooks 
>>>> in capabilities makes sense (rather than having us change the secondary 
>>>> stacking LSM just to enable a feature).
>>> Oh, ok.
>>>
>>> Will let the patch stand until Pavel and Greg comment then.
>> Well, I saw your previous patch, that was implemented as just another
>> LSM module and I liked it except for the LSM dependency.
> 
> James and Stephen agree with your LSM qualms.  I suppose we could add

Thanks!

> cgroups next to the lsm hooks.  I suspect Paul Menage would complain
> about that (Paul?), and I do think it's silly as they are security
> questions, not group tracking questions, but if it's what people want
> I can send out a new patch next week.

The way I see this is: cgroups provide a common way to group tasks
and an API for general configuration - that's the controller "face", 
and it's up to the controller to decide where he turns his "back",
IOW where the hooks are placed. For the memory controller - they are
injected directly into the mm code. For this controller, I think it
would be OK to use LSM or about-LSM hooks.

>> Since this version can happily work w/o LSM, I like it too :)
> 
> In an earlier version I asked whether you had any experience with usual
> # rules per container.  Do you have an idea?  Right now the whitelist is
> a straight list we search through linearly.  If # rules is generally
> tiny then I'm inclined to keep it that way...

The # of rules usually has a linear dependency on the number of containers
(each of then has to have an access to /dev/null,zero,random at least), so
having 100 containers we will have to scan through a 300-entries list. I'd
vote for a hash table or a radix/binary/rb tree for that. Or any other way
for non-linear search you can provide :)

> thanks,
> -serge
> 


  reply	other threads:[~2008-03-14 14:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13  3:27 [RFC] cgroups: implement device whitelist lsm (v2) Serge E. Hallyn
2008-03-13  9:25 ` James Morris
2008-03-13 13:18   ` Serge E. Hallyn
2008-03-13 13:50     ` James Morris
2008-03-13 14:38       ` Serge E. Hallyn
2008-03-13 22:27         ` James Morris
2008-03-13 22:46           ` Serge E. Hallyn
2008-03-13 23:49             ` James Morris
2008-03-14  1:41               ` Serge E. Hallyn
2008-03-14  4:47                 ` Greg KH
2008-03-14 13:54                   ` Serge E. Hallyn
2008-03-14 13:58                     ` Pavel Emelyanov
2008-03-14 15:45                       ` Serge E. Hallyn
2008-03-14 15:54                         ` Pavel Emelyanov
2008-03-14 16:57                         ` Stephen Smalley
2008-03-14  9:28                 ` Pavel Emelyanov
2008-03-14 13:58                   ` Serge E. Hallyn
2008-03-14 14:05                     ` Pavel Emelyanov [this message]
2008-03-14 14:37                       ` Serge E. Hallyn
2008-03-14 15:07                         ` Pavel Emelyanov
2008-03-14 14:12                     ` Paul Menage
2008-03-14 14:42                       ` Serge E. Hallyn
2008-03-16  0:59                         ` Paul Menage
2008-03-14  2:51               ` Casey Schaufler
2008-03-14  9:16 ` Paul Menage
2008-03-14 14:05   ` Serge E. Hallyn
2008-03-14 14:15     ` Paul Menage
2008-03-14 14:35       ` Serge E. Hallyn
2008-03-16  0:57         ` Paul Menage
2008-03-14  9:18 ` Paul Menage
2008-03-14 14:00   ` Serge E. Hallyn

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=47DA861A.2020905@openvz.org \
    --to=xemul@openvz.org \
    --cc=casey@schaufler-ca.com \
    --cc=greg@kroah.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@epoch.ncsc.mil \
    --cc=serue@us.ibm.com \
    /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.