mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-20 09:31:09 +00:00
arm64: Do not pass tagged addresses to __is_lm_address()
commit91cb2c8b07
upstream. Commit519ea6f1c8
("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:519ea6f1c8
("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>
This commit is contained in:
parent
25fd5f8f8a
commit
a2c7d0667c
2 changed files with 2 additions and 2 deletions
|
@ -323,7 +323,7 @@ static inline void *phys_to_virt(phys_addr_t x)
|
|||
#endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */
|
||||
|
||||
#define virt_addr_valid(addr) ({ \
|
||||
__typeof__(addr) __addr = addr; \
|
||||
__typeof__(addr) __addr = __tag_reset(addr); \
|
||||
__is_lm_address(__addr) && pfn_valid(virt_to_pfn(__addr)); \
|
||||
})
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue