[tip: x86/kaslr] x86/kaslr: Fix off-by-one error in __process_mem_region()
From: tip-bot2 for Arvind Sankar
Date: Thu Aug 06 2020 - 19:39:41 EST
The following commit has been merged into the x86/kaslr branch of tip:
Commit-ID: 8d1cf8595860f4807f4ff1f8f1fc53e7576e0d71
Gitweb: https://git.kernel.org/tip/8d1cf8595860f4807f4ff1f8f1fc53e7576e0d71
Author: Arvind Sankar <nivedita@xxxxxxxxxxxx>
AuthorDate: Tue, 28 Jul 2020 18:57:06 -04:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00
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 <nivedita@xxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20200728225722.67457-6-nivedita@xxxxxxxxxxxx
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index da45e66..848346f 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;