[PATCH] SELinux: Fix bug in security_sid_mls_copy

From: James Morris
Date: Tue Sep 19 2006 - 09:47:54 EST


From: Venkat Yekkirala <vyekkirala@xxxxxxxxxxxxx>

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.

Please apply.

Signed-off-by: Venkat Yekkirala <vyekkirala@xxxxxxxxxxxxx>
Acked-by: Stephen Smalley <sds@xxxxxxxxxxxxx>
Signed-off-by: James Morris <jmorris@xxxxxxxxx>

---

security/selinux/ss/services.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 27ee28c..7eb69a6 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 m
u32 len;
int rc = 0;

- if (!ss_initialized) {
+ if (!ss_initialized || !selinux_mls_enabled) {
*new_sid = sid;
goto out;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/