Lines Matching refs:event_data
344 int ima_eventdigest_init(struct ima_event_data *event_data, in ima_eventdigest_init() argument
357 if (event_data->violation) /* recording a violation. */ in ima_eventdigest_init()
360 if (ima_template_hash_algo_allowed(event_data->iint->ima_hash->algo)) { in ima_eventdigest_init()
361 cur_digest = event_data->iint->ima_hash->digest; in ima_eventdigest_init()
362 cur_digestsize = event_data->iint->ima_hash->length; in ima_eventdigest_init()
366 if ((const char *)event_data->filename == boot_aggregate_name) { in ima_eventdigest_init()
384 if (!event_data->file) /* missing info to re-calculate the digest */ in ima_eventdigest_init()
387 inode = file_inode(event_data->file); in ima_eventdigest_init()
390 result = ima_calc_file_hash(event_data->file, hash_hdr); in ima_eventdigest_init()
393 event_data->filename, "collect_data", in ima_eventdigest_init()
408 int ima_eventdigest_ng_init(struct ima_event_data *event_data, in ima_eventdigest_ng_init() argument
414 if (event_data->violation) /* recording a violation. */ in ima_eventdigest_ng_init()
417 cur_digest = event_data->iint->ima_hash->digest; in ima_eventdigest_ng_init()
418 cur_digestsize = event_data->iint->ima_hash->length; in ima_eventdigest_ng_init()
420 hash_algo = event_data->iint->ima_hash->algo; in ima_eventdigest_ng_init()
431 int ima_eventdigest_ngv2_init(struct ima_event_data *event_data, in ima_eventdigest_ngv2_init() argument
438 if (event_data->violation) /* recording a violation. */ in ima_eventdigest_ngv2_init()
441 cur_digest = event_data->iint->ima_hash->digest; in ima_eventdigest_ngv2_init()
442 cur_digestsize = event_data->iint->ima_hash->length; in ima_eventdigest_ngv2_init()
444 hash_algo = event_data->iint->ima_hash->algo; in ima_eventdigest_ngv2_init()
445 if (event_data->iint->flags & IMA_VERITY_REQUIRED) in ima_eventdigest_ngv2_init()
457 int ima_eventdigest_modsig_init(struct ima_event_data *event_data, in ima_eventdigest_modsig_init() argument
464 if (!event_data->modsig) in ima_eventdigest_modsig_init()
467 if (event_data->violation) { in ima_eventdigest_modsig_init()
475 rc = ima_get_modsig_digest(event_data->modsig, &hash_algo, in ima_eventdigest_modsig_init()
489 static int ima_eventname_init_common(struct ima_event_data *event_data, in ima_eventname_init_common() argument
499 BUG_ON(event_data->filename == NULL && event_data->file == NULL); in ima_eventname_init_common()
501 if (event_data->filename) { in ima_eventname_init_common()
502 cur_filename = event_data->filename; in ima_eventname_init_common()
503 cur_filename_len = strlen(event_data->filename); in ima_eventname_init_common()
509 if (event_data->file) { in ima_eventname_init_common()
511 event_data->file->f_path.dentry); in ima_eventname_init_common()
534 int ima_eventname_init(struct ima_event_data *event_data, in ima_eventname_init() argument
537 return ima_eventname_init_common(event_data, field_data, true); in ima_eventname_init()
543 int ima_eventname_ng_init(struct ima_event_data *event_data, in ima_eventname_ng_init() argument
546 return ima_eventname_init_common(event_data, field_data, false); in ima_eventname_ng_init()
552 int ima_eventsig_init(struct ima_event_data *event_data, in ima_eventsig_init() argument
555 struct evm_ima_xattr_data *xattr_value = event_data->xattr_value; in ima_eventsig_init()
560 return ima_eventevmsig_init(event_data, field_data); in ima_eventsig_init()
562 return ima_write_template_field_data(xattr_value, event_data->xattr_len, in ima_eventsig_init()
570 int ima_eventbuf_init(struct ima_event_data *event_data, in ima_eventbuf_init() argument
573 if ((!event_data->buf) || (event_data->buf_len == 0)) in ima_eventbuf_init()
576 return ima_write_template_field_data(event_data->buf, in ima_eventbuf_init()
577 event_data->buf_len, DATA_FMT_HEX, in ima_eventbuf_init()
585 int ima_eventmodsig_init(struct ima_event_data *event_data, in ima_eventmodsig_init() argument
592 if (!event_data->modsig) in ima_eventmodsig_init()
599 rc = ima_get_raw_modsig(event_data->modsig, &data, &data_len); in ima_eventmodsig_init()
611 int ima_eventevmsig_init(struct ima_event_data *event_data, in ima_eventevmsig_init() argument
617 if (!event_data->file) in ima_eventevmsig_init()
620 rc = vfs_getxattr_alloc(&nop_mnt_idmap, file_dentry(event_data->file), in ima_eventevmsig_init()
636 static int ima_eventinodedac_init_common(struct ima_event_data *event_data, in ima_eventinodedac_init_common() argument
642 if (!event_data->file) in ima_eventinodedac_init_common()
646 id = i_uid_read(file_inode(event_data->file)); in ima_eventinodedac_init_common()
648 id = i_gid_read(file_inode(event_data->file)); in ima_eventinodedac_init_common()
665 int ima_eventinodeuid_init(struct ima_event_data *event_data, in ima_eventinodeuid_init() argument
668 return ima_eventinodedac_init_common(event_data, field_data, true); in ima_eventinodeuid_init()
675 int ima_eventinodegid_init(struct ima_event_data *event_data, in ima_eventinodegid_init() argument
678 return ima_eventinodedac_init_common(event_data, field_data, false); in ima_eventinodegid_init()
685 int ima_eventinodemode_init(struct ima_event_data *event_data, in ima_eventinodemode_init() argument
691 if (!event_data->file) in ima_eventinodemode_init()
694 inode = file_inode(event_data->file); in ima_eventinodemode_init()
703 static int ima_eventinodexattrs_init_common(struct ima_event_data *event_data, in ima_eventinodexattrs_init_common() argument
710 if (!event_data->file) in ima_eventinodexattrs_init_common()
713 rc = evm_read_protected_xattrs(file_dentry(event_data->file), NULL, 0, in ima_eventinodexattrs_init_common()
722 rc = evm_read_protected_xattrs(file_dentry(event_data->file), buffer, in ima_eventinodexattrs_init_common()
740 int ima_eventinodexattrnames_init(struct ima_event_data *event_data, in ima_eventinodexattrnames_init() argument
743 return ima_eventinodexattrs_init_common(event_data, field_data, 'n'); in ima_eventinodexattrnames_init()
750 int ima_eventinodexattrlengths_init(struct ima_event_data *event_data, in ima_eventinodexattrlengths_init() argument
753 return ima_eventinodexattrs_init_common(event_data, field_data, 'l'); in ima_eventinodexattrlengths_init()
760 int ima_eventinodexattrvalues_init(struct ima_event_data *event_data, in ima_eventinodexattrvalues_init() argument
763 return ima_eventinodexattrs_init_common(event_data, field_data, 'v'); in ima_eventinodexattrvalues_init()