]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
SELinux: don't check permissions for kernel mounts
authorJames Morris <jmorris@namei.org>
Fri, 19 Dec 2008 00:41:10 +0000 (11:41 +1100)
committerJames Morris <jmorris@namei.org>
Fri, 19 Dec 2008 22:03:39 +0000 (09:03 +1100)
Don't bother checking permissions when the kernel performs an
internal mount, as this should always be allowed.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
security/selinux/hooks.c

index 7465d713b531911f0d50a3cf21e7b4f3aa7f7b74..853b58c8b2cb13d48011dc1d069ac32c6538e875 100644 (file)
@@ -2484,6 +2484,10 @@ static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data)
        if (rc)
                return rc;
 
+       /* Allow all mounts performed by the kernel */
+       if (flags & MS_KERNMOUNT)
+               return 0;
+
        AVC_AUDIT_DATA_INIT(&ad, FS);
        ad.u.fs.path.dentry = sb->s_root;
        return superblock_has_perm(cred, sb, FILESYSTEM__MOUNT, &ad);