Skip to contentSkip to conversation

filesystem: label cgroup symlinks

PATCH New Nicolas Iooss 2 participants 2 messages Apr 14, 2014 – Apr 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 filesystem: label cgroup symlinks

/sys/fs/cgroup is a tmpfs which contains cgroup mounts and symlinks such as cpu and cpuacct. Running restorecon makes this warning happen:

restorecon: Warning no default label for /sys/fs/cgroup/cpu

Declare a file context for every symlink in the cgroup tmpfs montpoint to no longer have such warning.

---
 policy/modules/kernel/filesystem.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/kernel/filesystem.fc +1 -0
index d7c11a0..f5cfe84 100644
@@ -13,6 +13,7 @@
 
 /sys/fs/cgroup	-d	gen_context(system_u:object_r:cgroup_t,s0)
 /sys/fs/cgroup/.*	<<none>>
+/sys/fs/cgroup/[^/]+	-l	gen_context(system_u:object_r:cgroup_t,s0)
 
 /sys/fs/pstore	-d	gen_context(system_u:object_r:pstore_t,s0)
 /sys/fs/pstore/.*	<<none>>
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 filesystem: label cgroup symlinks

Quoted 16 lines · Nicolas Iooss

/sys/fs/cgroup is a tmpfs which contains cgroup mounts and symlinks such as cpu and cpuacct. Running restorecon makes this warning happen:

restorecon: Warning no default label for /sys/fs/cgroup/cpu

Declare a file context for every symlink in the cgroup tmpfs montpoint to no longer have such warning.

---
 policy/modules/kernel/filesystem.fc | 1 +
 1 file changed, 1 insertion(+)
policy/modules/kernel/filesystem.fc +0 -0
index d7c11a0..f5cfe84 100644

policy/modules/kernel/filesystem.fc line 19

Quoted 7 lines
policy/modules/kernel/filesystem.fc +1 -0
@@ -13,6 +13,7 @@
 
 /sys/fs/cgroup	-d	gen_context(system_u:object_r:cgroup_t,s0)
 /sys/fs/cgroup/.*	<<none>>
+/sys/fs/cgroup/[^/]+	-l	gen_context(system_u:object_r:cgroup_t,s0)
 
 /sys/fs/pstore	-d	gen_context(system_u:object_r:pstore_t,s0)
 /sys/fs/pstore/.*	<<none>>

Merged.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com