x86/crash: Correct the address boundary of function parameters
authorLianbo Jiang <lijiang@redhat.com>
Tue, 4 Aug 2020 04:49:31 +0000 (12:49 +0800)
committerIngo Molnar <mingo@kernel.org>
Thu, 6 Aug 2020 23:32:00 +0000 (01:32 +0200)
Let's carefully handle the boundary of the function parameter to make
sure that the arguments passed doesn't exceed the address range.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Dave Young <dyoung@redhat.com>
Link: https://lore.kernel.org/r/20200804044933.1973-2-lijiang@redhat.com
arch/x86/kernel/crash.c

index fd87b59..a8f3af2 100644 (file)
@@ -230,7 +230,7 @@ static int elf_header_exclude_ranges(struct crash_mem *cmem)
        int ret = 0;
 
        /* Exclude the low 1M because it is always reserved */
-       ret = crash_exclude_mem_range(cmem, 0, 1<<20);
+       ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
        if (ret)
                return ret;