Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
}