]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - kernel/kexec.c
x86/spec_ctrl: Add lock to serialize changes to ibrs and ibpb control
[mirror_ubuntu-artful-kernel.git] / kernel / kexec.c
index e62ec4dc662060764acc1ad019056d277eeec6a8..37f75d0b75deb9d115e643ea810fca8acb9cbf25 100644 (file)
@@ -201,6 +201,13 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
        if (!capable(CAP_SYS_BOOT) || kexec_load_disabled)
                return -EPERM;
 
+       /*
+        * kexec can be used to circumvent module loading restrictions, so
+        * prevent loading in that case
+        */
+       if (kernel_is_locked_down())
+               return -EPERM;
+
        /*
         * Verify we have a legal set of flags
         * This leaves us room for future extensions.