diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-02-18 15:28:10 +0300 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 14:52:01 +0300 |
commit | 7b36e8eef989fc59535b4f1d3fc0f83afaf419d4 (patch) | |
tree | f0900101542966e0655ca5f115b5b0bc409b1e74 /net/batman-adv/icmp_socket.c | |
parent | 7aadf889e897155c45cda230d2a6701ad1fbff61 (diff) | |
download | linux-7b36e8eef989fc59535b4f1d3fc0f83afaf419d4.tar.xz |
batman-adv: Correct rcu refcounting for orig_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/icmp_socket.c')
-rw-r--r-- | net/batman-adv/icmp_socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 139b7336adf9..a0a35b1af167 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c @@ -271,7 +271,7 @@ out: if (neigh_node) neigh_node_free_ref(neigh_node); if (orig_node) - kref_put(&orig_node->refcount, orig_node_free_ref); + orig_node_free_ref(orig_node); return len; } |