The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/1] x86/boot/compressed: Fix avoiding memmap in physical KASLR
@ 2025-06-10 21:41 Michal Clapinski
  2025-06-10 22:44 ` Pasha Tatashin
  2025-06-21  8:18 ` Ard Biesheuvel
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Clapinski @ 2025-06-10 21:41 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: H. Peter Anvin, Ard Biesheuvel, Michal Clapinski, Dan Williams,
	Pasha Tatashin, linux-kernel

The intent of the code was to cancel KASLR if there are more than 4
memmap args. Unfortunately, it was only doing that if the memmap args
were comma delimited, not if they were entirely separate.
This change fixes it.

Signed-off-by: Michal Clapinski <mclapinski@google.com>
---
I would like KASLR to support more than 4 memmap args. Do you think
I can just increase the MAX_MEMMAP_REGIONS or should I implement
support for the general case?

 arch/x86/boot/compressed/kaslr.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index f03d59ea6e40..4aa9c9781ca7 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -162,9 +162,6 @@ static void mem_avoid_memmap(char *str)
 {
 	static int i;
 
-	if (i >= MAX_MEMMAP_REGIONS)
-		return;
-
 	while (str && (i < MAX_MEMMAP_REGIONS)) {
 		int rc;
 		u64 start, size;
-- 
2.50.0.rc0.642.g800a2b2222-goog


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

end of thread, other threads:[~2025-07-02 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 21:41 [PATCH 1/1] x86/boot/compressed: Fix avoiding memmap in physical KASLR Michal Clapinski
2025-06-10 22:44 ` Pasha Tatashin
2025-06-21  8:18 ` Ard Biesheuvel
2025-06-21  9:51   ` Michał Cłapiński
2025-07-02 15:57     ` Chris Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox