]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
MIPS: kexec: Do not reserve invalid crashkernel memory on boot
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Wed, 23 Nov 2016 13:43:50 +0000 (14:43 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Jan 2017 15:34:46 +0000 (16:34 +0100)
Do not reserve memory for the crashkernel if the commandline argument
points to a wrong location. This can happen if the location is specified
wrong or if the same commandline is reused when starting the crashkernel
- in the latter case the reserved memory would point to the location
from which the crashkernel is executing.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14612/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/setup.c

index ae888662bda3cc421192ed6e4198d3e8be5a5ab6..01d1dbde5fbf1eb2e19c11074fdd5ed7d5a89ec3 100644 (file)
@@ -741,6 +741,11 @@ static void __init mips_parse_crashkernel(void)
        if (ret != 0 || crash_size <= 0)
                return;
 
+       if (!memory_region_available(crash_base, crash_size)) {
+               pr_warn("Invalid memory region reserved for crash kernel\n");
+               return;
+       }
+
        crashk_res.start = crash_base;
        crashk_res.end   = crash_base + crash_size - 1;
 }