Lines Matching refs:data
81 void __aa_loaddata_update(struct aa_loaddata *data, long revision)
83 AA_BUG(!data);
84 AA_BUG(!data->ns);
85 AA_BUG(!mutex_is_locked(&data->ns->lock));
86 AA_BUG(data->revision > revision);
88 data->revision = revision;
89 if ((data->dents[AAFS_LOADDATA_REVISION])) {
92 inode = d_inode(data->dents[AAFS_LOADDATA_DIR]);
95 inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]);
108 return memcmp(l->data, r->data, r->compressed_size ?: r->size) == 0;
129 kvfree(d->data);
150 d->data = kvzalloc(size, GFP_KERNEL);
151 if (!d->data) {
161 /* test if read will be in packed data bounds */
170 * @e: serialized data read head (NOT NULL)
171 * @chunk: start address for chunk of data (NOT NULL)
210 * @e: serialized data extent information (NOT NULL)
214 * check that the next serialized data element is of type X and has a tag
255 static bool unpack_u8(struct aa_ext *e, u8 *data, const char *name)
262 if (data)
263 *data = *((u8 *)e->pos);
273 VISIBLE_IF_KUNIT bool aa_unpack_u32(struct aa_ext *e, u32 *data, const char *name)
280 if (data)
281 *data = le32_to_cpu(get_unaligned((__le32 *) e->pos));
292 VISIBLE_IF_KUNIT bool aa_unpack_u64(struct aa_ext *e, u64 *data, const char *name)
299 if (data)
300 *data = le64_to_cpu(get_unaligned((__le64 *) e->pos));
311 static bool aa_unpack_cap_low(struct aa_ext *e, kernel_cap_t *data, const char *name)
317 data->val = val;
321 static bool aa_unpack_cap_high(struct aa_ext *e, kernel_cap_t *data, const char *name)
327 data->val = (u32)data->val | ((u64)val << 32);
419 * @e: serialized data extent information (NOT NULL)
454 * @e: serialized data extent information (NOT NULL)
780 static u32 strhash(const void *data, u32 len, u32 seed)
782 const char * const *key = data;
789 const struct aa_data *data = obj;
792 return strcmp(data->key, *key);
797 * @e: serialized data extent information (NOT NULL)
811 struct aa_data *data;
1045 if (aa_unpack_nameX(e, AA_STRUCT, "data")) {
1047 profile->data = kzalloc(sizeof(*profile->data), GFP_KERNEL);
1048 if (!profile->data) {
1059 if (rhashtable_init(profile->data, ¶ms)) {
1065 data = kzalloc(sizeof(*data), GFP_KERNEL);
1066 if (!data) {
1072 data->key = key;
1073 data->size = aa_unpack_blob(e, &data->data, NULL);
1074 data->data = kvmemdup(data->data, data->size, GFP_KERNEL);
1075 if (data->size && !data->data) {
1076 kfree_sensitive(data->key);
1077 kfree_sensitive(data);
1082 if (rhashtable_insert_fast(profile->data, &data->head,
1083 profile->data->p)) {
1084 kfree_sensitive(data->key);
1085 kfree_sensitive(data);
1086 info = "failed to insert data to table";
1092 info = "failed to unpack end of key, value data table";
1124 * @e: serialized data read head (NOT NULL)
1369 static int compress_loaddata(struct aa_loaddata *data)
1371 AA_BUG(data->compressed_size > 0);
1378 void *udata = data->data;
1379 int error = compress_zstd(udata, data->size, &data->data,
1380 &data->compressed_size);
1382 data->compressed_size = data->size;
1385 if (udata != data->data)
1388 data->compressed_size = data->size;
1394 * aa_unpack - unpack packed binary profile(s) data loaded from user space
1395 * @udata: user data copied to kmem (NOT NULL)
1399 * Unpack user data and return refcounted allocated profile(s) stored in
1413 .start = udata->data,
1414 .end = udata->data + udata->size,
1415 .pos = udata->data,
1455 udata->hash = aa_calc_hash(udata->data, udata->size);