diff options
-rw-r--r-- | security/selinux/ss/services.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index d11a8154500f..8551952ef329 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -2737,6 +2737,7 @@ int security_netlbl_secattr_to_sid(struct netlbl_lsm_secattr *secattr, | |||
2737 | if (ctx == NULL) | 2737 | if (ctx == NULL) |
2738 | goto netlbl_secattr_to_sid_return; | 2738 | goto netlbl_secattr_to_sid_return; |
2739 | 2739 | ||
2740 | context_init(&ctx_new); | ||
2740 | ctx_new.user = ctx->user; | 2741 | ctx_new.user = ctx->user; |
2741 | ctx_new.role = ctx->role; | 2742 | ctx_new.role = ctx->role; |
2742 | ctx_new.type = ctx->type; | 2743 | ctx_new.type = ctx->type; |
@@ -2745,13 +2746,9 @@ int security_netlbl_secattr_to_sid(struct netlbl_lsm_secattr *secattr, | |||
2745 | if (ebitmap_netlbl_import(&ctx_new.range.level[0].cat, | 2746 | if (ebitmap_netlbl_import(&ctx_new.range.level[0].cat, |
2746 | secattr->attr.mls.cat) != 0) | 2747 | secattr->attr.mls.cat) != 0) |
2747 | goto netlbl_secattr_to_sid_return; | 2748 | goto netlbl_secattr_to_sid_return; |
2748 | ctx_new.range.level[1].cat.highbit = | 2749 | memcpy(&ctx_new.range.level[1].cat, |
2749 | ctx_new.range.level[0].cat.highbit; | 2750 | &ctx_new.range.level[0].cat, |
2750 | ctx_new.range.level[1].cat.node = | 2751 | sizeof(ctx_new.range.level[0].cat)); |
2751 | ctx_new.range.level[0].cat.node; | ||
2752 | } else { | ||
2753 | ebitmap_init(&ctx_new.range.level[0].cat); | ||
2754 | ebitmap_init(&ctx_new.range.level[1].cat); | ||
2755 | } | 2752 | } |
2756 | if (mls_context_isvalid(&policydb, &ctx_new) != 1) | 2753 | if (mls_context_isvalid(&policydb, &ctx_new) != 1) |
2757 | goto netlbl_secattr_to_sid_return_cleanup; | 2754 | goto netlbl_secattr_to_sid_return_cleanup; |