From: Kalle Valo <kvalo@codeaurora.org>
To: Sumit Garg <sumit.garg@linaro.org>
Cc: "Johannes Berg" <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
kuba@kernel.org, netdev@vger.kernel.org,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Matthias-Peter Schöpfer" <matthias.schoepfer@ithinx.io>,
"Berg Philipp (HAU-EDS)" <Philipp.Berg@liebherr.com>,
"Weitner Michael (HAU-EDS)" <Michael.Weitner@liebherr.com>,
"Daniel Thompson" <daniel.thompson@linaro.org>,
"Loic Poulain" <loic.poulain@linaro.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] mac80211: fix race in ieee80211_register_hw()
Date: Mon, 06 Apr 2020 16:27:00 +0300 [thread overview]
Message-ID: <87v9mcycbf.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CAFA6WYOjU_iDyAn5PMGe=usg-2sPtupSQEYwcomUcHZBAPnURA@mail.gmail.com> (Sumit Garg's message of "Mon, 6 Apr 2020 18:51:04 +0530")
Sumit Garg <sumit.garg@linaro.org> writes:
> On Mon, 6 Apr 2020 at 18:38, Johannes Berg <johannes@sipsolutions.net> wrote:
>>
>> On Mon, 2020-04-06 at 16:04 +0300, Kalle Valo wrote:
>> > Johannes Berg <johannes@sipsolutions.net> writes:
>> >
>> > > On Mon, 2020-04-06 at 15:52 +0300, Kalle Valo wrote:
>> > > > Johannes Berg <johannes@sipsolutions.net> writes:
>> > > >
>> > > > > On Mon, 2020-04-06 at 15:44 +0300, Kalle Valo wrote:
>> > > > > > > user-space ieee80211_register_hw() RX IRQ
>> > > > > > > +++++++++++++++++++++++++++++++++++++++++++++
>> > > > > > > | | |
>> > > > > > > |<---wlan0---wiphy_register() |
>> > > > > > > |----start wlan0---->| |
>> > > > > > > | |<---IRQ---(RX packet)
>> > > > > > > | Kernel crash |
>> > > > > > > | due to unallocated |
>> > > > > > > | workqueue. |
>> > > > >
>> > > > > [snip]
>> > > > >
>> > > > > > I have understood that no frames should be received until mac80211 calls
>> > > > > > struct ieee80211_ops::start:
>> > > > > >
>> > > > > > * @start: Called before the first netdevice attached to the hardware
>> > > > > > * is enabled. This should turn on the hardware and must turn on
>> > > > > > * frame reception (for possibly enabled monitor interfaces.)
>> > > > >
>> > > > > True, but I think he's saying that you can actually add and configure an
>> > > > > interface as soon as the wiphy is registered?
>> > > >
>> > > > With '<---IRQ---(RX packet)' I assumed wcn36xx is delivering a frame to
>> > > > mac80211 using ieee80211_rx(), but of course I'm just guessing here.
>> > >
>> > > Yeah, but that could be legitimate?
>> >
>> > Ah, I misunderstood then. The way I have understood is that no rx frames
>> > should be delivered (= calling ieee80211_rx()_ before start() is called,
>> > but if that's not the case please ignore me :)
>>
>> No no, that _is_ the case. But I think the "start wlan0" could end up
>> calling it?
>>
>
> Sorry if I wasn't clear enough via the sequence diagram. It's a common
> RX packet that arrives via ieee80211_tasklet_handler() which is
> enabled via call to "struct ieee80211_ops::start" api.
Ah sorry, I didn't realise that. So wcn36xx is not to be blamed then,
thanks for the clarification.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2020-04-06 13:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 12:21 [PATCH] mac80211: fix race in ieee80211_register_hw() Sumit Garg
2020-04-06 12:44 ` Johannes Berg
2020-04-06 13:00 ` Sumit Garg
2020-04-06 12:44 ` Kalle Valo
2020-04-06 12:47 ` Johannes Berg
2020-04-06 12:52 ` Kalle Valo
2020-04-06 12:53 ` Johannes Berg
2020-04-06 13:04 ` Kalle Valo
2020-04-06 13:07 ` Johannes Berg
2020-04-06 13:21 ` Sumit Garg
2020-04-06 13:27 ` Kalle Valo [this message]
2020-04-06 13:55 ` Krishna Chaitanya
2020-04-06 14:01 ` Johannes Berg
2020-04-06 14:25 ` Krishna Chaitanya
2020-04-06 15:06 ` Johannes Berg
2020-04-06 18:08 ` Krishna Chaitanya
2020-04-07 6:42 ` Sumit Garg
2020-04-06 13:06 ` Sumit Garg
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=87v9mcycbf.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=Michael.Weitner@liebherr.com \
--cc=Philipp.Berg@liebherr.com \
--cc=daniel.thompson@linaro.org \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=matthias.schoepfer@ithinx.io \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=sumit.garg@linaro.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