Skip to contentSkip to conversation

security: selinux: allow per-file labeling for cgroupfs

PATCH In review Antonio Murdaca 4 participants 7 messages Feb 9, 2017 – Feb 10, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security: selinux: allow per-file labeling for cgroupfs

From: Antonio Murdaca <[email protected]>

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.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
security/selinux/hooks.c +2 -0
index 9a8f12f..5a3138e 100644
@@ -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;
 
Signature · 7 lines
2.9.3

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]
To get help, send an email containing "help" to [email protected]
maintainer
#1 lore raw
Quoted 10 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)

This was already merged ... ?

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

Quoted 15 lines
security/selinux/hooks.c +2 -1
index 9a8f12f..5a3138e 100644
@@ -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

Signature · 2 lines
paul moore
www.paul-moore.com

A message that is not in the archive (sent off-list or not yet received): CAHC9VhRFxDuRJHYEuRs7kc4ivgaT=-SxdU-o5Lq7H-O+5JJRxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#3 lore raw

On Feb 9, 2017 17:14, "Paul Moore" <[email protected]> wrote:

Quoted 10 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

---
 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).

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

security/selinux/hooks.c static int selinux_set_mnt_opts(struct super_block

Quoted 5 lines
security/selinux/hooks.c +0 -0
index 9a8f12f..5a3138e 100644
@@ -808,6 +808,8 @@ static int selinux_set_mnt_opts(struct super_block

*sb,

Quoted 10 lines
security/selinux/hooks.c +2 -1
        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

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]
To get help, send an email containing "help" to [email protected]

maintainer
#4 lore raw
Quoted 14 lines · Antonio Murdaca

On Feb 9, 2017 17:14, "Paul Moore" <[email protected]> wrote:

Quoted 10 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 4 lines

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).

Signature · 2 lines
paul moore
www.paul-moore.com

A message that is not in the archive (sent off-list or not yet received): CAHC9VhSj4ztDZwxfcuugaD5-OJrBVaJ=TQS=t4=jfL0+ZdbdYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw

On Feb 9, 2017 20:23, "Paul Moore" <[email protected]> wrote:

Quoted 14 lines · Antonio Murdaca

On Feb 9, 2017 17:14, "Paul Moore" <[email protected]> wrote:

Quoted 10 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 4 lines

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

--
paul moore
www.paul-moore.com

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]
To get help, send an email containing "help" to [email protected]

maintainer
#7 lore raw
Quoted 28 lines · Antonio Murdaca

On Feb 9, 2017 20:23, "Paul Moore" <[email protected]> wrote:

Quoted 14 lines · Antonio Murdaca

On Feb 9, 2017 17:14, "Paul Moore" <[email protected]> wrote:

Quoted 10 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 4 lines

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.

Quoted 7 lines

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.

Signature · 7 lines
paul moore
www.paul-moore.com
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]
To get help, send an email containing "help" to [email protected]
#8 lore raw
Quoted 26 lines · Paul Moore
Quoted 25 lines · Antonio Murdaca

On Feb 9, 2017 20:23, "Paul Moore" <[email protected]> wrote:

Quoted 9 lines · Antonio Murdaca

On Feb 9, 2017 17:14, "Paul Moore" <[email protected]> wrote:

Quoted 6 lines · Antonio Murdaca

From: Antonio Murdaca <[email protected]>

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.

Quoted 8 lines
Quoted 4 lines
---
 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.

Quoted 9 lines
Quoted 7 lines

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.