]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/kasan: Force thread size increase with KASAN
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 1 Jun 2022 14:31:14 +0000 (00:31 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 Jun 2022 12:56:47 +0000 (22:56 +1000)
commitaf6ed97ca3fac36e242eca460e5a7d0c7819b1b2
tree107baaf2dc0b2959aeaca60ca9d0bb6a50af255f
parent7be58f62113e71d86234c20f597232d9b1eb544c
powerpc/kasan: Force thread size increase with KASAN

KASAN causes increased stack usage, which can lead to stack overflows.

The logic in Kconfig to suggest a larger default doesn't work if a user
has CONFIG_EXPERT enabled and has an existing .config with a smaller
value.

Follow the lead of x86 and arm64, and force the thread size to be
increased when KASAN is enabled.

That also has the effect of enlarging the stack for 64-bit KASAN builds,
which is also desirable.

Fixes: e1cdf503ddcf ("powerpc/kasan: Fix stack overflow by increasing THREAD_SHIFT")
Reported-by: Erhard Furtner <erhard_f@mailbox.org>
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Use MIN_THREAD_SHIFT as suggested by Christophe]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220601143114.133524-1-mpe@ellerman.id.au
arch/powerpc/Kconfig
arch/powerpc/include/asm/thread_info.h