mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 01:36:38 +07:00
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: 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>
This commit is contained in:
parent
25b0b44a1c
commit
72b59d67f8
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user