]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.suse/x86-mark_rodata_rw-2.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / x86-mark_rodata_rw-2.patch
1 From: Andres Gruenbacher <agruen@suse.de>
2 Subject: Also mark rodata pages executable in mark_rodata_rw()
3
4 For review: do we also need to mark rodata pages executable in
5 mark_rodata_rw() to fully undo mark_rodata_ro()?
6
7 Signed-off-by: Andres Gruenbacher <agruen@suse.de>
8
9 ---
10 arch/x86/mm/init_64-xen.c | 6 ++++++
11 arch/x86/mm/init_64.c | 6 ++++++
12 2 files changed, 12 insertions(+)
13
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",
20 (end - start) >> 10);
21 set_memory_rw_force(start, (end - start) >> PAGE_SHIFT);
22 +
23 + /*
24 + * The rodata section should also be executable. (The kernel text
25 + * still is!)
26 + */
27 + set_memory_x_force(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
28 }
29 EXPORT_SYMBOL(mark_rodata_rw);
30 #endif