Commit bd0b7dc4 authored by Ye Weihua's avatar Ye Weihua
Browse files

printk: avoid deadlock in panic

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I991OV



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

In the process of load testing against panic, a deadlock issue
was discovered. The reason is that in the panic process,
console_unlock doesn't handle the printk_context variable
evenly, causing printk_context to overflow downwards, allowing
vprintk_func to enter the nmi direct branch without disabling
interrupt. Upon holding the logbuf_lock lock, an interrupt
running wake_up_klogd_work_func was called, resulting in a
deadlock.

To avoid this issue, move printk_safe_ext_irqrestore after
check abandon_console_lock_in_panic().

Fixes: 7c2aff38 ([Backport] printk: Drop console_sem during panic)
Signed-off-by: default avatarYe Weihua <yeweihua4@huawei.com>
parent 32bb7b0a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment