openrisc: fix SMP tlb flush NULL pointer dereference
authorStafford Horne <shorne@gmail.com>
Wed, 3 Nov 2021 11:19:33 +0000 (20:19 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:06 +0000 (19:17 +0100)
commitf48a13b3ec59d1bcd7d1efe04b222f433c4a76e1
treed74334573158d01db22b551cd08bb5beb20e64b7
parent2e746ef502c9aa6801eafad4b76d4a5c62660bef
openrisc: fix SMP tlb flush NULL pointer dereference

[ Upstream commit 27dff9a9c247d4e38d82c2e7234914cfe8499294 ]

Throughout the OpenRISC kernel port VMA is passed as NULL when flushing
kernel tlb entries.  Somehow this was missed when I was testing
c28b27416da9 ("openrisc: Implement proper SMP tlb flushing") and now the
SMP kernel fails to completely boot.

In OpenRISC VMA is used only to determine which cores need to have their
TLB entries flushed.

This patch updates the logic to flush tlbs on all cores when the VMA is
passed as NULL.  Also, we update places VMA is passed as NULL to use
flush_tlb_kernel_range instead.  Now, the only place VMA is passed as
NULL is in the implementation of flush_tlb_kernel_range.

Fixes: c28b27416da9 ("openrisc: Implement proper SMP tlb flushing")
Reported-by: Jan Henrik Weinstock <jan.weinstock@rwth-aachen.de>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/openrisc/kernel/dma.c
arch/openrisc/kernel/smp.c