powerpc64/kasan: Pass virtual addresses to kasan_init_phys_region()
authorBenjamin Gray <bgray@linux.ibm.com>
Mon, 12 Feb 2024 04:50:20 +0000 (15:50 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 May 2024 14:28:16 +0000 (00:28 +1000)
commit295454eda97b9c5f7a64ac5c2bb827fd15efb623
treecbea45945b708a21896c2ccba274a733bc0e6c54
parentad679719d7020a200c4a10248ebb3bbb374d423d
powerpc64/kasan: Pass virtual addresses to kasan_init_phys_region()

The kasan_init_phys_region() function maps shadow pages necessary for
the ranges of the linear map backed by physical pages. Currently
kasan_init_phys_region() is being passed physical addresses, but
kasan_mem_to_shadow() expects virtual addresses.

It works right now because the lower bits (12:64) of the
kasan_mem_to_shadow() calculation are the same for the real and virtual
addresses, so the actual PTE value is the same in the end. But virtual
addresses are the intended input, so fix it.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240212045020.70364-1-bgray@linux.ibm.com
arch/powerpc/mm/kasan/init_book3e_64.c
arch/powerpc/mm/kasan/init_book3s_64.c