From: Venkat Yekkirala Date: Tue, 19 Sep 2006 17:24:19 +0000 (-0700) Subject: [SELINUX]: Fix bug in security_sid_mls_copy X-Git-Tag: v4.13~42769^2~62 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4eb327b517cf85f6cb7dcd5691e7b748cbe8c343;p=mirror_ubuntu-bionic-kernel.git [SELINUX]: Fix bug in security_sid_mls_copy 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 Acked-by: Stephen Smalley Signed-off-by: James Morris --- diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 27ee28ccf266..7eb69a602d8f 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -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; }