Skip to content

Commit 901ef84

Browse files
runcompcmoore
authored andcommitted
selinux: allow per-file labeling for cgroupfs
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 <[email protected]> [PM: subject line and merge tweaks] Signed-off-by: Paul Moore <[email protected]>
1 parent 5d72801 commit 901ef84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

security/selinux/hooks.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,9 @@ static int selinux_set_mnt_opts(struct super_block *sb,
815815
if (!strcmp(sb->s_type->name, "debugfs") ||
816816
!strcmp(sb->s_type->name, "tracefs") ||
817817
!strcmp(sb->s_type->name, "sysfs") ||
818-
!strcmp(sb->s_type->name, "pstore"))
818+
!strcmp(sb->s_type->name, "pstore") ||
819+
!strcmp(sb->s_type->name, "cgroup") ||
820+
!strcmp(sb->s_type->name, "cgroup2"))
819821
sbsec->flags |= SE_SBGENFS;
820822

821823
if (!sbsec->behavior) {

0 commit comments

Comments
 (0)