1
0
Fork 0
alistair23-linux/arch
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
..
alpha tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
arc arc: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:21 +09:00
arm Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
arm64 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
blackfin Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
c6x Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
cris Kbuild updates for v4.13 (2nd) 2017-07-13 13:37:57 -07:00
frv FRV: tlbflush: move asmlinkage before return type 2017-07-12 16:26:04 -07:00
h8300 h8300: Add missing closing parenthesis in flat_get_addr_from_rp() 2017-07-16 09:24:06 -07:00
hexagon hexagon: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:26 +09:00
ia64 Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
m32r Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
m68k blackfin, m68k: Fix flat_set_persistent() for unsigned long to u32 changes 2017-07-16 09:24:06 -07:00
metag metag: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-10 03:43:30 +09:00
microblaze Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
mips tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
mn10300 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
nios2 nios2: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:43 +09:00
openrisc openrisc: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:50 +09:00
parisc TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
powerpc powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32 2017-08-15 22:55:56 +10:00
s390 Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-21 10:41:19 -07:00
score Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-06 22:07:44 -07:00
sh TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
sparc TTY/Serial fixes for 4.13-rc2 2017-07-22 09:00:24 -07:00
tile Merge branch 'work.uaccess-unaligned' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-07-15 11:17:52 -07:00
um Merge branch 'for-linus-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2017-07-15 10:49:33 -07:00
unicore32 unicore32: move generic-y of exported headers to uapi/asm/Kbuild 2017-07-11 21:33:52 +09:00
x86 xen/x86: fix cpu hotplug 2017-07-23 08:13:11 +02:00
xtensa tty: Fix TIOCGPTPEER ioctl definition 2017-07-17 17:04:41 +02:00
.gitignore
Kconfig include/linux/string.h: add the option of fortified string.h functions 2017-07-12 16:26:03 -07:00