diff options
Diffstat (limited to 'security/integrity/ima/ima.h')
-rw-r--r-- | security/integrity/ima/ima.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index 079a85dc37b2..a41c9c18e5e0 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h | |||
@@ -84,11 +84,12 @@ void ima_fs_cleanup(void); | |||
84 | int ima_inode_alloc(struct inode *inode); | 84 | int ima_inode_alloc(struct inode *inode); |
85 | int ima_add_template_entry(struct ima_template_entry *entry, int violation, | 85 | int ima_add_template_entry(struct ima_template_entry *entry, int violation, |
86 | const char *op, struct inode *inode); | 86 | const char *op, struct inode *inode); |
87 | int ima_calc_hash(struct file *file, char *digest); | 87 | int ima_calc_file_hash(struct file *file, char *digest); |
88 | int ima_calc_template_hash(int template_len, void *template, char *digest); | 88 | int ima_calc_buffer_hash(const void *data, int len, char *digest); |
89 | int ima_calc_boot_aggregate(char *digest); | 89 | int ima_calc_boot_aggregate(char *digest); |
90 | void ima_add_violation(struct inode *inode, const unsigned char *filename, | 90 | void ima_add_violation(struct inode *inode, const unsigned char *filename, |
91 | const char *op, const char *cause); | 91 | const char *op, const char *cause); |
92 | int ima_init_crypto(void); | ||
92 | 93 | ||
93 | /* | 94 | /* |
94 | * used to protect h_table and sha_table | 95 | * used to protect h_table and sha_table |
@@ -119,6 +120,7 @@ void ima_audit_measurement(struct integrity_iint_cache *iint, | |||
119 | int ima_store_template(struct ima_template_entry *entry, int violation, | 120 | int ima_store_template(struct ima_template_entry *entry, int violation, |
120 | struct inode *inode); | 121 | struct inode *inode); |
121 | void ima_template_show(struct seq_file *m, void *e, enum ima_show_type show); | 122 | void ima_template_show(struct seq_file *m, void *e, enum ima_show_type show); |
123 | const char *ima_d_path(struct path *path, char **pathbuf); | ||
122 | 124 | ||
123 | /* rbtree tree calls to lookup, insert, delete | 125 | /* rbtree tree calls to lookup, insert, delete |
124 | * integrity data associated with an inode. | 126 | * integrity data associated with an inode. |
@@ -127,7 +129,7 @@ struct integrity_iint_cache *integrity_iint_insert(struct inode *inode); | |||
127 | struct integrity_iint_cache *integrity_iint_find(struct inode *inode); | 129 | struct integrity_iint_cache *integrity_iint_find(struct inode *inode); |
128 | 130 | ||
129 | /* IMA policy related functions */ | 131 | /* IMA policy related functions */ |
130 | enum ima_hooks { FILE_CHECK = 1, FILE_MMAP, BPRM_CHECK, MODULE_CHECK, POST_SETATTR }; | 132 | enum ima_hooks { FILE_CHECK = 1, MMAP_CHECK, BPRM_CHECK, MODULE_CHECK, POST_SETATTR }; |
131 | 133 | ||
132 | int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask, | 134 | int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask, |
133 | int flags); | 135 | int flags); |
@@ -142,13 +144,16 @@ void ima_delete_rules(void); | |||
142 | #define IMA_APPRAISE_MODULES 0x04 | 144 | #define IMA_APPRAISE_MODULES 0x04 |
143 | 145 | ||
144 | #ifdef CONFIG_IMA_APPRAISE | 146 | #ifdef CONFIG_IMA_APPRAISE |
145 | int ima_appraise_measurement(struct integrity_iint_cache *iint, | 147 | int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, |
146 | struct file *file, const unsigned char *filename); | 148 | struct file *file, const unsigned char *filename); |
147 | int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func); | 149 | int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func); |
148 | void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file); | 150 | void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file); |
151 | enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint, | ||
152 | int func); | ||
149 | 153 | ||
150 | #else | 154 | #else |
151 | static inline int ima_appraise_measurement(struct integrity_iint_cache *iint, | 155 | static inline int ima_appraise_measurement(int func, |
156 | struct integrity_iint_cache *iint, | ||
152 | struct file *file, | 157 | struct file *file, |
153 | const unsigned char *filename) | 158 | const unsigned char *filename) |
154 | { | 159 | { |
@@ -165,6 +170,12 @@ static inline void ima_update_xattr(struct integrity_iint_cache *iint, | |||
165 | struct file *file) | 170 | struct file *file) |
166 | { | 171 | { |
167 | } | 172 | } |
173 | |||
174 | static inline enum integrity_status ima_get_cache_status(struct integrity_iint_cache | ||
175 | *iint, int func) | ||
176 | { | ||
177 | return INTEGRITY_UNKNOWN; | ||
178 | } | ||
168 | #endif | 179 | #endif |
169 | 180 | ||
170 | /* LSM based policy rules require audit */ | 181 | /* LSM based policy rules require audit */ |