Johannes Berg c2e703a552 mac80211: mesh: fix call_rcu() usage
When using call_rcu(), the called function may be delayed quite
significantly, and without a matching rcu_barrier() there's no
way to be sure it has finished.
Therefore, global state that could be gone/freed/reused should
never be touched in the callback.

Fix this in mesh by moving the atomic_dec() into the caller;
that's not really a problem since we already unlinked the path
and it will be destroyed anyway.

This fixes a crash Jouni observed when running certain tests in
a certain order, in which the mesh interface was torn down, the
memory reused for a function pointer (work struct) and running
that then crashed since the pointer had been decremented by 1,
resulting in an invalid instruction byte stream.

Cc: stable@vger.kernel.org
Fixes: eb2b9311fd00 ("mac80211: mesh path table implementation")
Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-11-17 15:49:25 +01:00
..
2015-01-27 11:07:35 +01:00
2015-01-27 11:09:13 +01:00
2014-11-04 13:18:21 +01:00
2014-04-09 14:49:43 +02:00
2015-03-30 10:48:26 +02:00
2015-08-14 17:49:53 +02:00
2015-07-17 15:37:54 +02:00
2015-07-17 15:38:01 +02:00
2015-05-11 19:16:04 +02:00
2015-10-14 18:40:26 +02:00
2015-11-03 10:42:47 +01:00
2014-04-09 14:49:43 +02:00
2015-11-03 10:42:47 +01:00
2013-12-18 10:33:06 +01:00
2015-05-11 14:51:29 +02:00
2012-03-13 14:54:16 -04:00
2015-10-14 18:40:26 +02:00