From 4b0c0a8b3f3e68c74adcd9f4b858e2f1f74b9a71 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 10 Sep 2018 09:15:57 +0200 Subject: [PATCH] 4.4-stable patches added patches: x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch --- queue-4.4/series | 1 + ...tf-fix-up-pte-pfn-conversion-for-pae.patch | 41 +++++++++++++++++++ queue-4.9/series | 1 + 3 files changed, 43 insertions(+) create mode 100644 queue-4.4/series create mode 100644 queue-4.4/x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch create mode 100644 queue-4.9/series diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..af19e7d6c2e --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1 @@ +x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch diff --git a/queue-4.4/x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch b/queue-4.4/x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch new file mode 100644 index 00000000000..0460a327a6b --- /dev/null +++ b/queue-4.4/x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch @@ -0,0 +1,41 @@ +From e14d7dfb41f5807a0c1c26a13f2b8ef16af24935 Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Wed, 27 Jun 2018 17:46:50 +0200 +Subject: x86/speculation/l1tf: Fix up pte->pfn conversion for PAE + +From: Michal Hocko + +commit e14d7dfb41f5807a0c1c26a13f2b8ef16af24935 upstream. + +Jan has noticed that pte_pfn and co. resp. pfn_pte are incorrect for +CONFIG_PAE because phys_addr_t is wider than unsigned long and so the +pte_val reps. shift left would get truncated. Fix this up by using proper +types. + +[Just one chunk, again, needed here. Thanks to Ben and Guenter for +finding and fixing this. - gregkh] + +Fixes: 6b28baca9b1f ("x86/speculation/l1tf: Protect PROT_NONE PTEs against speculation") +Reported-by: Jan Beulich +Signed-off-by: Michal Hocko +Signed-off-by: Thomas Gleixner +Acked-by: Vlastimil Babka +Cc: Guenter Roeck +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/pgtable.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/include/asm/pgtable.h ++++ b/arch/x86/include/asm/pgtable.h +@@ -385,7 +385,7 @@ static inline pmd_t pfn_pmd(unsigned lon + + static inline pud_t pfn_pud(unsigned long page_nr, pgprot_t pgprot) + { +- phys_addr_t pfn = page_nr << PAGE_SHIFT; ++ phys_addr_t pfn = (phys_addr_t)page_nr << PAGE_SHIFT; + pfn ^= protnone_mask(pgprot_val(pgprot)); + pfn &= PHYSICAL_PUD_PAGE_MASK; + return __pud(pfn | massage_pgprot(pgprot)); diff --git a/queue-4.9/series b/queue-4.9/series new file mode 100644 index 00000000000..af19e7d6c2e --- /dev/null +++ b/queue-4.9/series @@ -0,0 +1 @@ +x86-speculation-l1tf-fix-up-pte-pfn-conversion-for-pae.patch -- 2.47.2