From: Greg Kroah-Hartman Date: Sun, 9 Sep 2018 18:00:20 +0000 (+0200) Subject: fix up 4.9 patch X-Git-Tag: v4.9.126~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2291a0dcfc0c08a3d303c340a20f8e91b61c4f4;p=thirdparty%2Fkernel%2Fstable-queue.git fix up 4.9 patch --- diff --git a/queue-4.9/powerpc-fadump-handle-crash-memory-ranges-array-index-overflow.patch b/queue-4.9/powerpc-fadump-handle-crash-memory-ranges-array-index-overflow.patch index 7d745d671a0..8c4ed4e3fb7 100644 --- a/queue-4.9/powerpc-fadump-handle-crash-memory-ranges-array-index-overflow.patch +++ b/queue-4.9/powerpc-fadump-handle-crash-memory-ranges-array-index-overflow.patch @@ -59,8 +59,8 @@ Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/fadump.h | 3 - - arch/powerpc/kernel/fadump.c | 91 ++++++++++++++++++++++++++++++++------ - 2 files changed, 77 insertions(+), 17 deletions(-) + arch/powerpc/kernel/fadump.c | 92 ++++++++++++++++++++++++++++++++------ + 2 files changed, 78 insertions(+), 17 deletions(-) --- a/arch/powerpc/include/asm/fadump.h +++ b/arch/powerpc/include/asm/fadump.h @@ -76,7 +76,15 @@ Signed-off-by: Greg Kroah-Hartman unsigned long long size; --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c -@@ -48,8 +48,10 @@ static struct fadump_mem_struct fdm; +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -48,8 +49,10 @@ static struct fadump_mem_struct fdm; static const struct fadump_mem_struct *fdm_active; static DEFINE_MUTEX(fadump_mutex); @@ -88,7 +96,7 @@ Signed-off-by: Greg Kroah-Hartman /* Scan the Firmware Assisted dump configuration details. */ int __init early_init_dt_scan_fw_dump(unsigned long node, -@@ -731,38 +733,88 @@ static int __init process_fadump(const s +@@ -731,38 +734,88 @@ static int __init process_fadump(const s return 0; } @@ -186,7 +194,7 @@ Signed-off-by: Greg Kroah-Hartman } static int fadump_init_elfcore_header(char *bufp) -@@ -802,10 +854,11 @@ static int fadump_init_elfcore_header(ch +@@ -802,10 +855,11 @@ static int fadump_init_elfcore_header(ch * Traverse through memblock structure and setup crash memory ranges. These * ranges will be used create PT_LOAD program headers in elfcore header. */ @@ -199,7 +207,7 @@ Signed-off-by: Greg Kroah-Hartman pr_debug("Setup crash memory ranges.\n"); crash_mem_ranges = 0; -@@ -816,7 +869,9 @@ static void fadump_setup_crash_memory_ra +@@ -816,7 +870,9 @@ static void fadump_setup_crash_memory_ra * specified during fadump registration. We need to create a separate * program header for this chunk with the correct offset. */ @@ -210,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman for_each_memblock(memory, reg) { start = (unsigned long long)reg->base; -@@ -825,8 +880,12 @@ static void fadump_setup_crash_memory_ra +@@ -825,8 +881,12 @@ static void fadump_setup_crash_memory_ra start = fw_dump.boot_memory_size; /* add this range excluding the reserved dump area. */ @@ -224,7 +232,7 @@ Signed-off-by: Greg Kroah-Hartman } /* -@@ -950,6 +1009,7 @@ static void register_fadump(void) +@@ -950,6 +1010,7 @@ static void register_fadump(void) { unsigned long addr; void *vaddr; @@ -232,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman /* * If no memory is reserved then we can not register for firmware- -@@ -958,7 +1018,9 @@ static void register_fadump(void) +@@ -958,7 +1019,9 @@ static void register_fadump(void) if (!fw_dump.reserve_dump_area_size) return; @@ -243,7 +251,7 @@ Signed-off-by: Greg Kroah-Hartman addr = be64_to_cpu(fdm.rmr_region.destination_address) + be64_to_cpu(fdm.rmr_region.source_len); /* Initialize fadump crash info header. */ -@@ -1036,6 +1098,7 @@ void fadump_cleanup(void) +@@ -1036,6 +1099,7 @@ void fadump_cleanup(void) } else if (fw_dump.dump_registered) { /* Un-register Firmware-assisted dump if it was registered. */ fadump_unregister_dump(&fdm);