From: Pavel Andrianov <andrianov@ispras.ru>
To: Eugene Krasnikov <k.eugene.e@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org,
Vaishali Thakkar <vaishali.thakkar@oracle.com>
Subject: [ldv-project] [net] wcn36xx: potential race condition
Date: Tue, 14 Jun 2016 18:42:32 +0400 [thread overview]
Message-ID: <576017D8.9080207@ispras.ru> (raw)
Hi!
There is a potential race condition in
drivers/net/wireless/ath/wcn36xx/wcn36xx.ko. In wcn36xx_tx ->
wcn36xx_start_tx -> wcn36xx_set_tx_data
(http://lxr.free-electrons.com/source/drivers/net/wireless/ath/wcn36xx/txrx.c#L176)
there is a read of sta_priv->bss_dpu_desc_index and
sta_priv->bss_sta_index. In wcn36xx_bss_info_changed ->
wcn36xx_smd_config_bss -> wcn36xx_smd_config_bss_rsp
(http://lxr.free-electrons.com/source/drivers/net/wireless/ath/wcn36xx/smd.c#L1204)
there is a write to the same fields. It seems that the handlers may be
called in parallel and inconsistent data may be obtained.
The same problem is with sta_priv->sta_index and
sta_priv->sta_dpu_desc_index:
http://lxr.free-electrons.com/source/drivers/net/wireless/ath/wcn36xx/txrx.c#L181
http://lxr.free-electrons.com/source/drivers/net/wireless/ath/wcn36xx/smd.c#L986
Is it a real bug? Is it enough to add mutex_lock to wcn36xx_set_tx_data?
--
Pavel Andrianov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: andrianov@ispras.ru
reply other threads:[~2016-06-14 15:46 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=576017D8.9080207@ispras.ru \
--to=andrianov@ispras.ru \
--cc=k.eugene.e@gmail.com \
--cc=kvalo@codeaurora.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vaishali.thakkar@oracle.com \
--cc=wcn36xx@lists.infradead.org \
/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