All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/kexec_file: Use inclusive range checks in add_usable_mem()
@ 2026-08-09 16:24 Thorsten Blum
  2026-08-11  6:21 ` Sourabh Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-08-09 16:24 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Sourabh Jain, Hari Bathini,
	Aditya Gupta, Jinjie Ruan, Thiago Jung Bauermann
  Cc: Thorsten Blum, linuxppc-dev, linux-kernel

add_usable_mem() adds usable memory ranges for the kdump kernel.

The ranges are inclusive, but the partial overlap check uses exclusive
comparisons. This skips ranges with base == loc_end or end == loc_base.
Use inclusive comparisons instead.

Fixes: 7c64e21a1c5a ("powerpc/kexec_file: Restrict memory usage of kdump kernel")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/powerpc/kexec/file_load_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
index 8c72e12ea44e..f9e872693ca7 100644
--- a/arch/powerpc/kexec/file_load_64.c
+++ b/arch/powerpc/kexec/file_load_64.c
@@ -113,7 +113,7 @@ static int add_usable_mem(struct umem_info *um_info, u64 base, u64 end)
 		loc_end = um_info->ranges[i].end;
 		if (loc_base >= base && loc_end <= end)
 			add = true;
-		else if (base < loc_end && end > loc_base) {
+		else if (base <= loc_end && end >= loc_base) {
 			if (loc_base < base)
 				loc_base = base;
 			if (loc_end > end)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-12  3:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-09 16:24 [PATCH] powerpc/kexec_file: Use inclusive range checks in add_usable_mem() Thorsten Blum
2026-08-11  6:21 ` Sourabh Jain
2026-08-11 10:55   ` Thorsten Blum
2026-08-12  3:11     ` Sourabh Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.