linux/include
Ard Biesheuvel f2b9ba871b arm64/kernel: kaslr: reduce module randomization range to 4 GB
We currently have to rely on the GCC large code model for KASLR for
two distinct but related reasons:
- if we enable full randomization, modules will be loaded very far away
  from the core kernel, where they are out of range for ADRP instructions,
- even without full randomization, the fact that the 128 MB module region
  is now no longer fully reserved for kernel modules means that there is
  a very low likelihood that the normal bottom-up allocation of other
  vmalloc regions may collide, and use up the range for other things.

Large model code is suboptimal, given that each symbol reference involves
a literal load that goes through the D-cache, reducing cache utilization.
But more importantly, literals are not instructions but part of .text
nonetheless, and hence mapped with executable permissions.

So let's get rid of our dependency on the large model for KASLR, by:
- reducing the full randomization range to 4 GB, thereby ensuring that
  ADRP references between modules and the kernel are always in range,
- reduce the spillover range to 4 GB as well, so that we fallback to a
  region that is still guaranteed to be in range
- move the randomization window of the core kernel to the middle of the
  VMALLOC space

Note that KASAN always uses the module region outside of the vmalloc space,
so keep the kernel close to that if KASAN is enabled.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-03-08 13:49:26 +00:00
..
acpi ACPICA: Update version to 20180105 2018-02-06 10:32:13 +01:00
asm-generic bug.h: work around GCC PR82365 in BUG() 2018-02-21 15:35:43 -08:00
clocksource
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-01-31 14:22:45 -08:00
drm Fixes for 4.16. I contains fixes for deadlock on runtime suspend on few 2018-02-22 08:39:26 +10:00
dt-bindings MIPS changes for 4.16 2018-02-07 11:22:44 -08:00
keys
kvm KVM changes for 4.16 2018-02-10 13:16:35 -08:00
linux arm64/kernel: kaslr: reduce module randomization range to 4 GB 2018-03-08 13:49:26 +00:00
math-emu
media vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
memory
misc powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
net Various fixes across the tree, the shortlog basically says it all: 2018-02-22 15:17:01 -05:00
pcmcia
ras
rdma IB/uverbs: Use u64_to_user_ptr() not a union 2018-02-15 14:59:45 -07:00
scsi SCSI postmerge on 20180202 2018-02-03 13:07:56 -08:00
soc ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
sound Merge branch 'topic/fixes' into for-linus 2018-02-12 09:36:26 +01:00
target target core: add device action configfs files 2018-01-16 18:05:04 -08:00
trace Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-02-14 17:02:15 -08:00
uapi Merge branch 'fixes-v4.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2018-02-23 15:04:24 -08:00
video fbdev changes for v4.16: 2018-02-07 13:10:43 -08:00
xen