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)
committerSteve Capper <steve.capper@linaro.org>
Wed, 5 Mar 2014 07:03:15 +0000 (15:03 +0800)
commit2f43620c2d249a83d45b89a3143f135498cf30ea
tree9e46194021d6ab2ad78f5a6d7efda9de8c67df2a
parent4142fa151d8534e29b1d490567f45354976c6c61
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