Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e517a0cd authored by Stephen Smalley's avatar Stephen Smalley Committed by Linus Torvalds
Browse files

[PATCH] selinux: MLS compatibility



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.

Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d34d7ae2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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