Thread (10 messages) flat view 10 messages, 2 authors, 2017-06-29
STALE3363d

[PATCH v5 6/7] mm/radix: Fix permissions correctly for interrupt_vectors

From: Balbir Singh <bsingharora@gmail.com>
Date: 2017-06-28 17:04:53
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Commit 9abcc98 introduced marking kernel text as executable,
but missed some bits of the changes from hash_utils_64.c, where
under CONFIG_RELOCATABLE with CONFIG_RELOCATABLE_TEST or a kdump
kernel, if the size of the mapping was less than 1G, we end up
marking the first page (address range 0->mapping_size) as non
executable. As a side-effect none of the exception handlers
work

fixes - Commit 9abcc981de97
("powerpc/mm/radix: Only add X for pages overlapping kernel text")

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/mm/pgtable-radix.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 6dc9923..ec21f97 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -230,6 +230,14 @@ static int __meminit create_physical_mapping(unsigned long start,
 		else
 			prot = PAGE_KERNEL;
 
+		/*
+		 * See the comment in hash_utils_64.c
+		 */
+		if ((PHYSICAL_START > MEMORY_START) &&
+			overlaps_interrupt_vector_text(vaddr,
+							vaddr + mapping_size))
+			prot = PAGE_KERNEL_X;
+
 		rc = radix__map_kernel_page(vaddr, addr, prot, mapping_size);
 		if (rc)
 			return rc;
-- 
2.9.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help