aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/services.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r--security/selinux/ss/services.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 03140edf97a3..d572dc908f31 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -353,12 +353,8 @@ static int context_struct_compute_av(struct context *scontext,
353 avkey.specified = AVTAB_AV; 353 avkey.specified = AVTAB_AV;
354 sattr = &policydb.type_attr_map[scontext->type - 1]; 354 sattr = &policydb.type_attr_map[scontext->type - 1];
355 tattr = &policydb.type_attr_map[tcontext->type - 1]; 355 tattr = &policydb.type_attr_map[tcontext->type - 1];
356 ebitmap_for_each_bit(sattr, snode, i) { 356 ebitmap_for_each_positive_bit(sattr, snode, i) {
357 if (!ebitmap_node_get_bit(snode, i)) 357 ebitmap_for_each_positive_bit(tattr, tnode, j) {
358 continue;
359 ebitmap_for_each_bit(tattr, tnode, j) {
360 if (!ebitmap_node_get_bit(tnode, j))
361 continue;
362 avkey.source_type = i + 1; 358 avkey.source_type = i + 1;
363 avkey.target_type = j + 1; 359 avkey.target_type = j + 1;
364 for (node = avtab_search_node(&policydb.te_avtab, &avkey); 360 for (node = avtab_search_node(&policydb.te_avtab, &avkey);
@@ -1668,14 +1664,10 @@ int security_get_user_sids(u32 fromsid,
1668 goto out_unlock; 1664 goto out_unlock;
1669 } 1665 }
1670 1666
1671 ebitmap_for_each_bit(&user->roles, rnode, i) { 1667 ebitmap_for_each_positive_bit(&user->roles, rnode, i) {
1672 if (!ebitmap_node_get_bit(rnode, i))
1673 continue;
1674 role = policydb.role_val_to_struct[i]; 1668 role = policydb.role_val_to_struct[i];
1675 usercon.role = i+1; 1669 usercon.role = i+1;
1676 ebitmap_for_each_bit(&role->types, tnode, j) { 1670 ebitmap_for_each_positive_bit(&role->types, tnode, j) {
1677 if (!ebitmap_node_get_bit(tnode, j))
1678 continue;
1679 usercon.type = j+1; 1671 usercon.type = j+1;
1680 1672
1681 if (mls_setup_user_range(fromcon, user, &usercon)) 1673 if (mls_setup_user_range(fromcon, user, &usercon))