linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] marvell: mwifiex: two possible ABBA deadlocks
@ 2021-11-23  3:31 Jia-Ju Bai
  2021-11-30  0:47 ` [PATCH] mwifiex: Fix possible ABBA deadlock Brian Norris
  0 siblings, 1 reply; 6+ messages in thread
From: Jia-Ju Bai @ 2021-11-23  3:31 UTC (permalink / raw)
  To: amitkarwar, ganapathi017, sharvari.harisangam, huxinming820,
	kvalo, David Miller, kuba
  Cc: linux-wireless, netdev, linux-kernel

Hello,

My static analysis tool reports two possible ABBA deadlocks in the 
mwifiex driver in Linux 5.10:

# DEADLOCK 1:
mwifiex_dequeue_tx_packet()
   spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 1432 (Lock A)
   mwifiex_send_addba()
     spin_lock_bh(&priv->sta_list_spinlock); --> Line 608 (Lock B)

mwifiex_process_sta_tx_pause()
   spin_lock_bh(&priv->sta_list_spinlock); --> Line 398 (Lock B)
   mwifiex_update_ralist_tx_pause()
     spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 941 (Lock A)

When mwifiex_dequeue_tx_packet() and mwifiex_process_sta_tx_pause() are 
concurrently executed, the deadlock can occur.

# DEADLOCK 2:
mwifiex_dequeue_tx_packet()
   spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 1432 (Lock A)
   mwifiex_send_addba()
     spin_lock_bh(&priv->sta_list_spinlock); --> Line 608 (Lock B)

mwifiex_process_uap_tx_pause()
   spin_lock_bh(&priv->sta_list_spinlock); --> Line 363 (Lock B)
   mwifiex_update_ralist_tx_pause()
     spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 941 (Lock A)

When mwifiex_dequeue_tx_packet() and mwifiex_process_uap_tx_pause() are 
concurrently executed, the deadlock can occur.

I am not quite sure whether these possible deadlocks are real and how to 
fix them if they are real.
Any feedback would be appreciated, thanks :)

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-08 18:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23  3:31 [BUG] marvell: mwifiex: two possible ABBA deadlocks Jia-Ju Bai
2021-11-30  0:47 ` [PATCH] mwifiex: Fix possible ABBA deadlock Brian Norris
2021-11-30  2:18   ` Jia-Ju Bai
2021-12-01 21:09   ` Doug Anderson
2021-12-08 18:37   ` Kalle Valo
2021-12-08 18:38   ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).