From: Arvind Sankar Date: Tue, 28 Jul 2020 22:57:06 +0000 (-0400) Subject: x86/kaslr: Fix off-by-one error in __process_mem_region() X-Git-Tag: baikal/aarch64/sdk6.1~8233^2~17 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f44978ece147e678c8fa4ec33a741bd7e7a2b50d;p=kernel.git x86/kaslr: Fix off-by-one error in __process_mem_region() In case of an overlap, the beginning of the region should be used even if it is exactly image_size, not just strictly larger. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-6-nivedita@alum.mit.edu --- diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index da45e66cb6e4f..848346fc0dbb6 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -669,7 +669,7 @@ static void __process_mem_region(struct mem_vector *entry, } /* Store beginning of region if holds at least image_size. */ - if (overlap.start > region.start + image_size) { + if (overlap.start >= region.start + image_size) { struct mem_vector beginning; beginning.start = region.start;