Skip to content

Commit

Permalink
powerpc/kasan: Fix kasan_remap_early_shadow_ro()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: cbd1899 ("powerpc/mm: Fix an Oops in kasan_mmu_init()")
Cc: [email protected]
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/4e7b56865e01569058914c991143f5961b5d4719.1583507333.git.christophe.leroy@c-s.fr
  • Loading branch information
chleroy authored and mpe committed Mar 25, 2020
1 parent eb4f8e2 commit af92bad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/kasan/kasan_init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void __init kasan_remap_early_shadow_ro(void)

kasan_populate_pte(kasan_early_shadow_pte, prot);

for (k_cur = k_start & PAGE_MASK; k_cur < k_end; k_cur += PAGE_SIZE) {
for (k_cur = k_start & PAGE_MASK; k_cur != k_end; k_cur += PAGE_SIZE) {
pmd_t *pmd = pmd_ptr_k(k_cur);
pte_t *ptep = pte_offset_kernel(pmd, k_cur);

Expand Down

0 comments on commit af92bad

Please sign in to comment.