From: Pekka Paalanen Date: Mon, 12 May 2008 19:21:01 +0000 (+0200) Subject: x86_64: fix kernel rodata NX setting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=72b59d67f80983f7bb587b086fb4cb1bc95263a4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Steven Rostedt Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 41824e776b6c..295be1d07b82 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -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();