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>
This commit is contained in:
Catalin Marinas 2012-11-28 17:06:05 +00:00
parent 8f3bfa584e
commit 33eaa58f85
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}