diff options
Diffstat (limited to 'security')
-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 876b815c1ba4..ab0cc0c7b944 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -2907,6 +2907,7 @@ int security_netlbl_secattr_to_sid(struct netlbl_lsm_secattr *secattr, | |||
2907 | if (ctx == NULL) | 2907 | if (ctx == NULL) |
2908 | goto netlbl_secattr_to_sid_return; | 2908 | goto netlbl_secattr_to_sid_return; |
2909 | 2909 | ||
2910 | context_init(&ctx_new); | ||
2910 | ctx_new.user = ctx->user; | 2911 | ctx_new.user = ctx->user; |
2911 | ctx_new.role = ctx->role; | 2912 | ctx_new.role = ctx->role; |
2912 | ctx_new.type = ctx->type; | 2913 | ctx_new.type = ctx->type; |
@@ -2915,13 +2916,9 @@ int security_netlbl_secattr_to_sid(struct netlbl_lsm_secattr *secattr, | |||
2915 | if (ebitmap_netlbl_import(&ctx_new.range.level[0].cat, | 2916 | if (ebitmap_netlbl_import(&ctx_new.range.level[0].cat, |
2916 | secattr->attr.mls.cat) != 0) | 2917 | secattr->attr.mls.cat) != 0) |
2917 | goto netlbl_secattr_to_sid_return; | 2918 | goto netlbl_secattr_to_sid_return; |
2918 | ctx_new.range.level[1].cat.highbit = | 2919 | memcpy(&ctx_new.range.level[1].cat, |
2919 | ctx_new.range.level[0].cat.highbit; | 2920 | &ctx_new.range.level[0].cat, |
2920 | ctx_new.range.level[1].cat.node = | 2921 | sizeof(ctx_new.range.level[0].cat)); |
2921 | ctx_new.range.level[0].cat.node; | ||
2922 | } else { | ||
2923 | ebitmap_init(&ctx_new.range.level[0].cat); | ||
2924 | ebitmap_init(&ctx_new.range.level[1].cat); | ||
2925 | } | 2922 | } |
2926 | if (mls_context_isvalid(&policydb, &ctx_new) != 1) | 2923 | if (mls_context_isvalid(&policydb, &ctx_new) != 1) |
2927 | goto netlbl_secattr_to_sid_return_cleanup; | 2924 | goto netlbl_secattr_to_sid_return_cleanup; |