diff options
author | Eric Dumazet <edumazet@google.com> | 2015-07-14 08:10:22 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-09-28 18:57:01 -0400 |
commit | 4bbded3d6ce48179a0e7067305e5e33860f2c490 (patch) | |
tree | 6eef62b415d0528f73d6b1186e98f9c019d00311 /include | |
parent | 7cc240901fb8961392ac823f00fa3abc17b8a64f (diff) | |
download | lwn-4bbded3d6ce48179a0e7067305e5e33860f2c490.tar.gz lwn-4bbded3d6ce48179a0e7067305e5e33860f2c490.zip |
ipv6: lock socket in ip6_datagram_connect()
[ Upstream commit 03645a11a570d52e70631838cb786eb4253eb463 ]
ip6_datagram_connect() is doing a lot of socket changes without
socket being locked.
This looks wrong, at least for udp_lib_rehash() which could corrupt
lists because of concurrent udp_sk(sk)->udp_portaddr_hash accesses.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ip.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index c0c26c3deeb5..d00ebdf14ca4 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -160,6 +160,7 @@ static inline __u8 get_rtconn_flags(struct ipcm_cookie* ipc, struct sock* sk) } /* datagram.c */ +int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); void ip4_datagram_release_cb(struct sock *sk); |