From: Catalin Marinas Date: Wed, 28 Nov 2012 17:06:05 +0000 (+0000) Subject: arm64: Make !dirty ptes read-only X-Git-Tag: firefly_0821_release~3680^2~1500^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=33eaa58f854770dc9c98411a356c98e3a53edfda;p=firefly-linux-kernel-4.4.55.git 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 Cc: --- 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); }