From: kim.phillips@arm.com (Kim Phillips) Date: Tue, 24 Apr 2018 10:15:00 -0500 Subject: [PATCH] efi/libstub/arm64: handle randomized TEXT_OFFSET In-Reply-To: <20180424110058.29344-1-mark.rutland@arm.com> References: <20180424110058.29344-1-mark.rutland@arm.com> Message-ID: <20180424101500.e5c032b91e87a354e92344c5@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 24 Apr 2018 12:00:58 +0100 Mark Rutland 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 > Signed-off-by: Mark Rutland > Cc: Ard Biesheuvel > Cc: linux-efi at vger.kernel.org > --- Tested-by: Kim Phillips Thanks, Kim