linux/arch/x86/boot/compressed
Baoquan He b892cb873c x86/boot/KASLR: Add checking for the offset of kernel virtual address randomization
For kernel text KASLR, the virtual address is confined to area of 1G,
[0xffffffff80000000, 0xffffffffc0000000). For the implemenataion of
virtual address randomization, we only randomize to get an offset
between 16M and 1G, then add this offset to the starting address,
0xffffffff80000000. Here 16M is the offset which is decided at linking
stage. So the amount of the local variable 'virt_addr' which respresents
the offset plus the kernel output size can not exceed KERNEL_IMAGE_SIZE.

Add a debug check for the offset. If out of bounds, print error
message and hang there.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Baoquan He <bhe@redhat.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/1498567146-11990-2-git-send-email-bhe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-06-30 08:53:14 +02:00
..
.gitignore
cmdline.c x86/boot: Rename "real_mode" to "boot_params" 2016-04-19 10:30:50 +02:00
cpuflags.c x86, boot: Rename get_flags() and check_flags() to *_cpuflags() 2013-10-13 04:08:56 -07:00
early_serial_console.c x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK 2014-08-17 14:58:24 -07:00
eboot.c Merge branch 'linus' into WIP.x86/boot, to fix up conflicts and to pick up updates 2017-03-01 09:02:26 +01:00
eboot.h efi/libstub: Move Graphics Output Protocol handling to generic code 2016-04-28 11:33:57 +02:00
efi_stub_32.S
efi_stub_64.S x86/efi: Avoid triple faults during EFI mixed mode calls 2015-02-13 15:42:56 +00:00
efi_thunk_64.S x86/efi: Avoid triple faults during EFI mixed mode calls 2015-02-13 15:42:56 +00:00
error.c x86/boot: Fix Sparse warning by including required header file 2017-03-31 08:13:54 +02:00
error.h x86/boot: Declare error() as noreturn 2017-05-07 10:59:05 +02:00
head_32.S x86/efi: Allow invocation of arbitrary runtime services 2017-02-07 10:42:09 +01:00
head_64.S x86/efi: Allow invocation of arbitrary runtime services 2017-02-07 10:42:09 +01:00
kaslr.c x86/KASLR: Fix kexec kernel boot crash when KASLR randomization fails 2017-04-28 08:31:15 +02:00
Makefile x86/boot: Use CROSS_COMPILE prefix for readelf 2017-05-21 13:04:27 +02:00
misc.c x86/boot/KASLR: Add checking for the offset of kernel virtual address randomization 2017-06-30 08:53:14 +02:00
misc.h x86/KASLR: Randomize virtual address separately 2016-06-26 12:32:04 +02:00
mkpiggy.c x86/KASLR: Clean up unused code from old 'run_size' and rename it to 'kernel_total_size' 2016-04-29 11:03:30 +02:00
pagetable.c x86/mm: Add support for gbpages to kernel_ident_mapping_init() 2017-05-08 08:28:40 +02:00
string.c x86/boot: Warn on future overlapping memcpy() use 2016-05-03 08:15:58 +02:00
vmlinux.lds.S x86/boot: Move compressed kernel to the end of the decompression buffer 2016-04-29 11:03:29 +02:00