]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/mm: Add warning for outside range requests in vmemmap_populate()
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 5 Jan 2021 11:24:11 +0000 (16:54 +0530)
committerWill Deacon <will@kernel.org>
Wed, 20 Jan 2021 12:27:57 +0000 (12:27 +0000)
commit523632cf3d861b54949d1056e022e4826d3b1c12
tree254d33c2726a48ce74b07e67c1c18aa97ae9fb5b
parentb42d5d175e1145b9c5ae90578ab5f224ba0aba45
arm64/mm: Add warning for outside range requests in vmemmap_populate()

vmemmap_populate() does not validate the requested vmemmap address range to
be inside the platform assigned space i.e [VMEMMAP_START..VMEMMAP_END] for
vmemmap. Instead it would just go ahead and create the mapping which might
then overlap with other sections in the kernel virtual address space.

Just adding an warning here for range overrun which would help detect the
problem earlier on, before a potential struct page corruption. This also
makes vmemmap_populate() symmetrical with vmemmap_free() which already has
a similar warning.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/1609845851-25064-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/mmu.c