diff options
author | Paul Moore <pmoore@redhat.com> | 2015-02-17 15:30:23 -0500 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2015-04-06 20:15:55 -0400 |
commit | da8026fa0f9154b1c571c4d160dd51a7b8c34495 (patch) | |
tree | 494595cd52c3506580be0f1f08bbe20069fd6f71 /security/selinux/ss/mls.c | |
parent | 83d4a806ae46397f606de7376b831524bd3a21e5 (diff) | |
download | linux-da8026fa0f9154b1c571c4d160dd51a7b8c34495.tar.bz2 |
selinux: reconcile security_netlbl_secattr_to_sid() and mls_import_netlbl_cat()
Move the NetLabel secattr MLS category import logic into
mls_import_netlbl_cat() where it belongs, and use the
mls_import_netlbl_cat() function in security_netlbl_secattr_to_sid().
Reported-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'security/selinux/ss/mls.c')
-rw-r--r-- | security/selinux/ss/mls.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c index d307b37ddc2b..e1088842232c 100644 --- a/security/selinux/ss/mls.c +++ b/security/selinux/ss/mls.c @@ -654,19 +654,15 @@ int mls_import_netlbl_cat(struct context *context, rc = ebitmap_netlbl_import(&context->range.level[0].cat, secattr->attr.mls.cat); - if (rc != 0) - goto import_netlbl_cat_failure; - - rc = ebitmap_cpy(&context->range.level[1].cat, - &context->range.level[0].cat); - if (rc != 0) + if (rc) goto import_netlbl_cat_failure; + memcpy(&context->range.level[1].cat, &context->range.level[0].cat, + sizeof(context->range.level[0].cat)); return 0; import_netlbl_cat_failure: ebitmap_destroy(&context->range.level[0].cat); - ebitmap_destroy(&context->range.level[1].cat); return rc; } #endif /* CONFIG_NETLABEL */ |