diff options
author | Arvind Sankar <[email protected]> | 2020-07-28 18:57:11 -0400 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2020-07-31 11:08:17 +0200 |
commit | 79c2fd2afe55944098047721c33e06fd48654e57 (patch) | |
tree | 131e70a443ebe7f9df748890e9675ea0d46d3837 | |
parent | bf457be1548eee6d106daf9604e029b36fed2b11 (diff) |
x86/kaslr: Fix off-by-one error in process_gb_huge_pages()
If the remaining size of the region is exactly 1Gb, there is still one
hugepage that can be reserved.
Signed-off-by: Arvind Sankar <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | arch/x86/boot/compressed/kaslr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index d074986e8061..0df513e3e2ce 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -562,7 +562,7 @@ process_gb_huge_pages(struct mem_vector *region, unsigned long image_size) size = region->size - (addr - region->start); /* Check how many 1GB huge pages can be filtered out: */ - while (size > PUD_SIZE && max_gb_huge_pages) { + while (size >= PUD_SIZE && max_gb_huge_pages) { size -= PUD_SIZE; max_gb_huge_pages--; i++; |