mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
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 <nivedita@alum.mit.edu> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200728225722.67457-11-nivedita@alum.mit.edu
This commit is contained in:
parent
bf457be154
commit
79c2fd2afe
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user