[PATCH] efi/libstub/arm64: handle randomized TEXT_OFFSET

Ard Biesheuvel ard.biesheuvel at linaro.org
Tue Apr 24 08:17:30 PDT 2018


On 24 April 2018 at 17:15, Kim Phillips <kim.phillips at arm.com> wrote:
> On Tue, 24 Apr 2018 12:00:58 +0100
> Mark Rutland <mark.rutland at arm.com> wrote:
>
>> When CONFIG_RANDOMIZE_TEXT_OFFSET is selected, TEXT_OFFSET is an
>> arbitrary multiple of PAGE_SIZE in the interval [0, 2MB).
>>
>> The EFI stub doesn't accuont for this, and only handles the case where
>> TEXT_OFFSET is multiple of EFI_KIMG_ALIGN. This can result in the kernel
>> being loaded to an erroneous physical alignment. This has been observed
>> to result in spurious stack overflow reports and failure to make use of
>> the IRQ stacks, and theoretically could result in a number of other
>> issues.
>>
>> We can OR in the low bits of TEXT_OFFSET to ensure that we have the
>> necessary offset (and hence have the necessary alignment), so let's do
>> that.
>>
>> Fixes: 6f26b3671184c36d ("arm64: kaslr: increase randomization granularity")
>> Reported-by: Kim Phillips <kim.phillips at arm.com>
>> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>> Cc: linux-efi at vger.kernel.org
>> ---
>
> Tested-by: Kim Phillips <kim.phillips at arm.com>
>

Thanks all

Queued in efi/urgent.



More information about the linux-arm-kernel mailing list