Skip to content

Commit

Permalink
Revert "powerpc/kasan: Fix shadow pages allocation failure"
Browse files Browse the repository at this point in the history
This reverts commit d2a91ce.

This commit moved too much work in kasan_init(). The allocation
of shadow pages has to be moved for the reason explained in that
patch, but the allocation of page tables still need to be done
before switching to the final hash table.

First revert the incorrect commit, following patch redoes it
properly.

Fixes: d2a91ce ("powerpc/kasan: Fix shadow pages allocation failure")
Cc: stable@vger.kernel.org
Reported-by: Erhard F. <erhard_f@mailbox.org>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=208181
Link: https://lore.kernel.org/r/3667deb0911affbf999b99f87c31c77d5e870cd2.1593690707.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Jul 15, 2020
1 parent 7d38f08 commit b506923
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/kasan.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@

#ifdef CONFIG_KASAN
void kasan_early_init(void);
void kasan_mmu_init(void);
void kasan_init(void);
void kasan_late_init(void);
#else
static inline void kasan_init(void) { }
static inline void kasan_mmu_init(void) { }
static inline void kasan_late_init(void) { }
#endif

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ void __init MMU_init(void)
btext_unmap();
#endif

kasan_mmu_init();

setup_kup();

/* Shortly after that, the entire linear mapping will be available */
Expand Down
4 changes: 1 addition & 3 deletions arch/powerpc/mm/kasan/kasan_init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static void __init kasan_unmap_early_shadow_vmalloc(void)
kasan_update_early_region(k_start, k_end, __pte(0));
}

static void __init kasan_mmu_init(void)
void __init kasan_mmu_init(void)
{
int ret;
struct memblock_region *reg;
Expand Down Expand Up @@ -146,8 +146,6 @@ static void __init kasan_mmu_init(void)

void __init kasan_init(void)
{
kasan_mmu_init();

kasan_remap_early_shadow_ro();

clear_page(kasan_early_shadow_page);
Expand Down

0 comments on commit b506923

Please sign in to comment.