linux/arch/arm64
Dong Bo 5b7e674de9 arm64: Preventing READ_IMPLIES_EXEC propagation
commit 48f99c8ec0 upstream.

Like arch/arm/, we inherit the READ_IMPLIES_EXEC personality flag across
fork(). This is undesirable for a number of reasons:

  * ELF files that don't require executable stack can end up with it
    anyway

  * We end up performing un-necessary I-cache maintenance when mapping
    what should be non-executable pages

  * Restricting what is executable is generally desirable when defending
    against overflow attacks

This patch clears the personality flag when setting up the personality for
newly spwaned native tasks. Given that semi-recent AArch64 toolchains emit
a non-executable PT_GNU_STACK header, userspace applications can already
not rely on READ_IMPLIES_EXEC so shouldn't be adversely affected by this
change.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Dong Bo <dongbo4@huawei.com>
[will: added comment to compat code, rewrote commit message]
Signed-off-by: Will Deacon <will.deacon@arm.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-10-12 15:27:44 +01:00
..
boot arm64: dts: Add more serial port nodes in APM X-Gene device tree 2014-06-18 12:41:55 +01:00
configs arm64: defconfig update for LTP 2014-06-18 12:40:52 +01:00
crypto crypto: arm64/aes-blk - honour iv_out requirement in CBC and CTR modes 2017-03-16 02:27:04 +00:00
include arm64: Preventing READ_IMPLIES_EXEC propagation 2017-10-12 15:27:44 +01:00
kernel arm64: avoid returning from bad_mode 2017-03-16 02:27:02 +00:00
kvm arm64: KVM: Allow unaligned accesses at EL2 2017-09-15 18:30:04 +01:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-27 11:21:47 +00:00
mm arm64: debug: unmask PSTATE.D earlier 2016-11-20 01:16:54 +00:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: errata: add module build workaround for erratum #843419 2015-10-06 11:52:29 +01:00
Kconfig.debug arm64: remove arch specific earlyprintk 2014-04-24 16:32:27 -07:00
Makefile arm64: errata: Add -mpc-relative-literal-loads to build flags 2016-02-17 10:22:40 +00:00