From: Greg Kroah-Hartman Date: Tue, 5 Aug 2014 18:08:42 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.4.102~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f1b05495cd44dc2c12bfc7e9f5c9ed6b74574db;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: x86-espfix-xen-fix-allocation-of-pages-for-paravirt-page-tables.patch --- diff --git a/queue-3.14/series b/queue-3.14/series index 642cad2135c..c963d465485 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -36,3 +36,4 @@ x86-xen-no-need-to-explicitly-register-an-nmi-callback.patch xtensa-add-fixup-for-double-exception-raised-in-window-overflow.patch net-l2tp-don-t-fall-back-on-udp-sockopt.patch lib-btree.c-fix-leak-of-whole-btree-nodes.patch +x86-espfix-xen-fix-allocation-of-pages-for-paravirt-page-tables.patch diff --git a/queue-3.14/x86-espfix-xen-fix-allocation-of-pages-for-paravirt-page-tables.patch b/queue-3.14/x86-espfix-xen-fix-allocation-of-pages-for-paravirt-page-tables.patch new file mode 100644 index 00000000000..25158c73708 --- /dev/null +++ b/queue-3.14/x86-espfix-xen-fix-allocation-of-pages-for-paravirt-page-tables.patch @@ -0,0 +1,58 @@ +From 8762e5092828c4dc0f49da5a47a644c670df77f3 Mon Sep 17 00:00:00 2001 +From: Boris Ostrovsky +Date: Wed, 9 Jul 2014 13:18:18 -0400 +Subject: x86/espfix/xen: Fix allocation of pages for paravirt page tables + +From: Boris Ostrovsky + +commit 8762e5092828c4dc0f49da5a47a644c670df77f3 upstream. + +init_espfix_ap() is currently off by one level when informing hypervisor +that allocated pages will be used for ministacks' page tables. + +The most immediate effect of this on a PV guest is that if +'stack_page = __get_free_page()' returns a non-zeroed-out page the hypervisor +will refuse to use it for a page table (which it shouldn't be anyway). This will +result in warnings by both Xen and Linux. + +More importantly, a subsequent write to that page (again, by a PV guest) is +likely to result in fatal page fault. + +Signed-off-by: Boris Ostrovsky +Link: http://lkml.kernel.org/r/1404926298-5565-1-git-send-email-boris.ostrovsky@oracle.com +Reviewed-by: Konrad Rzeszutek Wilk +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/espfix_64.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/arch/x86/kernel/espfix_64.c ++++ b/arch/x86/kernel/espfix_64.c +@@ -175,7 +175,7 @@ void init_espfix_ap(void) + if (!pud_present(pud)) { + pmd_p = (pmd_t *)__get_free_page(PGALLOC_GFP); + pud = __pud(__pa(pmd_p) | (PGTABLE_PROT & ptemask)); +- paravirt_alloc_pud(&init_mm, __pa(pmd_p) >> PAGE_SHIFT); ++ paravirt_alloc_pmd(&init_mm, __pa(pmd_p) >> PAGE_SHIFT); + for (n = 0; n < ESPFIX_PUD_CLONES; n++) + set_pud(&pud_p[n], pud); + } +@@ -185,7 +185,7 @@ void init_espfix_ap(void) + if (!pmd_present(pmd)) { + pte_p = (pte_t *)__get_free_page(PGALLOC_GFP); + pmd = __pmd(__pa(pte_p) | (PGTABLE_PROT & ptemask)); +- paravirt_alloc_pmd(&init_mm, __pa(pte_p) >> PAGE_SHIFT); ++ paravirt_alloc_pte(&init_mm, __pa(pte_p) >> PAGE_SHIFT); + for (n = 0; n < ESPFIX_PMD_CLONES; n++) + set_pmd(&pmd_p[n], pmd); + } +@@ -193,7 +193,6 @@ void init_espfix_ap(void) + pte_p = pte_offset_kernel(&pmd, addr); + stack_page = (void *)__get_free_page(GFP_KERNEL); + pte = __pte(__pa(stack_page) | (__PAGE_KERNEL_RO & ptemask)); +- paravirt_alloc_pte(&init_mm, __pa(stack_page) >> PAGE_SHIFT); + for (n = 0; n < ESPFIX_PTE_CLONES; n++) + set_pte(&pte_p[n*PTE_STRIDE], pte); +