summaryrefslogtreecommitdiff
path: root/arch/arm/mm/pgd.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-08-21 11:38:31 +0300
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-08-21 15:55:53 +0300
commita02d8dfd54cdf3b1b0464ccc2c1c4afe2c003a35 (patch)
treeb760333143b1fa4e3de0b6c22c854c67a1e47c4a /arch/arm/mm/pgd.c
parent3c2aed5b28819564e1a07b4686bd89802bcc4d6b (diff)
downloadlinux-a02d8dfd54cdf3b1b0464ccc2c1c4afe2c003a35.tar.xz
ARM: domains: keep vectors in separate domain
Keep the machine vectors in its own domain to avoid software based user access control from making the vector code inaccessible, and thereby deadlocking the machine. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/pgd.c')
-rw-r--r--arch/arm/mm/pgd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index a3681f11dd9f..e683db1b90a3 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -84,6 +84,16 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
if (!new_pte)
goto no_pte;
+#ifndef CONFIG_ARM_LPAE
+ /*
+ * Modify the PTE pointer to have the correct domain. This
+ * needs to be the vectors domain to avoid the low vectors
+ * being unmapped.
+ */
+ pmd_val(*new_pmd) &= ~PMD_DOMAIN_MASK;
+ pmd_val(*new_pmd) |= PMD_DOMAIN(DOMAIN_VECTORS);
+#endif
+
init_pud = pud_offset(init_pgd, 0);
init_pmd = pmd_offset(init_pud, 0);
init_pte = pte_offset_map(init_pmd, 0);