[PATCH 2/2] arm64: fix R/O permissions of FDT mapping

Ard Biesheuvel ard.biesheuvel at linaro.org
Mon Nov 9 06:36:22 PST 2015


On 9 November 2015 at 15:27, Catalin Marinas <catalin.marinas at arm.com> wrote:
> On Mon, Nov 09, 2015 at 09:55:46AM +0100, Ard Biesheuvel wrote:
>> 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.
>
> I guess we don't need cc stable for this, it's only if the kernel has
> some other bug that writes the mapped fdt.
>

Indeed. Since only v8.1 DBM is affected, and the FDT was writable
anyway before this was added, I don't see the point.

-- 
Ard.



More information about the linux-arm-kernel mailing list