security/integrity/ima/ima.h
Source file repositories/reference/linux-study-clean/security/integrity/ima/ima.h
File Facts
- System
- Linux kernel
- Corpus path
security/integrity/ima/ima.h- Extension
.h- Size
- 20017 bytes
- Lines
- 626
- Domain
- Core OS
- Bucket
- Security And Isolation
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/crypto.hlinux/fs.hlinux/security.hlinux/hash.hlinux/tpm.hlinux/audit.hcrypto/hash_info.h../integrity.h
Detected Declarations
struct ima_algo_descstruct ima_event_datastruct ima_field_datastruct ima_template_fieldstruct ima_template_descstruct ima_template_entrystruct ima_queue_entrystruct ima_kexec_hdrstruct ima_iint_cachestruct modsigstruct ima_key_entryenum ima_show_typeenum tpm_pcrsenum binary_listsenum ima_hooksfunction ima_inode_get_iintfunction ima_inode_set_iintfunction ima_load_kexec_bufferfunction ima_measure_kexec_eventfunction ima_hash_keyfunction ima_init_key_queuefunction ima_queue_keyfunction ima_process_queued_keysfunction ima_check_blacklistfunction ima_appraise_measurementfunction ima_must_appraisefunction ima_update_xattrfunction ima_get_hash_algofunction ima_read_xattrfunction init_ima_appraise_lsmfunction ima_read_modsigfunction ima_collect_modsigfunction ima_get_raw_modsigfunction ima_free_modsigfunction ima_filter_rule_free
Annotated Snippet
struct ima_algo_desc {
struct crypto_shash *tfm;
enum hash_algo algo;
unsigned int digest_size;
};
/* set during initialization */
extern int ima_hash_algo __ro_after_init;
extern int ima_sha1_idx __ro_after_init;
extern int ima_hash_algo_idx __ro_after_init;
extern int ima_extra_slots __ro_after_init;
extern struct ima_algo_desc *ima_algo_array __ro_after_init;
extern int ima_appraise;
extern struct tpm_chip *ima_tpm_chip;
extern const char boot_aggregate_name[];
/* IMA event related data */
struct ima_event_data {
struct ima_iint_cache *iint;
struct file *file;
const unsigned char *filename;
struct evm_ima_xattr_data *xattr_value;
int xattr_len;
const struct modsig *modsig;
const char *violation;
const void *buf;
int buf_len;
};
/* IMA template field data definition */
struct ima_field_data {
u8 *data;
u32 len;
};
/* IMA template field definition */
struct ima_template_field {
const char field_id[IMA_TEMPLATE_FIELD_ID_MAX_LEN];
int (*field_init)(struct ima_event_data *event_data,
struct ima_field_data *field_data);
void (*field_show)(struct seq_file *m, enum ima_show_type show,
struct ima_field_data *field_data);
};
/* IMA template descriptor definition */
struct ima_template_desc {
struct list_head list;
char *name;
char *fmt;
int num_fields;
const struct ima_template_field **fields;
};
struct ima_template_entry {
int pcr;
struct tpm_digest *digests;
struct ima_template_desc *template_desc; /* template descriptor */
u32 template_data_len;
struct ima_field_data template_data[]; /* template related data */
};
struct ima_queue_entry {
struct hlist_node hnext; /* place in hash collision list */
struct list_head later; /* place in ima_measurements list */
struct ima_template_entry *entry;
};
extern struct list_head ima_measurements; /* list of all measurements */
extern struct list_head ima_measurements_staged; /* list of staged meas. */
/* Some details preceding the binary serialized measurement list */
struct ima_kexec_hdr {
u16 version;
u16 _reserved0;
u32 _reserved1;
u64 buffer_size;
u64 count;
};
/* IMA iint action cache flags */
#define IMA_MEASURE 0x00000001
#define IMA_MEASURED 0x00000002
#define IMA_APPRAISE 0x00000004
#define IMA_APPRAISED 0x00000008
/*#define IMA_COLLECT 0x00000010 do not use this flag */
#define IMA_COLLECTED 0x00000020
#define IMA_AUDIT 0x00000040
#define IMA_AUDITED 0x00000080
#define IMA_HASH 0x00000100
#define IMA_HASHED 0x00000200
Annotation
- Immediate include surface: `linux/types.h`, `linux/crypto.h`, `linux/fs.h`, `linux/security.h`, `linux/hash.h`, `linux/tpm.h`, `linux/audit.h`, `crypto/hash_info.h`.
- Detected declarations: `struct ima_algo_desc`, `struct ima_event_data`, `struct ima_field_data`, `struct ima_template_field`, `struct ima_template_desc`, `struct ima_template_entry`, `struct ima_queue_entry`, `struct ima_kexec_hdr`, `struct ima_iint_cache`, `struct modsig`.
- Atlas domain: Core OS / Security And Isolation.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.