]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - security/selinux/ss/mls.c
[PATCH] selinux: Fix MLS compatibility off-by-one bug
[mv-sheeva.git] / security / selinux / ss / mls.c
index aaefac2921f1d94cedbd33f29afa631796e28503..84047f69f9c1b4d0bdfbbfe511457d6a62c18dad 100644 (file)
@@ -262,8 +262,11 @@ int mls_context_to_sid(char oldc,
        struct cat_datum *catdatum, *rngdatum;
        int l, rc = -EINVAL;
 
-       if (!selinux_mls_enabled)
+       if (!selinux_mls_enabled) {
+               if (def_sid != SECSID_NULL && oldc)
+                       *scontext += strlen(*scontext)+1;
                return 0;
+       }
 
        /*
         * No MLS component to the security context, try and map to