]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/kasan: Fix parallel loading of modules.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 9 Aug 2019 14:58:09 +0000 (14:58 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 20 Aug 2019 11:22:11 +0000 (21:22 +1000)
commitf138cb886ce33e8697660187b852f090a847699b
tree26ac8609713a9d4803fdf0a53be8c1786f5c960c
parent178c2ed852855bd8a155ffde635f5b34c5d7d991
powerpc/kasan: Fix parallel loading of modules.

Parallel loading of modules may lead to bad setup of shadow page table
entries.

First, lets align modules so that two modules never share the same
shadow page.

Second, ensure that two modules cannot allocate two page tables for
the same PMD entry at the same time. This is done by using
init_mm.page_table_lock in the same way as __pte_alloc_kernel()

Fixes: d54d8e0d3af0 ("powerpc/32: Add KASAN support")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/c97284f912128cbc3f2fe09d68e90e65fb3e6026.1565361876.git.christophe.leroy@c-s.fr
arch/powerpc/mm/kasan/kasan_init_32.c