Commit a5b3ab88 authored by Stafford Horne's avatar Stafford Horne Committed by Zheng Zengkai
Browse files

openrisc: fix SMP tlb flush NULL pointer dereference

stable inclusion
from stable-5.10.80
commit 3fe164e7197b7e9cf214671f938aa4b37b0f577e
bugzilla: 185821 https://gitee.com/openeuler/kernel/issues/I4L7CG

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3fe164e7197b7e9cf214671f938aa4b37b0f577e



--------------------------------

[ Upstream commit 27dff9a9 ]

Throughout the OpenRISC kernel port VMA is passed as NULL when flushing
kernel tlb entries.  Somehow this was missed when I was testing
c28b2741 ("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: c28b2741 ("openrisc: Implement proper SMP tlb flushing")
Reported-by: default avatarJan Henrik Weinstock <jan.weinstock@rwth-aachen.de>
Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 99871a0e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment