aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-06-09 12:21:07 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-11 01:47:08 -0400
commit592fcb9dfafaa02dd0edc207bf5d3a0ee7a1f8df (patch)
tree3b7bbd5313c7f564cf8087658c36d32a87ca79c4 /include
parent96b52e61be1ad4d4f8de39b9deaf253da804ea3b (diff)
ip: ip_ra_control() rcu fix
commit 66018506e15b (ip: Router Alert RCU conversion) introduced RCU lookups to ip_call_ra_chain(). It missed proper deinit phase : When ip_ra_control() deletes an ip_ra_chain, it should make sure ip_call_ra_chain() users can not start to use socket during the rcu grace period. It should also delay the sock_put() after the grace period, or we risk a premature socket freeing and corruptions, as raw sockets are not rcu protected yet. This delay avoids using expensive atomic_inc_not_zero() in ip_call_ra_chain(). Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 9982c97f0bdc..d52f01180361 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -61,7 +61,10 @@ struct ipcm_cookie {
61struct ip_ra_chain { 61struct ip_ra_chain {
62 struct ip_ra_chain *next; 62 struct ip_ra_chain *next;
63 struct sock *sk; 63 struct sock *sk;
64 void (*destructor)(struct sock *); 64 union {
65 void (*destructor)(struct sock *);
66 struct sock *saved_sk;
67 };
65 struct rcu_head rcu; 68 struct rcu_head rcu;
66}; 69};
67 70