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

Commit b33d84b0 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Gerrit - the friendly Code Review server
Browse files

BACKPORT: 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: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit fb226c3d7c77b4f99cee675795cc0e70937c56ee)

[ghackmann@google.com: only take the PAGE_KERNEL_RO definition, since
 the FDT mapping code in question doesn't exist in 3.18]
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
Change-Id: I9c0e0e342f94bd76cff34643aa9f9a9327b43fb5
Git-Commit: e906a210
Git-repo: git://android.googlesource.com/kernel/common.git


Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 2c80f773
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment