Commit 17050fe1 authored by Ye Weihua's avatar Ye Weihua
Browse files

printk: fix double unlock issue in logbuf_lock

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


CVE: NA

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

The following warning was found while testing the printk:
	pvqspinlock: lock 0xffffffffac56e1ac has corrupted value 0x0!

	[ 3027.446208] WARNING: CPU: 2 PID: 0 at kernel/locking/qspinlock_paravirt.h:498 __pv_queued_spin_unlock_slowpath+0xc0/0xd0
	[ 3027.446283]  ? __pv_queued_spin_unlock_slowpath+0xc0/0xd0
	[ 3027.446285]  __raw_callee_save___pv_queued_spin_unlock_slowpath+0x11/0x24
	[ 3027.446288]  .slowpath+0x9/0x16
	[ 3027.446292]  console_unlock+0x265/0x3e0
	[ 3027.446294]  vprintk_emit+0x12b/0x150
	[ 3027.446298]  printk+0x58/0x73
	[ 3027.446300]  dump_stack_print_info+0x77/0xa0

This problem occurs because logbuf_lock that does not exist in
the later version is not processed when the community patch
793d63aff1ee802d00cf2155182b379570f76c4e ("printk: Drop
console_sem during panic")is adapted. Resolve the problem by
reacquiring the lock before the break.

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