lkml.org 
[lkml]   [2017]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot
    Date
    From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>

    [ Upstream commit a8f108d70c74d83574c157648383eb2e4285a190 ]

    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>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    ---
    arch/mips/kernel/setup.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
    index 38697f25d168..d64ee5d3cc89 100644
    --- a/arch/mips/kernel/setup.c
    +++ b/arch/mips/kernel/setup.c
    @@ -668,6 +668,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;
    }
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-09-14 19:29    [W:4.171 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site