From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
gregkh@linuxfoundation.org, zhansayabagdaulet@gmail.com,
christophe.jaillet@wanadoo.fr, insafonov@gmail.com,
paskripkin@gmail.com, deborahbrouwer3563@gmail.com
Cc: linux-staging@lists.linux.dev,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUG] staging: rtl8712: possible ABBA deadlocks
Date: Tue, 28 Dec 2021 15:18:11 +0800 [thread overview]
Message-ID: <8d695b41-74e6-4733-4841-e21fdebde890@gmail.com> (raw)
Hello,
My static analysis tool reports several possible ABBA deadlocks in the
rtl8712 driver in Linux 5.10:
# BUG1:
r8712_free_all_stainfo()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); --> Line 202 (Lock A)
r8712_free_stainfo()
r8712_free_xmitframe_queue()
spin_lock_irqsave(&(pframequeue->lock), irqL); --> Line 834 (Lock B)
r8711_wx_set_wap()
spin_lock_irqsave(&queue->lock, irqL); --> Line 1049 (Lock B)
r8712_set_802_11_infrastructure_mode()
r8712_free_assoc_resources()
r8712_get_stainfo()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); --> Line 228
(Lock A)
When r8712_free_all_stainfo() and r8711_wx_set_wap() are concurrently
executed, the deadlocks can occur.
# BUG2:
r8712_joinbss_event_callback()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL2); --> Line 735 (Lock A)
r8712_free_stainfo()
r8712_free_xmitframe_queue()
spin_lock_irqsave(&(pframequeue->lock), irqL); --> Line 834 (Lock B)
r8711_wx_set_wap()
spin_lock_irqsave(&queue->lock, irqL); --> Line 1049 (Lock B)
r8712_set_802_11_infrastructure_mode()
r8712_free_assoc_resources()
r8712_get_stainfo()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); --> Line 228
(Lock A)
When r8712_joinbss_event_callback() and r8711_wx_set_wap() are
concurrently executed, the deadlocks can occur.
# BUG3:
r8712_stadel_event_callback()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); --> Line 932 (Lock A)
r8712_free_stainfo()
r8712_free_xmitframe_queue()
spin_lock_irqsave(&(pframequeue->lock), irqL); --> Line 834 (Lock B)
r8711_wx_set_wap()
spin_lock_irqsave(&queue->lock, irqL); --> Line 1049 (Lock B)
r8712_set_802_11_infrastructure_mode()
r8712_free_assoc_resources()
r8712_get_stainfo()
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); --> Line 228
(Lock A)
When r8712_stadel_event_callback() and r8711_wx_set_wap() are
concurrently executed, the deadlocks can occur.
I am not quite sure whether these possible deadlocks are real and how to
fix them if them are real.
Any feedback would be appreciated, thanks :)
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Best wishes,
Jia-Ju Bai
reply other threads:[~2021-12-28 7:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d695b41-74e6-4733-4841-e21fdebde890@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=christophe.jaillet@wanadoo.fr \
--cc=deborahbrouwer3563@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=insafonov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=zhansayabagdaulet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox