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


Groups > linux.kernel > #1577732 > unrolled thread

[PATCH] security: selinux: allow per-file labeling for cgroupfs

Started byAntonio Murdaca <amurdaca@redhat.com>
First post2017-02-09 17:10 +0100
Last post2017-02-11 00:10 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] security: selinux: allow per-file labeling for cgroupfs Antonio Murdaca <amurdaca@redhat.com> - 2017-02-09 17:10 +0100
    Re: [PATCH] security: selinux: allow per-file labeling for cgroupfs Paul Moore <paul@paul-moore.com> - 2017-02-09 17:20 +0100
      Re: [PATCH] security: selinux: allow per-file labeling for cgroupfs Paul Moore <paul@paul-moore.com> - 2017-02-09 20:30 +0100
        Re: [PATCH] security: selinux: allow per-file labeling for cgroupfs Paul Moore <paul@paul-moore.com> - 2017-02-10 00:10 +0100
          Re: [PATCH] security: selinux: allow per-file labeling for cgroupfs Daniel J Walsh <dwalsh@redhat.com> - 2017-02-11 00:10 +0100

#1577732 — [PATCH] security: selinux: allow per-file labeling for cgroupfs

FromAntonio Murdaca <amurdaca@redhat.com>
Date2017-02-09 17:10 +0100
Subject[PATCH] security: selinux: allow per-file labeling for cgroupfs
Message-ID<t8Zsd-8j1-11@gated-at.bofh.it>
From: Antonio Murdaca <runcom@redhat.com>

This patch allows genfscon per-file labeling for cgroupfs. For instance,
this allows to label the "release_agent" file within each
cgroup mount and limit writes to it.

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9a8f12f..5a3138e 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -808,6 +808,8 @@ static int selinux_set_mnt_opts(struct super_block *sb,
 
 	if (!strcmp(sb->s_type->name, "debugfs") ||
 	    !strcmp(sb->s_type->name, "sysfs") ||
+	    !strcmp(sb->s_type->name, "cgroup") ||
+	    !strcmp(sb->s_type->name, "cgroup2") ||
 	    !strcmp(sb->s_type->name, "pstore"))
 		sbsec->flags |= SE_SBGENFS;
 
-- 
2.9.3

[toc] | [next] | [standalone]


#1577736

FromPaul Moore <paul@paul-moore.com>
Date2017-02-09 17:20 +0100
Message-ID<t8ZBT-8mq-11@gated-at.bofh.it>
In reply to#1577732
On Thu, Feb 9, 2017 at 11:02 AM, Antonio Murdaca <amurdaca@redhat.com> wrote:
> From: Antonio Murdaca <runcom@redhat.com>
>
> This patch allows genfscon per-file labeling for cgroupfs. For instance,
> this allows to label the "release_agent" file within each
> cgroup mount and limit writes to it.
>
> Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
> ---
>  security/selinux/hooks.c | 2 ++
>  1 file changed, 2 insertions(+)

This was already merged ... ?

* https://marc.info/?l=selinux&m=148652458620202&w=2

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 9a8f12f..5a3138e 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -808,6 +808,8 @@ static int selinux_set_mnt_opts(struct super_block *sb,
>
>         if (!strcmp(sb->s_type->name, "debugfs") ||
>             !strcmp(sb->s_type->name, "sysfs") ||
> +           !strcmp(sb->s_type->name, "cgroup") ||
> +           !strcmp(sb->s_type->name, "cgroup2") ||
>             !strcmp(sb->s_type->name, "pstore"))
>                 sbsec->flags |= SE_SBGENFS;
>
> --
> 2.9.3

-- 
paul moore
www.paul-moore.com

[toc] | [prev] | [next] | [standalone]


#1577895

FromPaul Moore <paul@paul-moore.com>
Date2017-02-09 20:30 +0100
Message-ID<t92zM-1JF-15@gated-at.bofh.it>
In reply to#1577736
On Thu, Feb 9, 2017 at 12:39 PM, Antonio Murdaca <amurdaca@redhat.com> wrote:
> On Feb 9, 2017 17:14, "Paul Moore" <paul@paul-moore.com> wrote:
> On Thu, Feb 9, 2017 at 11:02 AM, Antonio Murdaca <amurdaca@redhat.com>
> wrote:
>> From: Antonio Murdaca <runcom@redhat.com>
>>
>> This patch allows genfscon per-file labeling for cgroupfs. For instance,
>> this allows to label the "release_agent" file within each
>> cgroup mount and limit writes to it.
>>
>> Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
>> ---
>>  security/selinux/hooks.c | 2 ++
>>  1 file changed, 2 insertions(+)
>
> This was already merged ... ?
>
>
> This is adding cgroup and cgroup2 to the other whitelist (afaict).

Yes, my apologies, I read this patch too quickly and confused it with
the previous cgroups patch.

Just to set expectations, this patch is too late for the upcoming
merge window, we can consider it in a few weeks once the merge window
has closed.  This should give you some time to do some further testing
(hint, hint).

-- 
paul moore
www.paul-moore.com

[toc] | [prev] | [next] | [standalone]


#1578019

FromPaul Moore <paul@paul-moore.com>
Date2017-02-10 00:10 +0100
Message-ID<t960F-3Z2-1@gated-at.bofh.it>
In reply to#1577895
On Thu, Feb 9, 2017 at 5:32 PM, Antonio Murdaca <amurdaca@redhat.com> wrote:
>
>
> On Feb 9, 2017 20:23, "Paul Moore" <paul@paul-moore.com> wrote:
>
> On Thu, Feb 9, 2017 at 12:39 PM, Antonio Murdaca <amurdaca@redhat.com>
> wrote:
>> On Feb 9, 2017 17:14, "Paul Moore" <paul@paul-moore.com> wrote:
>> On Thu, Feb 9, 2017 at 11:02 AM, Antonio Murdaca <amurdaca@redhat.com>
>> wrote:
>>> From: Antonio Murdaca <runcom@redhat.com>
>>>
>>> This patch allows genfscon per-file labeling for cgroupfs. For instance,
>>> this allows to label the "release_agent" file within each
>>> cgroup mount and limit writes to it.
>>>
>>> Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
>>> ---
>>>  security/selinux/hooks.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>
>> This was already merged ... ?
>>
>>
>> This is adding cgroup and cgroup2 to the other whitelist (afaict).
>
> Yes, my apologies, I read this patch too quickly and confused it with
> the previous cgroups patch.
>
> Just to set expectations, this patch is too late for the upcoming
> merge window, we can consider it in a few weeks once the merge window
> has closed.  This should give you some time to do some further testing
> (hint, hint).
>
>
> Sure, I'm going to test this and add tests in selinux-testsuite as well

Great, thank you.

-- 
paul moore
www.paul-moore.com

[toc] | [prev] | [next] | [standalone]


#1578853

FromDaniel J Walsh <dwalsh@redhat.com>
Date2017-02-11 00:10 +0100
Message-ID<t9sud-1qk-9@gated-at.bofh.it>
In reply to#1578019

On 02/09/2017 06:04 PM, Paul Moore wrote:
> On Thu, Feb 9, 2017 at 5:32 PM, Antonio Murdaca <amurdaca@redhat.com> wrote:
>>
>> On Feb 9, 2017 20:23, "Paul Moore" <paul@paul-moore.com> wrote:
>>
>> On Thu, Feb 9, 2017 at 12:39 PM, Antonio Murdaca <amurdaca@redhat.com>
>> wrote:
>>> On Feb 9, 2017 17:14, "Paul Moore" <paul@paul-moore.com> wrote:
>>> On Thu, Feb 9, 2017 at 11:02 AM, Antonio Murdaca <amurdaca@redhat.com>
>>> wrote:
>>>> From: Antonio Murdaca <runcom@redhat.com>
>>>>
>>>> This patch allows genfscon per-file labeling for cgroupfs. For instance,
>>>> this allows to label the "release_agent" file within each
>>>> cgroup mount and limit writes to it.
>>>>
>>>> Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
>>>> ---
>>>>  security/selinux/hooks.c | 2 ++
>>>>  1 file changed, 2 insertions(+)
>>> This was already merged ... ?
>>>
>>>
>>> This is adding cgroup and cgroup2 to the other whitelist (afaict).
>> Yes, my apologies, I read this patch too quickly and confused it with
>> the previous cgroups patch.
>>
>> Just to set expectations, this patch is too late for the upcoming
>> merge window, we can consider it in a few weeks once the merge window
>> has closed.  This should give you some time to do some further testing
>> (hint, hint).
>>
>>
>> Sure, I'm going to test this and add tests in selinux-testsuite as well
> Great, thank you.
>
No problem on waiting for this patch.  Stephen asked for this, but this is
not something we are currently planning on using with containers.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web