selinux: fix non-MLS handling in mls_context_to_sid()
authorPaul Moore <paul@paul-moore.com>
Wed, 14 Nov 2018 02:44:33 +0000 (21:44 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 14 Nov 2018 02:44:33 +0000 (21:44 -0500)
commit877181a8d9dc663f7a73f77f50af714d7888ec3b
tree1608534267eee0c2f6ecfc200607f16bfa5b2566
parentc138325fb8713472d5a0c3c7258b9131bab40725
selinux: fix non-MLS handling in mls_context_to_sid()

Commit 95ffe194204a ("selinux: refactor mls_context_to_sid() and make
it stricter") inadvertently changed how we handle labels that did not
contain MLS information.  This patch restores the proper behavior in
mls_context_to_sid() and adds a comment explaining the proper
behavior to help ensure this doesn't happen again.

Fixes: 95ffe194204a ("selinux: refactor mls_context_to_sid() and make it stricter")
Reported-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/mls.c