Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc55b855

Browse files
hjl-toolsIngo Molnar
authored and
Ingo Molnar
committed
x86/boot/64: Verify alignment of the LOAD segment
Since the x86-64 kernel must be aligned to 2MB, refuse to boot thekernel if the alignment of the LOAD segment isn't a multiple of 2MB.Signed-off-by: H.J. Lu <hjl.tools@gmail.com>Cc: Andy Shevchenko <andy.shevchenko@gmail.com>Cc: Eric Biederman <ebiederm@xmission.com>Cc: H. Peter Anvin <hpa@zytor.com>Cc: Juergen Gross <jgross@suse.com>Cc: Kees Cook <keescook@chromium.org>Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Thomas Gleixner <tglx@linutronix.de>Link:http://lkml.kernel.org/r/CAMe9rOrR7xSJgUfiCoZLuqWUwymRxXPoGBW38%2BpN%3D9g%2ByKNhZw@mail.gmail.comSigned-off-by: Ingo Molnar <mingo@kernel.org>
1 parente3d0359 commitc55b855

File tree

1 file changed

+4
-0
lines changed
  • arch/x86/boot/compressed

1 file changed

+4
-0
lines changed

‎arch/x86/boot/compressed/misc.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ static void parse_elf(void *output)
309309

310310
switch (phdr->p_type) {
311311
casePT_LOAD:
312+
#ifdefCONFIG_X86_64
313+
if ((phdr->p_align %0x200000)!=0)
314+
error("Alignment of LOAD segment isn't multiple of 2MB");
315+
#endif
312316
#ifdefCONFIG_RELOCATABLE
313317
dest=output;
314318
dest+= (phdr->p_paddr-LOAD_PHYSICAL_ADDR);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp