]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE
authorMatt Redfearn <matt.redfearn@imgtec.com>
Thu, 31 Mar 2016 09:05:41 +0000 (10:05 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 13 May 2016 12:02:03 +0000 (14:02 +0200)
commit1e5124315a947b4b8c33f72df44586f8d7a601f5
tree1275cca041902f31c5b4cb8b5e6b7776bd246a22
parent6935891cecb6bb3ea2a6e61ff2a808592e85d5e7
MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE

This patch adds KASLR to the MIPS kernel.

Entropy is derived from the banner, which will change every build and
random_get_entropy() which should provide additional runtime entropy.
Additionally the bootloader may pass entropy via the /chosen/kaslr-seed
node in device tree.

The kernel is relocated by up to RANDOMIZE_BASE_MAX_OFFSET bytes from
its link address (PHYSICAL_START). Because relocation happens so early
in the kernel boot, the amount of physical memory has not yet been
determined. This means the only way to limit relocation within the
available memory is via Kconfig.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: kernel-hardening@lists.openwall.com
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12990/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/kernel/relocate.c