diff options
Diffstat (limited to 'security/selinux/ss/mls.c')
-rw-r--r-- | security/selinux/ss/mls.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c index 119bd6078ba1..c713af23250a 100644 --- a/security/selinux/ss/mls.c +++ b/security/selinux/ss/mls.c | |||
@@ -530,22 +530,21 @@ int mls_compute_sid(struct context *scontext, | |||
530 | u32 specified, | 530 | u32 specified, |
531 | struct context *newcontext) | 531 | struct context *newcontext) |
532 | { | 532 | { |
533 | struct range_trans *rtr; | ||
534 | |||
533 | if (!selinux_mls_enabled) | 535 | if (!selinux_mls_enabled) |
534 | return 0; | 536 | return 0; |
535 | 537 | ||
536 | switch (specified) { | 538 | switch (specified) { |
537 | case AVTAB_TRANSITION: | 539 | case AVTAB_TRANSITION: |
538 | if (tclass == SECCLASS_PROCESS) { | 540 | /* Look for a range transition rule. */ |
539 | struct range_trans *rangetr; | 541 | for (rtr = policydb.range_tr; rtr; rtr = rtr->next) { |
540 | /* Look for a range transition rule. */ | 542 | if (rtr->source_type == scontext->type && |
541 | for (rangetr = policydb.range_tr; rangetr; | 543 | rtr->target_type == tcontext->type && |
542 | rangetr = rangetr->next) { | 544 | rtr->target_class == tclass) { |
543 | if (rangetr->dom == scontext->type && | 545 | /* Set the range from the rule */ |
544 | rangetr->type == tcontext->type) { | 546 | return mls_range_set(newcontext, |
545 | /* Set the range from the rule */ | 547 | &rtr->target_range); |
546 | return mls_range_set(newcontext, | ||
547 | &rangetr->range); | ||
548 | } | ||
549 | } | 548 | } |
550 | } | 549 | } |
551 | /* Fallthrough */ | 550 | /* Fallthrough */ |