]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: prevent sta pointer rcu violation
authorMichal Kazior <michal.kazior@tieto.com>
Thu, 12 Jan 2017 15:14:30 +0000 (16:14 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 19 Jan 2017 13:17:58 +0000 (15:17 +0200)
commit8933d385158206514b9ba84881a36f965c741e44
treeb9b66844baf2d89795d64fee7157279b7c90bd46
parentf023e50b6f17fe277fa8a30fa26064f677d6ab37
ath10k: prevent sta pointer rcu violation

Station pointers are RCU protected so driver must
be extra careful if it tries to store them
internally for later use outside of the RCU
section it obtained it in.

It was possible for station teardown to race with
some htt events. The possible outcome could be a
use-after-free and a crash.

Only peer-flow-control capable firmware was
affected (so hardware-wise qca99x0 and qca4019).

This could be done in sta_state() itself via
explicit synchronize_net() call but there's
already a convenient sta_pre_rcu_remove() op that
can be hooked up to avoid extra rcu stall.

The peer->sta pointer itself can't be set to
NULL/ERR_PTR because it is later used in
sta_state() for extra sanity checks.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/mac.c