[PATCH] powerpc/fadump: account for memory_limit while reserving memory

Hari Bathini hbathini at linux.ibm.com
Wed May 27 19:44:35 AEST 2020


If the memory chunk found for reserving memory overshoots the memory
limit imposed, do not proceed with reserving memory. Default behavior
was this until commit 140777a3d8df ("powerpc/fadump: consider reserved
ranges while reserving memory") changed it unwittingly.

Reported-by: kbuild test robot <lkp at intel.com>
Fixes: 140777a3d8df ("powerpc/fadump: consider reserved ranges while reserving memory")
Cc: stable at vger.kernel.org
Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
---

For reference:
- https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-May/211136.html


 arch/powerpc/kernel/fadump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 63aac8b..78ab9a6 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -603,7 +603,7 @@ int __init fadump_reserve_mem(void)
 		 */
 		base = fadump_locate_reserve_mem(base, size);
 
-		if (!base) {
+		if (!base || (base + size > mem_boundary)) {
 			pr_err("Failed to find memory chunk for reservation!\n");
 			goto error_out;
 		}



More information about the Linuxppc-dev mailing list