diff options
Diffstat (limited to 'security/integrity/ima/ima_main.c')
-rw-r--r-- | security/integrity/ima/ima_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); */ int ima_module_check(struct file *file) { - if (!file) - return -EACCES; /* INTEGRITY_UNKNOWN */ + if (!file) { +#ifndef CONFIG_MODULE_SIG_FORCE + if (ima_appraise & IMA_APPRAISE_MODULES) + return -EACCES; /* INTEGRITY_UNKNOWN */ +#endif + return 0; /* We rely on module signature checking */ + } return process_measurement(file, file->f_dentry->d_name.name, MAY_EXEC, MODULE_CHECK); } |