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

Commit 2e08c0c1 authored by Eamon Walsh's avatar Eamon Walsh Committed by James Morris
Browse files

selinux: make mls_compute_sid always polyinstantiate



This patch removes the requirement that the new and related object types
differ in order to polyinstantiate by MLS level.  This allows MLS
polyinstantiation to occur in the absence of explicit type_member rules or
when the type has not changed.

Potential users of this support include pam_namespace.so (directory
polyinstantiation) and the SELinux X support (property polyinstantiation).

Signed-off-by: default avatarEamon Walsh <ewalsh@tycho.nsa.gov>
Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 1996a109
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -537,15 +537,8 @@ int mls_compute_sid(struct context *scontext,
			/* Use the process effective MLS attributes. */
			return mls_context_cpy_low(newcontext, scontext);
	case AVTAB_MEMBER:
		/* Only polyinstantiate the MLS attributes if
		   the type is being polyinstantiated */
		if (newcontext->type != tcontext->type) {
		/* Use the process effective MLS attributes. */
		return mls_context_cpy_low(newcontext, scontext);
		} else {
			/* Use the related object MLS attributes. */
			return mls_context_cpy(newcontext, tcontext);
		}
	default:
		return -EINVAL;
	}