2012-08-23 20:53:37

by Aristeu Rozanski

[permalink] [raw]
Subject: [PATCH v7 0/4] cgroup: add xattr support

This series are a refreshed version of a patchset submitted by Li Zefan back
in march:
https://lkml.org/lkml/2012/3/1/13

With Li's permission, I refreshed the patches to apply over the latest upstream
and added the modifications suggested by others in the thread:
- using a mount option instead of config option to enable the xattr support
- reinitialize the list in kmem_xattrs_free()
- renamed functions to simple_xattr_*()

There're two users for this patchset:
- SELinux: to be able to control access to cgroupfs inside containers
- systemd: to store meta information such as main PID in a service cgroup,
set specific services special options in the cgroup.

While the xattrs will use kernel memory like tmpfs, they're restricted to
'security' (which controls the format of the value) and 'trusted' (which
requires CAP_SYS_ADMIN). If kernel memory usage is still a concern, we're
not far from having memcg account for kernel memory.

v7:
- fix checkpatch.pl warnings
- Implement the changes requested by Hugh Dickins:
- make simple_xattrs_init and simple_xattrs_free inline
- get rid of locking and list reinitialization in simple_xattrs_free,
they're not needed
v6:
- only allow trusted and security
- replace subsys_bits by something more meaningful
v5:
- check for permissions for user xattr namespace
v4:
- implemented requested changes by Tejun Heo in patch #2

Cc: Li Zefan <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: Lennart Poettering <[email protected]>
Signed-off-by: Li Zefan <[email protected]>
Signed-off-by: Aristeu Rozanski <[email protected]>

--
Aristeu


2012-08-24 22:58:47

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH v7 0/4] cgroup: add xattr support

Hello,

On Thu, Aug 23, 2012 at 04:53:27PM -0400, [email protected] wrote:
> This series are a refreshed version of a patchset submitted by Li Zefan back
> in march:
> https://lkml.org/lkml/2012/3/1/13

Applied to cgroup/for-3.7 w/ "Original-Patch-by: Li Zefan" added for
the first three patches.

* Can you please update MTA setting so that the From: header contains
your full name? Importing the series to git ended up with
"[email protected] <[email protected]>".

* Can you please add some comments and documentation regarding this?

Thanks.

--
tejun

2012-08-27 13:05:38

by Aristeu Rozanski

[permalink] [raw]
Subject: Re: [PATCH v7 0/4] cgroup: add xattr support

Hi Tejun,
On Fri, Aug 24, 2012 at 03:58:39PM -0700, Tejun Heo wrote:
> On Thu, Aug 23, 2012 at 04:53:27PM -0400, [email protected] wrote:
> > This series are a refreshed version of a patchset submitted by Li Zefan back
> > in march:
> > https://lkml.org/lkml/2012/3/1/13
>
> Applied to cgroup/for-3.7 w/ "Original-Patch-by: Li Zefan" added for
> the first three patches.
>
> * Can you please update MTA setting so that the From: header contains
> your full name? Importing the series to git ended up with
> "[email protected] <[email protected]>".

sure, will repost with that fixed and including "Original-Patch-by: Li
Zefan" on the first three patches

> * Can you please add some comments and documentation regarding this?

about what exactly?

--
Aristeu

2012-08-28 16:15:28

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH v7 0/4] cgroup: add xattr support

Hello,

On Mon, Aug 27, 2012 at 09:05:25AM -0400, Aristeu Rozanski wrote:
> Hi Tejun,
> On Fri, Aug 24, 2012 at 03:58:39PM -0700, Tejun Heo wrote:
> > On Thu, Aug 23, 2012 at 04:53:27PM -0400, [email protected] wrote:
> > > This series are a refreshed version of a patchset submitted by Li Zefan back
> > > in march:
> > > https://lkml.org/lkml/2012/3/1/13
> >
> > Applied to cgroup/for-3.7 w/ "Original-Patch-by: Li Zefan" added for
> > the first three patches.
> >
> > * Can you please update MTA setting so that the From: header contains
> > your full name? Importing the series to git ended up with
> > "[email protected] <[email protected]>".
>
> sure, will repost with that fixed and including "Original-Patch-by: Li
> Zefan" on the first three patches

Ooh, I already fixed it up myself. I was mentioning for future
patches.

> > * Can you please add some comments and documentation regarding this?
>
> about what exactly?

What xattr support in cgroup does and for what supposed purposes with
what kind of restrictions and some comments explaining the
implementation, I suppose.

Thanks.

--
tejun