Adrian Chadd 807675317e Attempt to address some potential vap->iv_bss race conditions.
There are unfortunately a number of situations where vap->iv_bss is changed
or freed by some code in net80211.  Because multiple threads can concurrently
be doing work (and the vap->iv_bss access isn't at all done behind any kind
of lock), it's quite possible that:

* a change will occur in one thread - eg, by a call through
  ieee80211_sta_join1();
* a state change occurs in another thread - eg an RX is scheduled
  in the ath tasklet and it calls ieee80211_input_mimo_all(), which
  does dereference vap->iv_bss;
* these two executing concurrently, causing things to explode.

Another instance is ath_beacon_alloc() which takes an ieee80211_node *.
It's called with the vap->iv_bss node from ath_newstate(). If the node has
changed in the meantime (say it's been freed elsewhere) the reference
that it grabbed _before_ refcounting it may be stale.

I would _prefer_ that these sorts of things were serialised somewhere but
that may be a bit much to ask.  Instead, the best we can (currently) hope
is that the underlying bss node is still (somewhat) valid.

There is a related PR (kern/164382) described by the first case above.
That should be fixed by properly serialising the RX path and reset path
so an RX can't occur at the same time as the vap free/shutdown path.

This is inspired by some related fixes in r212127.

PR: kern/165060
2012-02-13 00:28:41 +00:00
..
2012-01-15 13:23:18 +00:00
2011-10-13 20:06:19 +00:00
2011-12-17 10:23:17 +00:00
2011-12-17 10:23:17 +00:00
2011-02-21 09:01:34 +00:00
2011-11-23 20:27:26 +00:00
2012-01-29 14:52:42 +00:00
2011-06-28 08:36:48 +00:00
2011-12-15 06:29:13 +00:00
2012-01-10 20:52:02 +00:00
2012-01-15 13:23:18 +00:00
2012-01-15 13:23:43 +00:00
2012-01-25 04:48:27 +00:00
2012-01-31 13:00:40 +00:00
2012-01-15 13:23:43 +00:00
2011-12-17 10:23:17 +00:00
2011-12-17 10:23:17 +00:00
2012-01-30 23:03:21 +00:00
2011-10-18 08:09:44 +00:00
2011-03-24 08:56:12 +00:00
2011-12-17 10:23:17 +00:00
2011-05-15 13:17:08 +00:00
2011-12-17 10:23:17 +00:00
2012-01-02 12:12:10 +00:00
2012-01-11 15:00:16 +00:00
2012-01-15 13:23:43 +00:00
2012-01-15 13:23:18 +00:00
2011-12-17 10:23:17 +00:00
2012-02-10 12:35:57 +00:00
2011-10-07 08:59:54 +00:00
2012-01-15 13:23:18 +00:00
2011-12-15 05:07:16 +00:00
2011-12-15 06:29:13 +00:00
2012-01-16 06:00:44 +00:00
2012-02-10 12:35:57 +00:00
2012-02-11 08:12:52 +00:00
2011-12-22 15:13:32 +00:00
2011-10-18 08:09:44 +00:00
2011-11-23 05:34:01 +00:00
2011-12-17 10:23:17 +00:00
2012-02-10 12:35:57 +00:00
2011-11-23 20:27:26 +00:00