summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-07-04 00:52:49 +0900
committerGabby Lee <galee@nvidia.com>2014-01-09 17:51:17 -0800
commite8722111e6d04aa4435ad5bb0419c3dfa19094b1 (patch)
tree01aa74a497ab472f73ad47e53fa57a31afdff5bf /net
parent1ca3960a1549a9262b44f4322d80a3a808da1bbe (diff)
net: ipv6: add missing lock in ping_v6_sendmsg
Bug: 9469865 Bug 1412141 Change-Id: I5e9db559d22e35d27fa1df948b70c70ed8b42115 Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 3a018d2e8fc2910e5fb2077cde81cad659e2c7f9) Reviewed-on: http://git-master/r/336271 (cherry picked from commit 71e8c301dce8ee85ee26eedb808b939084f14b45) Reviewed-on: http://git-master/r/353232 Reviewed-by: Nitin Bindal <nbindal@nvidia.com> Tested-by: Nitin Bindal <nbindal@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ping.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 502fc230323c..23d35b5f73e2 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -197,6 +197,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);
+ lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,
0, hlimit,
np->tclass, NULL, &fl6, rt,
@@ -211,6 +212,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
(struct icmp6hdr *) &pfh.icmph,
len);
}
+ release_sock(sk);
return err;
}