Skip to content

Commit 8a764ef

Browse files
cgzonespcmoore
authored andcommitted
selinux: enable genfscon labeling for securityfs
Add support for genfscon per-file labeling of securityfs files. This allows for separate labels and thereby access control for different files. For example a genfscon statement genfscon securityfs /integrity/ima/policy \ system_u:object_r:ima_policy_t:s0 will set a private label to the IMA policy file and thus allow to control the ability to set the IMA policy. Setting labels directly with setxattr(2), e.g. by chcon(1) or setfiles(8), is still not supported. Signed-off-by: Christian Göttsche <[email protected]> [PM: line width fixes in the commit description] Signed-off-by: Paul Moore <[email protected]>
1 parent d9d8c93 commit 8a764ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/selinux/hooks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,8 @@ static int selinux_set_mnt_opts(struct super_block *sb,
760760
!strcmp(sb->s_type->name, "tracefs") ||
761761
!strcmp(sb->s_type->name, "binder") ||
762762
!strcmp(sb->s_type->name, "bpf") ||
763-
!strcmp(sb->s_type->name, "pstore"))
763+
!strcmp(sb->s_type->name, "pstore") ||
764+
!strcmp(sb->s_type->name, "securityfs"))
764765
sbsec->flags |= SE_SBGENFS;
765766

766767
if (!strcmp(sb->s_type->name, "sysfs") ||

0 commit comments

Comments
 (0)