lkml.org 
[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] x86/boot: increase maximum number of avoided KASLR regions
Date
From: Julian Stecklina <jsteckli@amazon.de>

The boot code has a limit of 4 "non-standard" regions to avoid for
KASLR. This limit is easy to reach when supplying memmap= parameters to
the kernel. In this case, KASLR would be disabled.

Increase the limit to avoid turning off KASLR even when the user is
heavily manipulating the memory map.

Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
---
arch/x86/boot/compressed/kaslr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 5657e34..f078d60 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -92,8 +92,8 @@ struct mem_vector {
unsigned long long size;
};

-/* Only supporting at most 4 unusable memmap regions with kaslr */
-#define MAX_MEMMAP_REGIONS 4
+/* Only supporting at most this many unusable memmap regions with kaslr */
+#define MAX_MEMMAP_REGIONS 16

static bool memmap_too_large;

@@ -213,7 +213,7 @@ static void mem_avoid_memmap(char *str)
i++;
}

- /* More than 4 memmaps, fail kaslr */
+ /* Can't store all regions, fail kaslr */
if ((i >= MAX_MEMMAP_REGIONS) && str)
memmap_too_large = true;
}
--
2.7.4
\
 
 \ /
  Last update: 2019-01-30 17:42    [W:0.147 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site