]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: mm: Ensure tail of unaligned initrd is reserved
authorBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 18 Apr 2019 04:29:29 +0000 (21:29 -0700)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 23 Apr 2019 09:56:24 +0000 (10:56 +0100)
commit0de192362608978a0a5dc3335a9bb8e5941904df
treeebe9dab3dcc03344ca8f47f3b00e6c37242bde02
parent1235a6abd75c8d03bfe89d705a905fafada5e45f
arm64: mm: Ensure tail of unaligned initrd is reserved

In the event that the start address of the initrd is not aligned, but
has an aligned size, the base + size will not cover the entire initrd
image and there is a chance that the kernel will corrupt the tail of the
image.

By aligning the end of the initrd to a page boundary and then
subtracting the adjusted start address the memblock reservation will
cover all pages that contains the initrd.

Fixes: 5bd477a35bcb ("arm64: Utilize phys_initrd_start/phys_initrd_size")
Cc: stable@vger.kernel.org
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/init.c