Skip to content

Commit b506923

Browse files
chleroympe
authored andcommitted
Revert "powerpc/kasan: Fix shadow pages allocation failure"
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: [email protected] Reported-by: Erhard F. <[email protected]> Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=208181 Link: https://lore.kernel.org/r/3667deb0911affbf999b99f87c31c77d5e870cd2.1593690707.git.christophe.leroy@csgroup.eu
1 parent 7d38f08 commit b506923

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

arch/powerpc/include/asm/kasan.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727

2828
#ifdef CONFIG_KASAN
2929
void kasan_early_init(void);
30+
void kasan_mmu_init(void);
3031
void kasan_init(void);
3132
void kasan_late_init(void);
3233
#else
3334
static inline void kasan_init(void) { }
35+
static inline void kasan_mmu_init(void) { }
3436
static inline void kasan_late_init(void) { }
3537
#endif
3638

arch/powerpc/mm/init_32.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ void __init MMU_init(void)
171171
btext_unmap();
172172
#endif
173173

174+
kasan_mmu_init();
175+
174176
setup_kup();
175177

176178
/* Shortly after that, the entire linear mapping will be available */

arch/powerpc/mm/kasan/kasan_init_32.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void __init kasan_unmap_early_shadow_vmalloc(void)
117117
kasan_update_early_region(k_start, k_end, __pte(0));
118118
}
119119

120-
static void __init kasan_mmu_init(void)
120+
void __init kasan_mmu_init(void)
121121
{
122122
int ret;
123123
struct memblock_region *reg;
@@ -146,8 +146,6 @@ static void __init kasan_mmu_init(void)
146146

147147
void __init kasan_init(void)
148148
{
149-
kasan_mmu_init();
150-
151149
kasan_remap_early_shadow_ro();
152150

153151
clear_page(kasan_early_shadow_page);

0 commit comments

Comments
 (0)