lkml.org 
[lkml]   [2021]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[BUG] marvell: mwifiex: two possible ABBA deadlocks
Date
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

\
 
 \ /
  Last update: 2021-11-23 04:31    [W:0.079 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site