selinux: remove some no-op BUG_ONs
PATCH 1/1 selinux: remove some no-op BUG_ONs
Since acdf52d97f82 ("selinux: convert to kvmalloc"), these check whether an address-of value is NULL, which is pointless.
Signed-off-by Ondrej Mosnacek <[email protected]>
--- security/selinux/ss/services.c | 4 ---- 1 file changed, 4 deletions(-)
security/selinux/ss/services.c +0 -4
@@ -651,9 +651,7 @@ static void context_struct_compute_av(struct policydb *policydb, avkey.target_class = tclass; avkey.specified =AVTAB_AV |AVTAB_XPERMS ; sattr = &policydb->type_attr_map_array[scontext->type -1 ]; -BUG_ON (!sattr); tattr = &policydb->type_attr_map_array[tcontext->type -1 ]; -BUG_ON (!tattr);ebitmap_for_each_positive_bit (sattr, snode, i) {ebitmap_for_each_positive_bit (tattr, tnode, j) { avkey.source_type = i +1 ;
@@ -1059,9 +1057,7 @@ void security_compute_xperms_decision(struct selinux_state *state, avkey.target_class = tclass; avkey.specified =AVTAB_XPERMS ; sattr = &policydb->type_attr_map_array[scontext->type -1 ]; -BUG_ON (!sattr); tattr = &policydb->type_attr_map_array[tcontext->type -1 ]; -BUG_ON (!tattr);ebitmap_for_each_positive_bit (sattr, snode, i) {ebitmap_for_each_positive_bit (tattr, tnode, j) { avkey.source_type = i +1 ;
Signature · 1 line
2.20.1
Paul Moore
maintainerQuoted 8 lines · Ondrej Mosnacek
Since
acdf52d97f82("selinux: convert to kvmalloc"), these check whether an address-of value is NULL, which is pointless.Signed-off-by Ondrej Mosnacek <[email protected]>--- security/selinux/ss/services.c | 4 ---- 1 file changed, 4 deletions(-)
This looks fine to me, I'll queue this up for after the merge window closes.
Quoted 26 lines
security/selinux/ss/services.c +0
-5@@ -651,9 +651,7 @@ static void context_struct_compute_av(struct policydb *policydb, avkey.target_class = tclass; avkey.specified =AVTAB_AV |AVTAB_XPERMS ; sattr = &policydb->type_attr_map_array[scontext->type -1 ]; -BUG_ON (!sattr); tattr = &policydb->type_attr_map_array[tcontext->type -1 ]; -BUG_ON (!tattr);ebitmap_for_each_positive_bit (sattr, snode, i) {ebitmap_for_each_positive_bit (tattr, tnode, j) { avkey.source_type = i +1 ;@@ -1059,9 +1057,7 @@ void security_compute_xperms_decision(struct selinux_state *state, avkey.target_class = tclass; avkey.specified =AVTAB_XPERMS ; sattr = &policydb->type_attr_map_array[scontext->type -1 ]; -BUG_ON (!sattr); tattr = &policydb->type_attr_map_array[tcontext->type -1 ]; -BUG_ON (!tattr);ebitmap_for_each_positive_bit (sattr, snode, i) {ebitmap_for_each_positive_bit (tattr, tnode, j) { avkey.source_type = i +1 ; --2.20.1
Signature · 2 lines
paul moore www.paul-moore.com
Paul Moore
maintainerQuoted 11 lines · Paul Moore
Quoted 8 lines · Ondrej Mosnacek
Since
acdf52d97f82("selinux: convert to kvmalloc"), these check whether an address-of value is NULL, which is pointless.Signed-off-by Ondrej Mosnacek <[email protected]>--- security/selinux/ss/services.c | 4 ---- 1 file changed, 4 deletions(-)This looks fine to me, I'll queue this up for after the merge window closes.
Just merged into selinux/next, thanks.
Signature · 2 lines
paul moore www.paul-moore.com