Skip to content

Commit

Permalink
x86_64: fix kernel rodata NX setting
Browse files Browse the repository at this point in the history
Without CONFIG_DYNAMIC_FTRACE, mark_rodata_ro() would mark a wrong
number of pages as no-execute. The bug was introduced in the patch
"ftrace: dont write protect kernel text". The symptom was machine reboot
after a CPU hotplug.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Pekka Paalanen authored and Thomas Gleixner committed May 23, 2008
1 parent 25b0b44 commit 72b59d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ void mark_rodata_ro(void)
* The rodata section (but not the kernel text!) should also be
* not-executable.
*/
set_memory_nx(rodata_start, (end - start) >> PAGE_SHIFT);
set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);

rodata_test();

Expand Down

0 comments on commit 72b59d6

Please sign in to comment.