summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2016-11-29 13:09:44 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-30 14:14:07 -0500
commit0382a25af3c771a8e4d5e417d1834cbe28c2aaac (patch)
tree91d6b49fc8dab4cb02312da66d018a72975bd408 /include
parentbb83d62fa83405d7c325873a317c9374f98eedef (diff)
downloadlinux-rpi-0382a25af3c771a8e4d5e417d1834cbe28c2aaac.tar.gz
linux-rpi-0382a25af3c771a8e4d5e417d1834cbe28c2aaac.tar.bz2
linux-rpi-0382a25af3c771a8e4d5e417d1834cbe28c2aaac.zip
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 'include')
-rw-r--r--include/net/ipv6.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8fed1cd78658..f11ca837361b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -970,6 +970,8 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname,
int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
+int __ip6_datagram_connect(struct sock *sk, struct sockaddr *addr,
+ int addr_len);
int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
int addr_len);