summaryrefslogtreecommitdiff
path: root/arch/arm64/mm/physaddr.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2021-02-01 19:06:33 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2021-02-02 17:44:47 +0000
commit91cb2c8b072e00632adf463b78b44f123d46a0fa (patch)
tree4d546dc0bd7591ba1688ec72d9974a029608d1c9 /arch/arm64/mm/physaddr.c
parenta1df829ead5877d4a1061e976a50e2e665a16f24 (diff)
downloadlwn-91cb2c8b072e00632adf463b78b44f123d46a0fa.tar.gz
lwn-91cb2c8b072e00632adf463b78b44f123d46a0fa.zip
arm64: Do not pass tagged addresses to __is_lm_address()
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
Diffstat (limited to 'arch/arm64/mm/physaddr.c')
-rw-r--r--arch/arm64/mm/physaddr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/mm/physaddr.c b/arch/arm64/mm/physaddr.c
index 67a9ba9eaa96..cde44c13dda1 100644
--- a/arch/arm64/mm/physaddr.c
+++ b/arch/arm64/mm/physaddr.c
@@ -9,7 +9,7 @@
phys_addr_t __virt_to_phys(unsigned long x)
{
- WARN(!__is_lm_address(x),
+ WARN(!__is_lm_address(__tag_reset(x)),
"virt_to_phys used for non-linear address: %pK (%pS)\n",
(void *)x,
(void *)x);