diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-11-09 09:55:46 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-11-09 14:26:36 +0000 |
commit | fb226c3d7c77b4f99cee675795cc0e70937c56ee (patch) | |
tree | 08f88c1b14952e03fdf797f0ec233923463cfa56 /arch/arm64/mm/mmu.c | |
parent | b219545e9646e9d4089a74029c82ae59645e12ae (diff) | |
download | op-kernel-dev-fb226c3d7c77b4f99cee675795cc0e70937c56ee.zip op-kernel-dev-fb226c3d7c77b4f99cee675795cc0e70937c56ee.tar.gz |
arm64: fix R/O permissions of FDT mapping
The mapping permissions of the FDT are set to 'PAGE_KERNEL | PTE_RDONLY'
in an attempt to map the FDT as read-only. However, not only does this
break at build time under STRICT_MM_TYPECHECKS (since the two terms are
of different types in that case), it also results in both the PTE_WRITE
and PTE_RDONLY attributes to be set, which means the region is still
writable under ARMv8.1 DBM (and an attempted write will simply clear the
PT_RDONLY bit).
So instead, define PAGE_KERNEL_RO (which already has an established
meaning across architectures) and use that instead.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/mm/mmu.c')
-rw-r--r-- | arch/arm64/mm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 2784f05..5e23de5 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -691,7 +691,7 @@ void __set_fixmap(enum fixed_addresses idx, void *__init fixmap_remap_fdt(phys_addr_t dt_phys) { const u64 dt_virt_base = __fix_to_virt(FIX_FDT); - pgprot_t prot = PAGE_KERNEL | PTE_RDONLY; + pgprot_t prot = PAGE_KERNEL_RO; int size, offset; void *dt_virt; |