arm64: Do not pass tagged addresses to __is_lm_address()
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 1 Feb 2021 19:06:33 +0000 (19:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2021 14:37:13 +0000 (15:37 +0100)
commita2c7d0667cf3adb94b3b7e96dbc03151e97ab32e
treea62ca67ddbd72e15393422c6c7129ffcc5e7b418
parent25fd5f8f8a234d6ca0c7f71b65a59092b6d4a5f7
arm64: Do not pass tagged addresses to __is_lm_address()

commit 91cb2c8b072e00632adf463b78b44f123d46a0fa upstream.

Commit 519ea6f1c82f ("arm64: Fix kernel address detection of
__is_lm_address()") fixed the incorrect validation of addresses below
PAGE_OFFSET. However, it no longer allowed tagged addresses to be passed
to virt_addr_valid().

Fix this by explicitly resetting the pointer tag prior to invoking
__is_lm_address(). This is consistent with the __lm_to_phys() macro.

Fixes: 519ea6f1c82f ("arm64: Fix kernel address detection of __is_lm_address()")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Cc: <stable@vger.kernel.org> # 5.4.x
Cc: Will Deacon <will@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20210201190634.22942-2-catalin.marinas@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/memory.h
arch/arm64/mm/physaddr.c