Commit b273866d authored by Larry Finger's avatar Larry Finger Committed by Zheng Zengkai
Browse files

rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled

stable inclusion
from stable-v5.10.93
commit 358a4b054abeb3d48094221138c0adaf3285710a
bugzilla: 186204 https://gitee.com/openeuler/kernel/issues/I5311N

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



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

commit 8b144ded upstream.

Syzbot reports the following WARNING:

[200~raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 1206 at kernel/locking/irqflag-debug.c:10
   warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10

Hardware initialization for the rtl8188cu can run for as long as 350 ms,
and the routine may be called with interrupts disabled. To avoid locking
the machine for this long, the current routine saves the interrupt flags
and enables local interrupts. The problem is that it restores the flags
at the end without disabling local interrupts first.

This patch fixes commit a53268be ("rtlwifi: rtl8192cu: Fix too long
disable of IRQs").

Reported-by: default avatar <syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com>
Cc: stable@vger.kernel.org
Fixes: a53268be ("rtlwifi: rtl8192cu: Fix too long disable of IRQs")
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211215171105.20623-1-Larry.Finger@lwfinger.net


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 1eca0333
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment