Skip to contentSkip to conversation

selinux: add security in-core xattr support for tracefs

PATCH In review [email protected] 3 participants 3 messages Dec 6, 2016 – Dec 7, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selinux: add security in-core xattr support for tracefs

From: Yongqin Liu <[email protected]>

Since kernel 4.1 ftrace is supported as a new separate filesystem. It gets automatically mounted by the kernel under the old path /sys/kernel/debug/tracing. Because it lives now on a separate filesystem SELinux needs to be updated to also support setting SELinux labels on tracefs inodes. This is required for compatibility in Android when moving to Linux 4.1 or newer.

---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
index 09fd610..24bd84d 100644
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
 		!strcmp(sb->s_type->name, "sysfs") ||
 		!strcmp(sb->s_type->name, "pstore") ||
 		!strcmp(sb->s_type->name, "debugfs") ||
+		!strcmp(sb->s_type->name, "tracefs") ||
 		!strcmp(sb->s_type->name, "rootfs");
 }
 
Signature · 1 line
2.7.4
Acked-by on v3 1/1
#1 lore raw
Quoted 11 lines · On 12/06/2016 01:27 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Since kernel 4.1 ftrace is supported as a new separate filesystem. It gets automatically mounted by the kernel under the old path /sys/kernel/debug/tracing. Because it lives now on a separate filesystem SELinux needs to be updated to also support setting SELinux labels on tracefs inodes. This is required for compatibility in Android when moving to Linux 4.1 or newer.

I'm ok with this under the view that it is needed for compatibility and the general purpose solution may take some time to implement and then will further require updated policy toolchain and policy. Of course, it would be nice to start that sooner rather than later...

Quoted 17 lines
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
index 09fd610..24bd84d 100644
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
 		!strcmp(sb->s_type->name, "sysfs") ||
 		!strcmp(sb->s_type->name, "pstore") ||
 		!strcmp(sb->s_type->name, "debugfs") ||
+		!strcmp(sb->s_type->name, "tracefs") ||
 		!strcmp(sb->s_type->name, "rootfs");
 }
 
maintainer
#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Tue, Dec 6, 2016 at 1:27 PM, <[email protected]> wrote:

From: Yongqin Liu <[email protected]>

Since kernel 4.1 ftrace is supported as a new separate filesystem. It gets automatically mounted by the kernel under the old path /sys/kernel/debug/tracing. Because it lives now on a separate filesystem SELinux needs to be updated to also support setting SELinux labels on tracefs inodes. This is required for compatibility in Android when moving to Linux 4.1 or newer.

Quoted 5 lines
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)

Merged for v4.11, thanks.

Quoted 15 lines
security/selinux/hooks.c +1 -1
index 09fd610..24bd84d 100644
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
                !strcmp(sb->s_type->name, "sysfs") ||
                !strcmp(sb->s_type->name, "pstore") ||
                !strcmp(sb->s_type->name, "debugfs") ||
+               !strcmp(sb->s_type->name, "tracefs") ||
                !strcmp(sb->s_type->name, "rootfs");
 }
 
--

2.7.4

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