linux/arch/arm
Philip Derrin 3b0c0c922f ARM: 8721/1: mm: dump: check hardware RO bit for LPAE
When CONFIG_ARM_LPAE is set, the PMD dump relies on the software
read-only bit to determine whether a page is writable. This
concealed a bug which left the kernel text section writable
(AP2=0) while marked read-only in the software bit.

In a kernel with the AP2 bug, the dump looks like this:

    ---[ Kernel Mapping ]---
    0xc0000000-0xc0200000           2M RW NX SHD
    0xc0200000-0xc0600000           4M ro x  SHD
    0xc0600000-0xc0800000           2M ro NX SHD
    0xc0800000-0xc4800000          64M RW NX SHD

The fix is to check that the software and hardware bits are both
set before displaying "ro". The dump then shows the true perms:

    ---[ Kernel Mapping ]---
    0xc0000000-0xc0200000           2M RW NX SHD
    0xc0200000-0xc0600000           4M RW x  SHD
    0xc0600000-0xc0800000           2M RW NX SHD
    0xc0800000-0xc4800000          64M RW NX SHD

Fixes: ded9477984 ("ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE")
Signed-off-by: Philip Derrin <philip@cog.systems>
Tested-by: Neil Dick <neil@cog.systems>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-11-21 15:10:07 +00:00
..
boot ARM: add debug ".edata_real" symbol 2017-11-02 00:10:28 +00:00
common
configs ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
crypto
firmware
include ARM: fix get_user_pages_fast 2017-11-21 14:45:36 +00:00
kernel ARM: 8720/1: ensure dump_instr() checks addr_limit 2017-11-06 12:00:38 +00:00
kvm
lib ARM: implement memset32 & memset64 2017-09-08 18:26:48 -07:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 The diff is dominated by the Allwinner A10/A20 SoCs getting converted to 2017-09-13 11:04:14 -07:00
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci This pull request contains the following core changes: 2017-09-01 15:34:30 +02:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
mach-exynos Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-09-12 06:10:44 -07:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
mach-imx dma-mapping updates for 4.14: 2017-09-12 13:30:06 -07:00
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx This pull request contains the following core changes: 2017-09-01 15:34:30 +02:00
mach-keystone
mach-ks8695
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp This pull request contains the following core changes: 2017-09-01 15:34:30 +02:00
mach-moxart
mach-mv78xx0
mach-mvebu Merge branch 'next/cleanup' into next/soc 2017-09-05 20:29:46 -07:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1 MTD changes for 4.14: 2017-09-09 14:48:21 -07:00
mach-omap2 Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-09-12 06:10:44 -07:00
mach-orion5x
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-09-12 06:10:44 -07:00
mach-qcom
mach-realview
mach-rockchip Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-09-12 06:10:44 -07:00
mach-rpc
mach-s3c24xx ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
mach-s3c64xx
mach-s5pv210
mach-sa1100
mach-shmobile Merge branch 'next/cleanup' into next/soc 2017-09-05 20:29:46 -07:00
mach-socfpga
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tango
mach-tegra ARM: SoC driver updates for v4.14 2017-09-10 20:40:00 -07:00
mach-u300
mach-uniphier
mach-ux500 ARM: ux500: don't select CPUFREQ_DT 2017-08-25 01:34:45 +02:00
mach-versatile
mach-vexpress
mach-vt8500
mach-w90x900
mach-zx
mach-zynq
mm ARM: 8721/1: mm: dump: check hardware RO bit for LPAE 2017-11-21 15:10:07 +00:00
net arm: eBPF JIT compiler 2017-08-22 09:26:43 -07:00
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung
plat-versatile
probes
tools
vdso
vfp
xen
Kconfig Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2017-09-12 06:10:44 -07:00
Kconfig-nommu
Kconfig.debug ARM: make decompressor debug output user selectable 2017-11-21 14:46:11 +00:00
Makefile ARM: 8716/1: pass endianness info to sparse 2017-11-01 19:14:49 +00:00