提交 6daa2ec0 编写于 作者: B Baoquan He 提交者: Ingo Molnar

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: NYe Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: NBaoquan 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: NIngo Molnar <mingo@kernel.org>
上级 dbf984d8
...@@ -285,6 +285,7 @@ static bool mem_avoid_overlap(struct mem_vector *img, ...@@ -285,6 +285,7 @@ static bool mem_avoid_overlap(struct mem_vector *img,
if (mem_overlaps(img, &mem_avoid[i]) && if (mem_overlaps(img, &mem_avoid[i]) &&
mem_avoid[i].start < earliest) { mem_avoid[i].start < earliest) {
*overlap = mem_avoid[i]; *overlap = mem_avoid[i];
earliest = overlap->start;
is_overlapping = true; is_overlapping = true;
} }
} }
...@@ -299,6 +300,7 @@ static bool mem_avoid_overlap(struct mem_vector *img, ...@@ -299,6 +300,7 @@ static bool mem_avoid_overlap(struct mem_vector *img,
if (mem_overlaps(img, &avoid) && (avoid.start < earliest)) { if (mem_overlaps(img, &avoid) && (avoid.start < earliest)) {
*overlap = avoid; *overlap = avoid;
earliest = overlap->start;
is_overlapping = true; is_overlapping = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册