tcp: md5: protects md5sig_info with RCU
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 31 Jan 2012 18:45:40 +0000 (18:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Feb 2012 07:11:47 +0000 (02:11 -0500)
commita8afca032998850ec63e83d555cdcf0eb5680cd6
tree012c06f6b3a2bfa6a908954a671b1e36e2198eb6
parent41de8d4cff21a2e81e3d9ff66f5f7c903f9c3ab1
tcp: md5: protects md5sig_info with RCU

This patch makes sure we use appropriate memory barriers before
publishing tp->md5sig_info, allowing tcp_md5_do_lookup() being used from
tcp_v4_send_reset() without holding socket lock (upcoming patch from
Shawn Lu)

Note we also need to respect rcu grace period before its freeing, since
we can free socket without this grace period thanks to
SLAB_DESTROY_BY_RCU

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Shawn Lu <shawn.lu@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
include/net/tcp.h
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c