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

Commit 691513f7 authored by Lin Ming's avatar Lin Ming Committed by Thomas Gleixner
Browse files

x86: Resume trampoline must be executable



commit 5bd5a452(x86: Add NX protection for kernel data) marked the
trampoline area NX - which unsurprisingly breaks resume and cpu
hotplug.

Revert the portion of that commit, which touches the trampoline.

Originally-from: Lin Ming <ming.m.lin@intel.com>
LKML-Reference: <1290410581.2405.24.camel@minggr.sh.intel.com>
Cc: Matthieu Castet <castet.matthieu@free.fr>
Cc: Siarhei Liakh <sliakh.lkml@gmail.com>
Cc: Xuxian Jiang <jiang@cs.ncsu.edu>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Andi Kleen <andi@firstfloor.org>
Tested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 84e1c6bb
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -788,7 +788,6 @@ void mark_rodata_ro(void)
	unsigned long rodata_start =
	unsigned long rodata_start =
		((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
		((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
	unsigned long end = (unsigned long) &__end_rodata_hpage_align;
	unsigned long end = (unsigned long) &__end_rodata_hpage_align;
	unsigned long kernel_end = (((unsigned long)&__init_end + HPAGE_SIZE) & HPAGE_MASK);
	unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
	unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
	unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
	unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
	unsigned long data_start = (unsigned long) &_sdata;
	unsigned long data_start = (unsigned long) &_sdata;
@@ -803,7 +802,7 @@ void mark_rodata_ro(void)
	 * The rodata section (but not the kernel text!) should also be
	 * The rodata section (but not the kernel text!) should also be
	 * not-executable.
	 * not-executable.
	 */
	 */
	set_memory_nx(rodata_start, (kernel_end - rodata_start) >> PAGE_SHIFT);
	set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);


	rodata_test();
	rodata_test();