Lines Matching refs:template_desc
106 struct ima_template_desc *template_desc; in ima_template_setup() local
119 template_desc = lookup_template_desc(str); in ima_template_setup()
120 if (!template_desc) { in ima_template_setup()
136 ima_template = template_desc; in ima_template_setup()
165 struct ima_template_desc *template_desc; in lookup_template_desc() local
169 list_for_each_entry_rcu(template_desc, &defined_templates, list) { in lookup_template_desc()
170 if ((strcmp(template_desc->name, name) == 0) || in lookup_template_desc()
171 (strcmp(template_desc->fmt, name) == 0)) { in lookup_template_desc()
177 return found ? template_desc : NULL; in lookup_template_desc()
327 struct ima_template_desc *template_desc = NULL; in restore_template_fmt() local
337 template_desc = kzalloc(sizeof(*template_desc), GFP_KERNEL); in restore_template_fmt()
338 if (!template_desc) in restore_template_fmt()
341 template_desc->name = ""; in restore_template_fmt()
342 template_desc->fmt = kstrdup(template_name, GFP_KERNEL); in restore_template_fmt()
343 if (!template_desc->fmt) { in restore_template_fmt()
344 kfree(template_desc); in restore_template_fmt()
345 template_desc = NULL; in restore_template_fmt()
350 list_add_tail_rcu(&template_desc->list, &defined_templates); in restore_template_fmt()
353 return template_desc; in restore_template_fmt()
356 static int ima_restore_template_data(struct ima_template_desc *template_desc, in ima_restore_template_data() argument
366 template_desc->num_fields), GFP_NOFS); in ima_restore_template_data()
380 NULL, template_desc->num_fields, in ima_restore_template_data()
389 (*entry)->template_desc = template_desc; in ima_restore_template_data()
390 for (i = 0; i < template_desc->num_fields; i++) { in ima_restore_template_data()
428 struct ima_template_desc *template_desc; in ima_restore_measurement_list() local
489 template_desc = lookup_template_desc(template_name); in ima_restore_measurement_list()
490 if (!template_desc) { in ima_restore_measurement_list()
491 template_desc = restore_template_fmt(template_name); in ima_restore_measurement_list()
492 if (!template_desc) in ima_restore_measurement_list()
500 ret = template_desc_init_fields(template_desc->fmt, in ima_restore_measurement_list()
501 &(template_desc->fields), in ima_restore_measurement_list()
502 &(template_desc->num_fields)); in ima_restore_measurement_list()
505 template_desc->fmt); in ima_restore_measurement_list()
510 ret = ima_restore_template_data(template_desc, in ima_restore_measurement_list()