]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/selinux/hooks.c
[PATCH] Fix security check for joint context= and fscontext= mount options
[linux-2.6-omap-h63xx.git] / security / selinux / hooks.c
index 2e8b4dfcbc743d4b2394085043f35793780ef1dc..a91c961ba38b5d93deb4a005f79336f17f6d8acd 100644 (file)
@@ -523,12 +523,16 @@ static int try_context_mount(struct super_block *sb, void *data)
                        goto out_free;
                }
 
-               rc = may_context_mount_sb_relabel(sid, sbsec, tsec);
-               if (rc)
-                       goto out_free;
-
-               if (!fscontext)
+               if (!fscontext) {
+                       rc = may_context_mount_sb_relabel(sid, sbsec, tsec);
+                       if (rc)
+                               goto out_free;
                        sbsec->sid = sid;
+               } else {
+                       rc = may_context_mount_inode_relabel(sid, sbsec, tsec);
+                       if (rc)
+                               goto out_free;
+               }
                sbsec->mntpoint_sid = sid;
 
                sbsec->behavior = SECURITY_FS_USE_MNTPOINT;