]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Correct rcu refcounting for batman_if
authorMarek Lindner <lindner_marek@yahoo.de>
Thu, 10 Feb 2011 14:33:51 +0000 (14:33 +0000)
committerMarek Lindner <lindner_marek@yahoo.de>
Sat, 5 Mar 2011 11:50:07 +0000 (12:50 +0100)
commit0136051d84bb646abf68930794f4708227558dfe
tree3f4f844d2311e662b4c42e7a275188d1346ac77d
parentbc7ecb33b89b1413e09b3e8119124fde4d788367
batman-adv: Correct rcu refcounting for batman_if

It might be possible that 2 threads access the same data in the same
rcu grace period. The first thread calls call_rcu() to decrement the
refcount and free the data while the second thread increases the
refcount to use the data. To avoid this race condition all refcount
operations have to be atomic.

Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
net/batman-adv/bat_sysfs.c
net/batman-adv/hard-interface.c
net/batman-adv/hard-interface.h
net/batman-adv/types.h