]> www.infradead.org Git - users/willy/linux.git/commitdiff
ima: add error mesage to kexec_load
authorMimi Zohar <zohar@linux.ibm.com>
Fri, 16 Nov 2018 02:02:54 +0000 (21:02 -0500)
committerMimi Zohar <zohar@linux.ibm.com>
Mon, 19 Nov 2018 21:27:03 +0000 (16:27 -0500)
Reject the kexec_load syscall with some indication of the problem.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_main.c

index 41e4771980d5af83e7e4f34e5ee2f3bc7eb89e1b..df0b2ee49fa2517853b1fd1de7ab06fe91627e41 100644 (file)
@@ -513,8 +513,10 @@ int ima_load_data(enum kernel_load_data_id id)
        switch (id) {
        case LOADING_KEXEC_IMAGE:
                if (IS_ENABLED(CONFIG_KEXEC_VERIFY_SIG)
-                   && arch_ima_get_secureboot())
+                   && arch_ima_get_secureboot()) {
+                       pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.\n");
                        return -EACCES;
+               }
 
                if (ima_enforce && (ima_appraise & IMA_APPRAISE_KEXEC)) {
                        pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.\n");