Skip to content

Commit 6daa2ec

Browse files
Baoquan HeIngo Molnar
authored andcommitted
x86/KASLR: Fix boot crash with certain memory configurations
Ye Xiaolong reported this boot crash: | | XZ-compressed data is corrupt | | -- System halted | Fix the bug in mem_avoid_overlap() of finding the earliest overlap. Reported-and-tested-by: Ye Xiaolong <xiaolong.ye@intel.com> Signed-off-by: Baoquan He <bhe@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent dbf984d commit 6daa2ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/boot/compressed/kaslr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static bool mem_avoid_overlap(struct mem_vector *img,
285285
if (mem_overlaps(img, &mem_avoid[i]) &&
286286
mem_avoid[i].start < earliest) {
287287
*overlap = mem_avoid[i];
288+
earliest = overlap->start;
288289
is_overlapping = true;
289290
}
290291
}
@@ -299,6 +300,7 @@ static bool mem_avoid_overlap(struct mem_vector *img,
299300

300301
if (mem_overlaps(img, &avoid) && (avoid.start < earliest)) {
301302
*overlap = avoid;
303+
earliest = overlap->start;
302304
is_overlapping = true;
303305
}
304306

0 commit comments

Comments
 (0)