]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: virt_addr_valid must check the address belongs to linear mapping
authorAlexandre Ghiti <alex@ghiti.fr>
Fri, 29 Jan 2021 17:31:05 +0000 (12:31 -0500)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Wed, 3 Feb 2021 02:31:13 +0000 (18:31 -0800)
commit042b8b43c3c116a1b9b8ec8b5c02849fa2ca8da2
tree7b8ad0e5c2d6547e1e42886ce9e28f16af2c7336
parentc34d363cb9bb3d3df914b00046864c1326569017
riscv: virt_addr_valid must check the address belongs to linear mapping

virt_addr_valid macro checks that a virtual address is valid, ie that
the address belongs to the linear mapping and that the corresponding
 physical page exists.

Add the missing check that ensures the virtual address belongs to the
linear mapping, otherwise __virt_to_phys, when compiled with
CONFIG_DEBUG_VIRTUAL enabled, raises a WARN that is interpreted as a
kernel bug by syzbot.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/page.h