selinux: remove some no-op BUG_ONs
authorOndrej Mosnacek <omosnace@redhat.com>
Sat, 4 May 2019 19:59:06 +0000 (21:59 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 21 May 2019 20:23:43 +0000 (16:23 -0400)
Since acdf52d97f82 ("selinux: convert to kvmalloc"), these check whether
an address-of value is NULL, which is pointless.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/services.c

index cc043bc..20a089d 100644 (file)
@@ -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;