"Ritesh Harjani (IBM)" <[email protected]> writes: > kasan_free_pxd() assumes the page table is always struct page aligned. > But that's not always the case for all architectures. E.g. In case of > powerpc with 64K pagesize, PUD table (of size 4096) comes from slab > cache named pgtable-2^9. Hence instead of page_to_virt(pxd_page()) let's > just directly pass the start of the pxd table which is passed as the 1st > argument. > > This fixes the below double free kasan issue seen with PMEM: > > radix-mmu: Mapped 0x0000047d10000000-0x0000047f90000000 with 2.00 MiB pages > ================================================================== > BUG: KASAN: double-free in kasan_remove_zero_shadow+0x9c4/0xa20 ... > > Fixes: 0207df4fa1a8 ("kernel/memremap, kasan: make ZONE_DEVICE with work with > KASAN") > Cc: [email protected] > Reported-by: Venkat Rao Bagalkote <[email protected]> > Signed-off-by: Ritesh Harjani (IBM) <[email protected]> >
Reviewed-by: Andrey Ryabinin <[email protected]>
