Skip to contentSkip to conversation

x86/speculation/l1tf: Add assembly guard for xtensa/ia64

PATCH In review Andi Kleen 2 participants 2 messages Aug 15, 2018

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 x86/speculation/l1tf: Add assembly guard for xtensa/ia64

From: Andi Kleen <[email protected]>

The stable backport of the

x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings

patch for 4.4 and 4.9 put new C code for !__HAVE_ARCH_PFN_MODIFY_ALLOWED code outside the assembler ifdef. This breaks the xtensa and ia64 build as reported by 0day which somehow include this file into assembler.

Just add an #ifdef __ASSEMBLY__ around the new code to fix this.

This patch is only needed for 4.9 and 4.4 stable, the newer stables don't have this problem.

Fixes 7c5b42f82c13 ("x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings")
---
 include/asm-generic/pgtable.h | 4 ++++
 1 file changed, 4 insertions(+)
include/asm-generic/pgtable.h +4 -0
index a88ea9e37a25..abc2a1b15dd8 100644
@@ -825,6 +825,7 @@ static inline int pmd_free_pte_page(pmd_t *pmd)
 #endif
 #endif
 
+#ifndef __ASSEMBLY__
 struct file;
 int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
 			unsigned long size, pgprot_t *vma_prot);
@@ -839,6 +840,9 @@ static inline bool arch_has_pfn_modify_check(void)
 {
 	return false;
 }
+
+#endif
+
 #endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
 
 #endif /* !__ASSEMBLY__ */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 11 lines · Andi Kleen

From: Andi Kleen <[email protected]>

The stable backport of the

x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings

patch for 4.4 and 4.9 put new C code for !__HAVE_ARCH_PFN_MODIFY_ALLOWED code outside the assembler ifdef. This breaks the xtensa and ia64 build as reported by 0day which somehow include this file into assembler.

Quoted 7 lines

Just add an #ifdef __ASSEMBLY__ around the new code to fix this.

This patch is only needed for 4.9 and 4.4 stable, the newer stables don't have this problem.

Fixes 7c5b42f82c13 ("x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings")

This should be fixed in the final stable releases. The problem was caused by a couple of missing backports.

Guenter