powerpc/kasan: Fix kasan_remap_early_shadow_ro()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 6 Mar 2020 15:09:40 +0000 (15:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:25 +0000 (10:50 +0200)
commitc1f3e1d8d7e6a06184e3511fd19c41ef8db33447
treecd04bf8565070b3be7aa379610365f48140975b0
parent36b0b1f63994de6528a73b86ad7d8d3e19b3f61a
powerpc/kasan: Fix kasan_remap_early_shadow_ro()

[ Upstream commit af92bad615be75c6c0d1b1c5b48178360250a187 ]

At the moment kasan_remap_early_shadow_ro() does nothing, because
k_end is 0 and k_cur < 0 is always true.

Change the test to k_cur != k_end, as done in
kasan_init_shadow_page_tables()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Fixes: cbd18991e24f ("powerpc/mm: Fix an Oops in kasan_mmu_init()")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/4e7b56865e01569058914c991143f5961b5d4719.1583507333.git.christophe.leroy@c-s.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/mm/kasan/kasan_init_32.c