]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Revert "powerpc/kasan: Fix shadow pages allocation failure"
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 2 Jul 2020 11:52:02 +0000 (11:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Aug 2020 13:33:39 +0000 (15:33 +0200)
commit b506923ee44ae87fc9f4de16b53feb313623e146 upstream.

This reverts commit d2a91cef9bbdeb87b7449fdab1a6be6000930210.

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: d2a91cef9bbd ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/kasan.h
arch/powerpc/mm/init_32.c
arch/powerpc/mm/kasan/kasan_init_32.c

index b68eeff778065e3459c58da014e76b1fef44ffc0..6db06f58deeda628b18e14604f69dc9fea16ecf6 100644 (file)
 
 #ifdef CONFIG_KASAN
 void kasan_early_init(void);
+void kasan_mmu_init(void);
 void kasan_init(void);
 #else
 static inline void kasan_init(void) { }
+static inline void kasan_mmu_init(void) { }
 #endif
 
 #endif /* __ASSEMBLY */
index 68f7446193d17a702a953c26fe30882b2c3ec842..b04896a88d792eac665d6e239ccbe86c9f2364a4 100644 (file)
@@ -175,6 +175,8 @@ void __init MMU_init(void)
        btext_unmap();
 #endif
 
+       kasan_mmu_init();
+
        setup_kup();
 
        /* Shortly after that, the entire linear mapping will be available */
index b01d4b72eccff171daae9e353f171cc6a83d8ba3..1cfe57b51d7e33561c4d35878c10f2982f1ebf0f 100644 (file)
@@ -129,7 +129,7 @@ static void __init kasan_remap_early_shadow_ro(void)
        flush_tlb_kernel_range(KASAN_SHADOW_START, KASAN_SHADOW_END);
 }
 
-static void __init kasan_mmu_init(void)
+void __init kasan_mmu_init(void)
 {
        int ret;
        struct memblock_region *reg;
@@ -156,8 +156,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);