linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot
@ 2015-11-11  2:03 Laura Abbott
  2015-11-11  2:03 ` [PATCH 2/2] arm: kvm: Fix STRICT_MM_TYPECHECK errors Laura Abbott
  2015-11-11  5:51 ` [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot Ard Biesheuvel
  0 siblings, 2 replies; 10+ messages in thread
From: Laura Abbott @ 2015-11-11  2:03 UTC (permalink / raw)
  To: linux-arm-kernel


Several accesses of pgprot values are incorrect when compiled with
STRICT_MM_TYPECHECKS. Use the appropriate pgprot_val/__pgprot wrappers
to access the structures appropriately.

Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
---
Found while working on the set_memory_* work
---
 arch/arm64/mm/mmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index c2fa6b5..83a1162 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -146,7 +146,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr,
 		if (((addr | next | phys) & ~CONT_MASK) == 0) {
 			/* a block of CONT_PTES  */
 			__populate_init_pte(pte, addr, next, phys,
-					    prot | __pgprot(PTE_CONT));
+					 __pgprot(pgprot_val(prot) | PTE_CONT));
 		} else {
 			/*
 			 * If the range being split is already inside of a
@@ -475,7 +475,7 @@ void mark_rodata_ro(void)
 {
 	create_mapping_late(__pa(_stext), (unsigned long)_stext,
 				(unsigned long)_etext - (unsigned long)_stext,
-				PAGE_KERNEL_EXEC | PTE_RDONLY);
+				__pgprot(pgprot_val(PAGE_KERNEL_EXEC) | PTE_RDONLY));
 
 }
 #endif
@@ -691,7 +691,7 @@ void __set_fixmap(enum fixed_addresses idx,
 void *__init fixmap_remap_fdt(phys_addr_t dt_phys)
 {
 	const u64 dt_virt_base = __fix_to_virt(FIX_FDT);
-	pgprot_t prot = PAGE_KERNEL | PTE_RDONLY;
+	pgprot_t prot = __pgprot(pgprot_val(PAGE_KERNEL) | PTE_RDONLY);
 	int size, offset;
 	void *dt_virt;
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-18 12:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-11  2:03 [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot Laura Abbott
2015-11-11  2:03 ` [PATCH 2/2] arm: kvm: Fix STRICT_MM_TYPECHECK errors Laura Abbott
2015-11-14  7:02   ` Ard Biesheuvel
2015-11-11  5:51 ` [PATCH 1/2] arm64: Fix STRICT_MM_TYPECHECKS errors from pgprot Ard Biesheuvel
2015-11-11  6:02   ` Ard Biesheuvel
2015-11-12 20:21     ` [PATCHv2] arm64: Fix R/O permissions in mark_rodata_ro Laura Abbott
2015-11-15  7:38       ` Ard Biesheuvel
2015-11-16 22:50         ` Laura Abbott
2015-11-17  9:56           ` Ard Biesheuvel
2015-11-18 12:14       ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).