1 From: Andres Gruenbacher <agruen@suse.de>
2 Subject: Also mark rodata pages executable in mark_rodata_rw()
4 For review: do we also need to mark rodata pages executable in
5 mark_rodata_rw() to fully undo mark_rodata_ro()?
7 Signed-off-by: Andres Gruenbacher <agruen@suse.de>
10 arch/x86/mm/init_64-xen.c | 6 ++++++
11 arch/x86/mm/init_64.c | 6 ++++++
12 2 files changed, 12 insertions(+)
14 Index: b/arch/x86/mm/init_64.c
15 ===================================================================
16 --- a/arch/x86/mm/init_64.c
17 +++ b/arch/x86/mm/init_64.c
18 @@ -912,6 +912,12 @@ void mark_rodata_rw(void)
19 printk(KERN_INFO "Write enabling the kernel read-only data: %luk\n",
21 set_memory_rw_force(start, (end - start) >> PAGE_SHIFT);
24 + * The rodata section should also be executable. (The kernel text
27 + set_memory_x_force(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
29 EXPORT_SYMBOL(mark_rodata_rw);