Lines Matching refs:size

103 	if (l->size != r->size)  in aa_rawdata_eq()
109 return memcmp(l->data, r->data, r->compressed_size ?: r->size) == 0; in aa_rawdata_eq()
144 struct aa_loaddata *aa_loaddata_alloc(size_t size) in aa_loaddata_alloc() argument
151 d->data = kvzalloc(size, GFP_KERNEL); in aa_loaddata_alloc()
163 VISIBLE_IF_KUNIT bool aa_inbounds(struct aa_ext *e, size_t size) in aa_inbounds() argument
165 return (size <= e->end - e->pos); in aa_inbounds()
178 size_t size = 0; in aa_unpack_u16_chunk() local
183 size = le16_to_cpu(get_unaligned((__le16 *) e->pos)); in aa_unpack_u16_chunk()
185 if (!aa_inbounds(e, size)) in aa_unpack_u16_chunk()
188 e->pos += size; in aa_unpack_u16_chunk()
189 return size; in aa_unpack_u16_chunk()
237 size_t size = aa_unpack_u16_chunk(e, &tag); in aa_unpack_nameX() local
239 if (name && (!size || tag[size-1] != '\0' || strcmp(name, tag))) in aa_unpack_nameX()
332 VISIBLE_IF_KUNIT bool aa_unpack_array(struct aa_ext *e, const char *name, u16 *size) in aa_unpack_array() argument
339 *size = le16_to_cpu(get_unaligned((__le16 *) e->pos)); in aa_unpack_array()
355 u32 size; in aa_unpack_blob() local
358 size = le32_to_cpu(get_unaligned((__le32 *) e->pos)); in aa_unpack_blob()
360 if (aa_inbounds(e, (size_t) size)) { in aa_unpack_blob()
362 e->pos += size; in aa_unpack_blob()
363 return size; in aa_unpack_blob()
376 size_t size = 0; in aa_unpack_str() local
380 size = aa_unpack_u16_chunk(e, &src_str); in aa_unpack_str()
381 if (size) { in aa_unpack_str()
383 if (src_str[size - 1] != 0) in aa_unpack_str()
387 return size; in aa_unpack_str()
428 size_t size; in unpack_dfa() local
431 size = aa_unpack_blob(e, &blob, "aadfa"); in unpack_dfa()
432 if (size) { in unpack_dfa()
443 dfa = aa_dfa_unpack(blob + pad, size - pad, flags); in unpack_dfa()
467 u16 size; in unpack_trans_table() local
470 if (!aa_unpack_array(e, NULL, &size)) in unpack_trans_table()
478 table = kcalloc(size, sizeof(char *), GFP_KERNEL); in unpack_trans_table()
483 strs->size = size; in unpack_trans_table()
484 for (i = 0; i < size; i++) { in unpack_trans_table()
540 u16 size; in unpack_xattrs() local
543 if (!aa_unpack_array(e, NULL, &size)) in unpack_xattrs()
545 profile->attach.xattr_count = size; in unpack_xattrs()
546 profile->attach.xattrs = kcalloc(size, sizeof(char *), GFP_KERNEL); in unpack_xattrs()
549 for (i = 0; i < size; i++) { in unpack_xattrs()
569 u16 size; in unpack_secmark() local
573 if (!aa_unpack_array(e, NULL, &size)) in unpack_secmark()
576 rules->secmark = kcalloc(size, sizeof(struct aa_secmark), in unpack_secmark()
581 rules->secmark_count = size; in unpack_secmark()
583 for (i = 0; i < size; i++) { in unpack_secmark()
601 for (i = 0; i < size; i++) in unpack_secmark()
618 u16 size; in unpack_rlimits() local
625 if (!aa_unpack_array(e, NULL, &size) || in unpack_rlimits()
626 size > RLIM_NLIMITS) in unpack_rlimits()
628 for (i = 0; i < size; i++) { in unpack_rlimits()
674 u16 size = 0; in unpack_perms_table() local
687 if (!aa_unpack_array(e, NULL, &size)) in unpack_perms_table()
689 *perms = kcalloc(size, sizeof(struct aa_perms), GFP_KERNEL); in unpack_perms_table()
692 for (i = 0; i < size; i++) { in unpack_perms_table()
703 return size; in unpack_perms_table()
719 ssize_t size; in unpack_pdb() local
726 size = unpack_perms_table(e, &pdb->perms); in unpack_pdb()
727 if (size < 0) { in unpack_pdb()
728 error = size; in unpack_pdb()
733 pdb->size = size; in unpack_pdb()
1104 data->size = aa_unpack_blob(e, &data->data, NULL); in unpack_profile()
1105 data->data = kvmemdup(data->data, data->size, GFP_KERNEL); in unpack_profile()
1106 if (data->size && !data->data) { in unpack_profile()
1115 kvfree_sensitive(data->data, data->size); in unpack_profile()
1252 for (i = 0; i < pdb->size; i++) { in verify_perms()
1258 if (xidx >= pdb->trans.size) in verify_perms()
1263 if (pdb->perms[i].tag && pdb->perms[i].tag >= pdb->trans.size) in verify_perms()
1266 pdb->perms[i].label >= pdb->trans.size) in verify_perms()
1272 } else if (pdb->trans.size > xmax + 1) { in verify_perms()
1295 rules->file->size)) { in verify_profile()
1302 !verify_dfa_accept_index(rules->policy->dfa, rules->policy->size)) { in verify_profile()
1430 int error = compress_zstd(udata, data->size, &data->data, in compress_loaddata()
1433 data->compressed_size = data->size; in compress_loaddata()
1439 data->compressed_size = data->size; in compress_loaddata()
1465 .end = udata->data + udata->size, in aa_unpack()
1506 udata->hash = aa_calc_hash(udata->data, udata->size); in aa_unpack()