aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima
diff options
context:
space:
mode:
Diffstat (limited to 'security/integrity/ima')
-rw-r--r--security/integrity/ima/ima.h1
-rw-r--r--security/integrity/ima/ima_main.c9
-rw-r--r--security/integrity/ima/ima_policy.c3
3 files changed, 10 insertions, 3 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index 6e69697fd530..a41c9c18e5e0 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -141,6 +141,7 @@ void ima_delete_rules(void);
141/* Appraise integrity measurements */ 141/* Appraise integrity measurements */
142#define IMA_APPRAISE_ENFORCE 0x01 142#define IMA_APPRAISE_ENFORCE 0x01
143#define IMA_APPRAISE_FIX 0x02 143#define IMA_APPRAISE_FIX 0x02
144#define IMA_APPRAISE_MODULES 0x04
144 145
145#ifdef CONFIG_IMA_APPRAISE 146#ifdef CONFIG_IMA_APPRAISE
146int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, 147int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 3e751a9743a1..5127afcc4b89 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -282,8 +282,13 @@ EXPORT_SYMBOL_GPL(ima_file_check);
282 */ 282 */
283int ima_module_check(struct file *file) 283int ima_module_check(struct file *file)
284{ 284{
285 if (!file) 285 if (!file) {
286 return -EACCES; /* INTEGRITY_UNKNOWN */ 286#ifndef CONFIG_MODULE_SIG_FORCE
287 if (ima_appraise & IMA_APPRAISE_MODULES)
288 return -EACCES; /* INTEGRITY_UNKNOWN */
289#endif
290 return 0; /* We rely on module signature checking */
291 }
287 return process_measurement(file, file->f_dentry->d_name.name, 292 return process_measurement(file, file->f_dentry->d_name.name,
288 MAY_EXEC, MODULE_CHECK); 293 MAY_EXEC, MODULE_CHECK);
289} 294}
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 23f49e37a957..b27535a13a79 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -629,7 +629,8 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
629 } 629 }
630 if (!result && (entry->action == UNKNOWN)) 630 if (!result && (entry->action == UNKNOWN))
631 result = -EINVAL; 631 result = -EINVAL;
632 632 else if (entry->func == MODULE_CHECK)
633 ima_appraise |= IMA_APPRAISE_MODULES;
633 audit_log_format(ab, "res=%d", !result); 634 audit_log_format(ab, "res=%d", !result);
634 audit_log_end(ab); 635 audit_log_end(ab);
635 return result; 636 return result;