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:
parent
8f3bfa584e
commit
33eaa58f85
|
@ -159,6 +159,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||||
{
|
{
|
||||||
if (pte_present_exec_user(pte))
|
if (pte_present_exec_user(pte))
|
||||||
__sync_icache_dcache(pte, addr);
|
__sync_icache_dcache(pte, addr);
|
||||||
|
if (!pte_dirty(pte))
|
||||||
|
pte = pte_wrprotect(pte);
|
||||||
set_pte(ptep, pte);
|
set_pte(ptep, pte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue