Skip to content

Commit 2e08c0c

Browse files
Eamon WalshJames Morris
authored andcommitted
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: Eamon Walsh <[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: James Morris <[email protected]>
1 parent 1996a10 commit 2e08c0c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

security/selinux/ss/mls.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,8 @@ int mls_compute_sid(struct context *scontext,
537537
/* Use the process effective MLS attributes. */
538538
return mls_context_cpy_low(newcontext, scontext);
539539
case AVTAB_MEMBER:
540-
/* Only polyinstantiate the MLS attributes if
541-
the type is being polyinstantiated */
542-
if (newcontext->type != tcontext->type) {
543-
/* Use the process effective MLS attributes. */
544-
return mls_context_cpy_low(newcontext, scontext);
545-
} else {
546-
/* Use the related object MLS attributes. */
547-
return mls_context_cpy(newcontext, tcontext);
548-
}
540+
/* Use the process effective MLS attributes. */
541+
return mls_context_cpy_low(newcontext, scontext);
549542
default:
550543
return -EINVAL;
551544
}

0 commit comments

Comments
 (0)