rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts... 11/293611/2
authorLarry Finger <Larry.Finger@lwfinger.net>
Wed, 15 Dec 2021 17:11:05 +0000 (11:11 -0600)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 1 Jun 2023 08:29:57 +0000 (08:29 +0000)
commit 8b144dedb928e4e2f433a328d58f44c3c098d63e 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 a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long
disable of IRQs").

Reported-by: syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Fixes: a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211215171105.20623-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 898e91c32d045e9248d5f6eff73648b8c297f2b1)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I813963bdc0c9482ddfe222f964108d3a8cba910a

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c

index 6312fddd9c00a2b37dee0951810098472e72c053..eaba661133280272cb370fb647b04fefcc7d1c96 100644 (file)
@@ -1000,6 +1000,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
        _initpabias(hw);
        rtl92c_dm_init(hw);
 exit:
+       local_irq_disable();
        local_irq_restore(flags);
        return err;
 }