diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2016-11-29 12:09:44 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-30 19:14:07 (GMT) |
commit | 0382a25af3c771a8e4d5e417d1834cbe28c2aaac (patch) | |
tree | 91d6b49fc8dab4cb02312da66d018a72975bd408 /net/ipv6 | |
parent | bb83d62fa83405d7c325873a317c9374f98eedef (diff) | |
download | linux-0382a25af3c771a8e4d5e417d1834cbe28c2aaac.tar.xz |
l2tp: lock socket before checking flags in connect()
Socket flags aren't updated atomically, so the socket must be locked
while reading the SOCK_ZAPPED flag.
This issue exists for both l2tp_ip and l2tp_ip6. For IPv6, this patch
also brings error handling for __ip6_datagram_connect() failures.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/datagram.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 37874e2..ccf4055 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -139,7 +139,8 @@ void ip6_datagram_release_cb(struct sock *sk) } EXPORT_SYMBOL_GPL(ip6_datagram_release_cb); -static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) +int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, + int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct inet_sock *inet = inet_sk(sk); @@ -252,6 +253,7 @@ ipv4_connected: out: return err; } +EXPORT_SYMBOL_GPL(__ip6_datagram_connect); int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { |