]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - kernel/kexec_file.c
PCI / PM: Always check PME wakeup capability for runtime wakeup support
[mirror_ubuntu-artful-kernel.git] / kernel / kexec_file.c
index 9f48f441229720b0e02434b2375b61d9c62b7706..7da87007c2026687ad1cbc1e630b591ddc51a3dc 100644 (file)
@@ -255,6 +255,12 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
        if (!capable(CAP_SYS_BOOT) || kexec_load_disabled)
                return -EPERM;
 
+       /* Don't permit images to be loaded into trusted kernels if we're not
+        * going to verify the signature on them
+        */
+       if (!IS_ENABLED(CONFIG_KEXEC_VERIFY_SIG) && kernel_is_locked_down())
+               return -EPERM;
+
        /* Make sure we have a legal set of flags */
        if (flags != (flags & KEXEC_FILE_FLAGS))
                return -EINVAL;