From: Thomas Gleixner Date: Mon, 6 Aug 2018 18:56:34 +0000 (+0200) Subject: Merge branch 'x86/pti-urgent' into x86/pti X-Git-Tag: Ubuntu-5.2.0-15.16~3853^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=315706049c343794ad0d3e5b6f6b60b900457b11;p=mirror_ubuntu-eoan-kernel.git Merge branch 'x86/pti-urgent' into x86/pti Integrate the PTI Global bit fixes which conflict with the 32bit PTI support. Signed-off-by: Thomas Gleixner --- 315706049c343794ad0d3e5b6f6b60b900457b11 diff --cc arch/x86/mm/init_64.c index 9b19f9a8948e,68c292cb1ebf..dd519f372169 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@@ -1283,14 -1283,16 +1283,10 @@@ void mark_rodata_ro(void set_memory_ro(start, (end-start) >> PAGE_SHIFT); #endif - free_init_pages("unused kernel", - (unsigned long) __va(__pa_symbol(text_end)), - (unsigned long) __va(__pa_symbol(rodata_start))); - free_init_pages("unused kernel", - (unsigned long) __va(__pa_symbol(rodata_end)), - (unsigned long) __va(__pa_symbol(_sdata))); + free_kernel_image_pages((void *)text_end, (void *)rodata_start); + free_kernel_image_pages((void *)rodata_end, (void *)_sdata); debug_checkwx(); - - /* - * Do this after all of the manipulation of the - * kernel text page tables are complete. - */ - pti_clone_kernel_text(); } int kern_addr_valid(unsigned long addr) diff --cc arch/x86/mm/pti.c index bcf35dac1920,8d88d067b3d7..ef8db6ffc836 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@@ -481,7 -453,8 +488,8 @@@ static void pti_clone_kernel_text(void * clone the areas past rodata, they might contain secrets. */ unsigned long start = PFN_ALIGN(_text); - unsigned long end = (unsigned long)__end_rodata_aligned; - unsigned long end_clone = (unsigned long)__end_rodata_hpage_align; ++ unsigned long end_clone = (unsigned long)__end_rodata_aligned; + unsigned long end_global = PFN_ALIGN((unsigned long)__stop___ex_table); if (!pti_kernel_image_global_ok()) return;