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

Commit 70b3d237 authored by Will Deacon's avatar Will Deacon
Browse files

arm64: mm: Ensure we ignore the initrd if it is placed out of range



If the initrd payload isn't completely accessible via the linear map,
then we print a warning during boot and nobble the virtual address of
the payload so that we ignore it later on.

Unfortunately, since commit c756c592 ("arm64: Utilize
phys_initrd_start/phys_initrd_size"), the virtual address isn't
initialised until later anyway, so we need to nobble the size of the
payload to ensure that we don't try to use it later on.

Fixes: c756c592 ("arm64: Utilize phys_initrd_start/phys_initrd_size")
Reported-by: default avatarPierre Kuo <vichy.kuo@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 92606ec9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ void __init arm64_memblock_init(void)
			 base + size > memblock_start_of_DRAM() +
				       linear_region_size,
			"initrd not fully accessible via the linear mapping -- please check your bootloader ...\n")) {
			initrd_start = 0;
			phys_initrd_size = 0;
		} else {
			memblock_remove(base, size); /* clear MEMBLOCK_ flags */
			memblock_add(base, size);