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

Commit 4a5a8781 authored by Vishwanath Raju K's avatar Vishwanath Raju K Committed by Archit Saxena
Browse files

arm: mm: restrict EXEC to text and init



If CONFIG_FORCE_PAGES is enabled, DATA and RO is set
as EXEC which cause PAN feature failure. Fix it.

Change-Id: I53a09956944fa59973874af2f5f383e7aab46572
Signed-off-by: default avatarVishwanath Raju K <vishk@codeaurora.org>
parent 614c5bbf
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1672,7 +1672,13 @@ static noinline void __init split_pmd(pmd_t *pmd, unsigned long addr,
	pte = start_pte;

	do {
		set_pte_ext(pte, pfn_pte(pfn, type->prot_pte), 0);
		if (((unsigned long)_stext <= addr) &&
			(addr < (unsigned long)__init_end))
			set_pte_ext(pte, pfn_pte(pfn,
				mem_types[MT_MEMORY_RWX].prot_pte), 0);
		else
			set_pte_ext(pte, pfn_pte(pfn,
				mem_types[MT_MEMORY_RW].prot_pte), 0);
		pfn++;
	} while (pte++, addr += PAGE_SIZE, addr != end);