Commit 33eaa58f authored by Catalin Marinas's avatar Catalin Marinas

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: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: <stable@vger.kernel.org>
parent 8f3bfa58
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment