summaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2012-11-28 18:06:05 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2012-11-29 16:32:13 +0100
commit33eaa58f854770dc9c98411a356c98e3a53edfda (patch)
tree60f5074db489db6a30e6c32b5c7247e764b81562 /arch/arm64
parentarm64: Convert empty flush_cache_{mm,page} functions to static inline (diff)
downloadlinux-33eaa58f854770dc9c98411a356c98e3a53edfda.tar.xz
linux-33eaa58f854770dc9c98411a356c98e3a53edfda.zip
arm64: Make !dirty ptes read-only
The AArch64 Linux port relies on the mm code to wrprotect clean ptes. This however is not the case with newly created ptes and PAGE_SHARED(_EXEC) is writable but !dirty. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/include/asm/pgtable.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 8960239be722..937ae2064682 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -159,6 +159,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
{
if (pte_present_exec_user(pte))
__sync_icache_dcache(pte, addr);
+ if (!pte_dirty(pte))
+ pte = pte_wrprotect(pte);
set_pte(ptep, pte);
}