diff options
-rw-r--r-- | security/selinux/ss/policydb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 9c5cdc2caaef..56eb65f67cb1 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -2608,7 +2608,7 @@ static int mls_write_range_helper(struct mls_range *r, void *fp) | |||
2608 | if (!eq) | 2608 | if (!eq) |
2609 | buf[2] = cpu_to_le32(r->level[1].sens); | 2609 | buf[2] = cpu_to_le32(r->level[1].sens); |
2610 | 2610 | ||
2611 | BUG_ON(items > (sizeof(buf)/sizeof(buf[0]))); | 2611 | BUG_ON(items > ARRAY_SIZE(buf)); |
2612 | 2612 | ||
2613 | rc = put_entry(buf, sizeof(u32), items, fp); | 2613 | rc = put_entry(buf, sizeof(u32), items, fp); |
2614 | if (rc) | 2614 | if (rc) |
@@ -2990,7 +2990,7 @@ static int role_write(void *vkey, void *datum, void *ptr) | |||
2990 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) | 2990 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) |
2991 | buf[items++] = cpu_to_le32(role->bounds); | 2991 | buf[items++] = cpu_to_le32(role->bounds); |
2992 | 2992 | ||
2993 | BUG_ON(items > (sizeof(buf)/sizeof(buf[0]))); | 2993 | BUG_ON(items > ARRAY_SIZE(buf)); |
2994 | 2994 | ||
2995 | rc = put_entry(buf, sizeof(u32), items, fp); | 2995 | rc = put_entry(buf, sizeof(u32), items, fp); |
2996 | if (rc) | 2996 | if (rc) |
@@ -3040,7 +3040,7 @@ static int type_write(void *vkey, void *datum, void *ptr) | |||
3040 | } else { | 3040 | } else { |
3041 | buf[items++] = cpu_to_le32(typdatum->primary); | 3041 | buf[items++] = cpu_to_le32(typdatum->primary); |
3042 | } | 3042 | } |
3043 | BUG_ON(items > (sizeof(buf) / sizeof(buf[0]))); | 3043 | BUG_ON(items > ARRAY_SIZE(buf)); |
3044 | rc = put_entry(buf, sizeof(u32), items, fp); | 3044 | rc = put_entry(buf, sizeof(u32), items, fp); |
3045 | if (rc) | 3045 | if (rc) |
3046 | return rc; | 3046 | return rc; |
@@ -3069,7 +3069,7 @@ static int user_write(void *vkey, void *datum, void *ptr) | |||
3069 | buf[items++] = cpu_to_le32(usrdatum->value); | 3069 | buf[items++] = cpu_to_le32(usrdatum->value); |
3070 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) | 3070 | if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) |
3071 | buf[items++] = cpu_to_le32(usrdatum->bounds); | 3071 | buf[items++] = cpu_to_le32(usrdatum->bounds); |
3072 | BUG_ON(items > (sizeof(buf) / sizeof(buf[0]))); | 3072 | BUG_ON(items > ARRAY_SIZE(buf)); |
3073 | rc = put_entry(buf, sizeof(u32), items, fp); | 3073 | rc = put_entry(buf, sizeof(u32), items, fp); |
3074 | if (rc) | 3074 | if (rc) |
3075 | return rc; | 3075 | return rc; |