summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-07-04 00:52:49 +0900
committerManish Tuteja <mtuteja@nvidia.com>2014-04-01 03:12:28 -0700
commitb4fe053967bc207fc696b93b47b951c51ab956b5 (patch)
tree38cf3f858017513b363e860143f9a5ce7c2a92b1
parentf3f116f515811a1d2e7c29b1163138d68451c7cc (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/351008 (cherry picked from commit cab02ce05d5e1abaff049a02ee1e3630d481adeb) Reviewed-on: http://git-master/r/390636 Reviewed-by: Jun Su <juns@nvidia.com> Reviewed-by: Om Prakash Singh <omp@nvidia.com> Reviewed-by: Liangcai Li <liangcail@nvidia.com> Tested-by: Liangcai Li <liangcail@nvidia.com> Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>
-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 2ca215eb5f80..1584d47a2d3d 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -198,6 +198,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,
@@ -212,6 +213,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
(struct icmp6hdr *) &pfh.icmph,
len);
}
+ release_sock(sk);
return err;
}