[PATCH] arm/kasan: remove the unused code for kasan_pgd_populate
From: Hailong liu <hidden>
Date: 2021-01-09 05:52:38
Subsystem:
arm port, kasan, the rest · Maintainers:
Russell King, Andrey Ryabinin, Linus Torvalds
From: Hailong liu <hidden>
Date: 2021-01-09 05:52:38
Subsystem:
arm port, kasan, the rest · Maintainers:
Russell King, Andrey Ryabinin, Linus Torvalds
From: Hailong liu <redacted> First, for arm architecture the pgdp is always the same as pmdp. So if we alloc a table and fill in the entry then it will be overlay later by the kasan_pmd_populate(), then there will be a leak for the table alloced kasan_pgd_populate(). On the other hand, pgd_none() always return 0 for arm and therefore this branch will never be walked. Signed-off-by: Hailong liu <redacted> --- arch/arm/mm/kasan_init.c | 15 --------------- 1 file changed, 15 deletions(-)
diff --git a/arch/arm/mm/kasan_init.c b/arch/arm/mm/kasan_init.c
index 9c348042a724..f0e591f7e430 100644
--- a/arch/arm/mm/kasan_init.c
+++ b/arch/arm/mm/kasan_init.c@@ -126,21 +126,6 @@ static void __init kasan_pgd_populate(unsigned long addr, unsigned long end, pgdp = pgd_offset_k(addr); do { - /* - * Allocate and populate the shadow block of p4d folded into - * pud folded into pmd if it doesn't already exist - */ - if (!early && pgd_none(*pgdp)) { - void *p = kasan_alloc_block(PAGE_SIZE); - - if (!p) { - panic("%s failed to allocate shadow block for address 0x%lx\n", - __func__, addr); - return; - } - pgd_populate(&init_mm, pgdp, p); - } - next = pgd_addr_end(addr, end); /* * We just immediately jump over the p4d and pud page
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel