]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/kexec_file.c
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / kernel / kexec_file.c
index c72d2ff5896e9f37e21c789d45d7b2cc058be9f0..503bc2d348e59aa2f866a4ad5b79d913419e862b 100644 (file)
@@ -274,8 +274,11 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
                return -EBUSY;
 
        dest_image = &kexec_image;
-       if (flags & KEXEC_FILE_ON_CRASH)
+       if (flags & KEXEC_FILE_ON_CRASH) {
                dest_image = &kexec_crash_image;
+               if (kexec_crash_image)
+                       arch_kexec_unprotect_crashkres();
+       }
 
        if (flags & KEXEC_FILE_UNLOAD)
                goto exchange;
@@ -324,6 +327,9 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
 exchange:
        image = xchg(dest_image, image);
 out:
+       if ((flags & KEXEC_FILE_ON_CRASH) && kexec_crash_image)
+               arch_kexec_protect_crashkres();
+
        mutex_unlock(&kexec_mutex);
        kimage_free(image);
        return ret;