aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/mls.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/ss/mls.c')
-rw-r--r--security/selinux/ss/mls.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index 2fe459df3c85..b7efa2296969 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -245,9 +245,13 @@ int mls_context_to_sid(struct policydb *pol,
245 char *rangep[2]; 245 char *rangep[2];
246 246
247 if (!pol->mls_enabled) { 247 if (!pol->mls_enabled) {
248 if ((def_sid != SECSID_NULL && oldc) || (*scontext) == '\0') 248 /*
249 return 0; 249 * With no MLS, only return -EINVAL if there is a MLS field
250 return -EINVAL; 250 * and it did not come from an xattr.
251 */
252 if (oldc && def_sid == SECSID_NULL)
253 return -EINVAL;
254 return 0;
251 } 255 }
252 256
253 /* 257 /*