From: Johannes Berg <johannes@sipsolutions.net>
To: Marty Faltesek <mfaltesek@google.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Cc: Michal Kazior <michal.kazior@tieto.com>
Subject: Re: mac80211: When adding a new station, notify driver before adding to hash
Date: Fri, 21 Aug 2015 09:58:40 +0200 [thread overview]
Message-ID: <1440143920.2107.3.camel@sipsolutions.net> (raw)
In-Reply-To: <1440143840.2107.2.camel@sipsolutions.net> (sfid-20150821_095727_697670_EF5C7C23)
On Fri, 2015-08-21 at 09:57 +0200, Johannes Berg wrote:
> On Thu, 2015-08-20 at 17:39 -0400, Marty Faltesek wrote:
> >
> > I believe the following race occurs:
> >
> > 1. mac80211 is processing a new station that just joined.
> > 2. Before it's completed initializing the station, we take an
> > interrupt,
> > with a packet from the STA.
> > 3. That interrupt is a management frame from the station which
> > causes
> > rate_control_rate_update to be called, which calls back into the
> >
> > ath10k
> > with the not-fully initialized station.
>
> I'm a bit confused by the stack trace - is this IBSS and the stack
> trace is just bad? I don't really see how we get from
> sta_ps_transition
> to sta_rc_update?
>
> > 4. It reaches ath10k_sta_rc_update before the interrupted thread
> > had
> > reached ath10k_sta_state()
> > Therefore it has not yet initialized its workqueue. Still NULL.
> > 5. When this NULL workqueue gets passed to queue_work, it passes
> > the first check that its not in use because of the NULL struct,
> > but fails the
> > next check in __queue_work because a NULL structure makes the
> > test
> > for an empty list fail.
> >
> >
> > Proposed patch is to not add the new station in the hash until
> > after
> > the
> > driver initializes it. But I'm not clear what implications this
> > has.
> > Could this
> > cause other problems?
> >
>
> I think the issue Michał pointed out is valid - but we can probably
> check sta->uploaded in the relevant places?
>
Come to think of it though - we might cache & delay the call so drivers
actually get the updated values.
johannes
next prev parent reply other threads:[~2015-08-21 7:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 21:39 mac80211: When adding a new station, notify driver before adding to hash Marty Faltesek
2015-08-21 5:04 ` Michal Kazior
2015-08-21 7:57 ` Johannes Berg
2015-08-21 7:58 ` Johannes Berg [this message]
2015-08-21 17:00 ` Marty Faltesek
2015-08-24 12:38 ` Johannes Berg
2015-08-24 16:12 ` Marty Faltesek
2015-08-24 16:15 ` Johannes Berg
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=1440143920.2107.3.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mfaltesek@google.com \
--cc=michal.kazior@tieto.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;
as well as URLs for NNTP newsgroup(s).