Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72b59d67 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Thomas Gleixner
Browse files

x86_64: fix kernel rodata NX setting



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: default avatarPekka Paalanen <pq@iki.fi>
Acked-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 25b0b44a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();