summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-02-10 14:33:50 +0000
committerMarek Lindner <lindner_marek@yahoo.de>2011-03-05 12:50:05 +0100
commit7d2b554826195372764910da2f0dcb0d9b869108 (patch)
tree364a7b2cdca991b3c6c120e0a1e3bf2c261fb1a1 /net/batman-adv/types.h
parent25b6d3c17eaa92ae9700eb8235bc79782613354a (diff)
downloadop-kernel-dev-7d2b554826195372764910da2f0dcb0d9b869108.zip
op-kernel-dev-7d2b554826195372764910da2f0dcb0d9b869108.tar.gz
batman-adv: Correct rcu refcounting for softif_neigh
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>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index cfbeb45..96f7c22 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -268,7 +268,7 @@ struct softif_neigh {
uint8_t addr[ETH_ALEN];
unsigned long last_seen;
short vid;
- struct kref refcount;
+ atomic_t refcount;
struct rcu_head rcu;
};
OpenPOWER on IntegriCloud