提交 3fff9494 编写于 作者: C Christophe Leroy 提交者: Zheng Zengkai

powerpc/32: Fix hardlockup on vmap stack overflow

stable inclusion
from stable-v5.10.83
commit dfe906da9a1abebdebe8b15bb3e66a2578f6c4c7
bugzilla: 185879 https://gitee.com/openeuler/kernel/issues/I4QUVG

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

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

commit 5bb60ea6 upstream.

Since the commit c118c730 ("powerpc/32: Fix vmap stack - Do not
activate MMU before reading task struct") a vmap stack overflow
results in a hard lockup. This is because emergency_ctx is still
addressed with its virtual address allthough data MMU is not active
anymore at that time.

Fix it by using a physical address instead.

Fixes: c118c730 ("powerpc/32: Fix vmap stack - Do not activate MMU before reading task struct")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: NChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ce30364fb7ccda489272af4a1612b6aa147e1d23.1637227521.git.christophe.leroy@csgroup.euSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e5b77027
...@@ -333,11 +333,11 @@ ...@@ -333,11 +333,11 @@
mfspr r1, SPRN_SPRG_THREAD mfspr r1, SPRN_SPRG_THREAD
lwz r1, TASK_CPU - THREAD(r1) lwz r1, TASK_CPU - THREAD(r1)
slwi r1, r1, 3 slwi r1, r1, 3
addis r1, r1, emergency_ctx@ha addis r1, r1, emergency_ctx-PAGE_OFFSET@ha
#else #else
lis r1, emergency_ctx@ha lis r1, emergency_ctx-PAGE_OFFSET@ha
#endif #endif
lwz r1, emergency_ctx@l(r1) lwz r1, emergency_ctx-PAGE_OFFSET@l(r1)
addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE
EXCEPTION_PROLOG_2 EXCEPTION_PROLOG_2
SAVE_NVGPRS(r11) SAVE_NVGPRS(r11)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册