From: Stephen Smalley Date: Fri, 5 Dec 2008 14:12:19 +0000 (-0500) Subject: SELinux: correctly detect proc filesystems of the form "proc/foo" X-Git-Tag: firefly_0821_release~16477^2^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=459c19f524a9d89c65717a7d061d5f11ecf6bcb8;p=firefly-linux-kernel-4.4.55.git SELinux: correctly detect proc filesystems of the form "proc/foo" Map all of these proc/ filesystem types to "proc" for the policy lookup at filesystem mount time. Signed-off-by: James Morris --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 520f82ab3fbf..8dbc54cde59e 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -702,7 +702,7 @@ static int selinux_set_mnt_opts(struct super_block *sb, sbsec->proc = 1; /* Determine the labeling behavior to use for this filesystem type. */ - rc = security_fs_use(sb->s_type->name, &sbsec->behavior, &sbsec->sid); + rc = security_fs_use(sbsec->proc ? "proc" : sb->s_type->name, &sbsec->behavior, &sbsec->sid); if (rc) { printk(KERN_WARNING "%s: security_fs_use(%s) returned %d\n", __func__, sb->s_type->name, rc);