[patch 1/1] selinux: MLS compatibility

From: Stephen Smalley
Date: Mon Nov 07 2005 - 11:12:50 EST


This patch enables files created on a MLS-enabled SELinux system to be
accessible on a non-MLS SELinux system, by skipping the MLS component of
the security context in the non-MLS case. Please apply, for 2.6.15 if
possible.

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

---

security/selinux/ss/mls.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/security/selinux/ss/mls.c
===================================================================
RCS file: /nfshome/pal/CVS/linux-2.6/security/selinux/ss/mls.c,v
retrieving revision 1.26
diff -u -p -r1.26 mls.c
--- linux-2.6/security/selinux/ss/mls.c 29 Aug 2005 14:13:22 -0000 1.26
+++ linux-2.6/security/selinux/ss/mls.c 4 Nov 2005 19:26:47 -0000
@@ -262,8 +262,11 @@ int mls_context_to_sid(char oldc,
struct cat_datum *catdatum, *rngdatum;
int l, rc = -EINVAL;

- if (!selinux_mls_enabled)
+ if (!selinux_mls_enabled) {
+ if (def_sid != SECSID_NULL && oldc)
+ *scontext += strlen(*scontext);
return 0;
+ }

/*
* No MLS component to the security context, try and map to

--
Stephen Smalley
National Security Agency

-
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/