diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-02-10 09:33:53 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 06:50:03 -0500 |
commit | 44524fcdf6ca19b58c24f7622c4af1d8d8fe59f8 (patch) | |
tree | 297c76f80d68d56e3c65a23c70de645a1c93df47 /net/batman-adv/originator.h | |
parent | a4c135c561106c397bae33455acfca4aa8065a30 (diff) |
batman-adv: Correct rcu refcounting for neigh_node
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/originator.h')
-rw-r--r-- | net/batman-adv/originator.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h index 360dfd19a32f..84d96e2eea47 100644 --- a/net/batman-adv/originator.h +++ b/net/batman-adv/originator.h | |||
@@ -26,13 +26,12 @@ int originator_init(struct bat_priv *bat_priv); | |||
26 | void originator_free(struct bat_priv *bat_priv); | 26 | void originator_free(struct bat_priv *bat_priv); |
27 | void purge_orig_ref(struct bat_priv *bat_priv); | 27 | void purge_orig_ref(struct bat_priv *bat_priv); |
28 | void orig_node_free_ref(struct kref *refcount); | 28 | void orig_node_free_ref(struct kref *refcount); |
29 | void neigh_node_free_rcu_bond(struct rcu_head *rcu); | ||
30 | struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr); | 29 | struct orig_node *get_orig_node(struct bat_priv *bat_priv, uint8_t *addr); |
31 | struct neigh_node *create_neighbor(struct orig_node *orig_node, | 30 | struct neigh_node *create_neighbor(struct orig_node *orig_node, |
32 | struct orig_node *orig_neigh_node, | 31 | struct orig_node *orig_neigh_node, |
33 | uint8_t *neigh, | 32 | uint8_t *neigh, |
34 | struct batman_if *if_incoming); | 33 | struct batman_if *if_incoming); |
35 | void neigh_node_free_ref(struct kref *refcount); | 34 | void neigh_node_free_ref(struct neigh_node *neigh_node); |
36 | int orig_seq_print_text(struct seq_file *seq, void *offset); | 35 | int orig_seq_print_text(struct seq_file *seq, void *offset); |
37 | int orig_hash_add_if(struct batman_if *batman_if, int max_if_num); | 36 | int orig_hash_add_if(struct batman_if *batman_if, int max_if_num); |
38 | int orig_hash_del_if(struct batman_if *batman_if, int max_if_num); | 37 | int orig_hash_del_if(struct batman_if *batman_if, int max_if_num); |