]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - security/selinux/hooks.c
SELinux: do not compute transition labels on mountpoint labeled filesystems
[mv-sheeva.git] / security / selinux / hooks.c
index 65fa8bf596f591d12c2e0c22bafe5824522c34ee..cda18fd8ca0fa15a5873dc002daeb9aa1b218d8f 100644 (file)
@@ -2525,7 +2525,10 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
        sid = tsec->sid;
        newsid = tsec->create_sid;
 
-       if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
+       if ((sbsec->flags & SE_SBINITIALIZED) &&
+           (sbsec->behavior == SECURITY_FS_USE_MNTPOINT))
+               newsid = sbsec->mntpoint_sid;
+       else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
                rc = security_transition_sid(sid, dsec->sid,
                                             inode_mode_to_security_class(inode->i_mode),
                                             &newsid);