1
0
Fork 0
alistair23-linux/arch/powerpc
Christophe Leroy 3184cc4b6f powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32
As seen below, allthough the init sections have been freed, the
associated memory area is still marked as executable in the
page tables.

~ dmesg
[    5.860093] Freeing unused kernel memory: 592K (c0570000 - c0604000)

~ cat /sys/kernel/debug/kernel_page_tables
---[ Start of kernel VM ]---
0xc0000000-0xc0497fff        4704K  rw  X  present dirty accessed shared
0xc0498000-0xc056ffff         864K  rw     present dirty accessed shared
0xc0570000-0xc059ffff         192K  rw  X  present dirty accessed shared
0xc05a0000-0xc7ffffff      125312K  rw     present dirty accessed shared
---[ vmalloc() Area ]---

This patch fixes that.

The implementation is done by reusing the change_page_attr()
function implemented for CONFIG_DEBUG_PAGEALLOC

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-15 22:55:56 +10:00
..
boot powerpc/8xx: Getting rid of remaining use of CONFIG_8xx 2017-08-10 23:32:12 +10:00
configs powerpc/44x/fsp2: Enable eMMC arasan for fsp2 platform 2017-08-10 22:30:04 +10:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-05-02 15:53:46 -07:00
include powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 2017-08-15 22:55:56 +10:00
kernel powerpc/8xx: Reduce DTLB miss handler by one insn 2017-08-15 22:55:55 +10:00
kvm powerpc/mm: Update definitions of DSISR bits 2017-08-03 16:06:43 +10:00
lib powerpc/lib/sstep: Add isel instruction emulation 2017-08-10 22:30:29 +10:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 2017-08-15 22:55:56 +10:00
net bpf: Add jited_len to struct bpf_prog 2017-06-06 15:41:24 -04:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf powerpc/perf/imc: Fix nest events on muti socket system 2017-08-15 20:27:28 +10:00
platforms powerpc/chrp: Store the intended structure 2017-08-15 21:13:13 +10:00
purgatory powerpc: Fix invalid use of register expressions 2017-08-10 22:29:41 +10:00
sysdev powerpc/xmon: Exclude all of xmon from ftrace 2017-08-15 15:30:17 +10:00
tools powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00
xmon powerpc/xmon: Exclude all of xmon from ftrace 2017-08-15 15:30:17 +10:00
Kconfig powerpc/8xx: Do not allow Pinned TLBs with STRICT_KERNEL_RWX or DEBUG_PAGEALLOC 2017-08-15 22:55:54 +10:00
Kconfig.debug powerpc/xmon: Enable disassembly files (compilation changes) 2017-02-15 20:02:42 +11:00
Makefile powerpc/8xx: Getting rid of remaining use of CONFIG_8xx 2017-08-10 23:32:12 +10:00
Makefile.postlink powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00