ARM64: mm: Make PAGE_NONE pages read only and no-execute.
authorSteve Capper <steve.capper@linaro.org>
Thu, 2 May 2013 15:25:42 +0000 (16:25 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 15 May 2014 18:59:48 +0000 (19:59 +0100)
commit9bdb6ff441dabb89d736317de07c7b943e31052d
treed098f3864b53b79c61a3da83b6a270cdb2a72973
parentbf966f2702f43577b7f7b93db5c4ef2a0bc875a1
ARM64: mm: Make PAGE_NONE pages read only and no-execute.

If we consider the following code sequence:

my_pte = pte_modify(entry, myprot);
x = pte_write(my_pte);
y = pte_exec(my_pte);

If myprot comes from a PROT_NONE page, then x and y will both be
true which is undesireable behaviour.

This patch sets the no-execute and read-only bits for PAGE_NONE
such that the code above will return false for both x and y.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable.h