Commit c7179964 authored by Michael Ellerman's avatar Michael Ellerman Committed by Zheng Zengkai
Browse files

powerpc/kasan: Force thread size increase with KASAN

stable inclusion
from stable-v5.10.122
commit 7fd03e34f01fef1d060b5fb7bedb6831be3cb42f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7fd03e34f01fef1d060b5fb7bedb6831be3cb42f



--------------------------------

[ Upstream commit 3e8635fb ]

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: edbadaf0 ("powerpc/kasan: Fix stack overflow by increasing THREAD_SHIFT")
Reported-by: default avatarErhard Furtner <erhard_f@mailbox.org>
Reported-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Use MIN_THREAD_SHIFT as suggested by Christophe]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220601143114.133524-1-mpe@ellerman.id.au


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 315c0928
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment