[SELINUX]: Fix bug in security_sid_mls_copy
authorVenkat Yekkirala <vyekkirala@TrustedCS.com>
Tue, 19 Sep 2006 17:24:19 +0000 (10:24 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:19:04 +0000 (15:19 -0700)
The following fixes a bug where random mem is being tampered with in the
non-mls case; encountered by Jashua Brindle on a gentoo box.

Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/services.c

index 27ee28c..7eb69a6 100644 (file)
@@ -1841,7 +1841,7 @@ int security_sid_mls_copy(u32 sid, u32 mls_sid, u32 *new_sid)
        u32 len;
        int rc = 0;
 
-       if (!ss_initialized) {
+       if (!ss_initialized || !selinux_mls_enabled) {
                *new_sid = sid;
                goto out;
        }