aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2016-04-05 11:10:15 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-07 16:44:14 -0400
commit1e1d04e678cf72442f57ce82803c7a407769135f (patch)
tree8ea1054b59c4abe211ffff0b81f34589b0089f22 /net/dccp
parent61881cfb5ad80c1d0a46ca6d08b7e271892b2ff6 (diff)
net: introduce lockdep_is_held and update various places to use it
The socket is either locked if we hold the slock spin_lock for lock_sock_fast and unlock_sock_fast or we own the lock (sk_lock.owned != 0). Check for this and at the same time improve that the current thread/cpu is really holding the lock. Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/ipv4.c2
-rw-r--r--net/dccp/ipv6.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 6438c5a7efc4..f6d183f8f332 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -62,7 +62,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
62 nexthop = daddr = usin->sin_addr.s_addr; 62 nexthop = daddr = usin->sin_addr.s_addr;
63 63
64 inet_opt = rcu_dereference_protected(inet->inet_opt, 64 inet_opt = rcu_dereference_protected(inet->inet_opt,
65 sock_owned_by_user(sk)); 65 lockdep_sock_is_held(sk));
66 if (inet_opt != NULL && inet_opt->opt.srr) { 66 if (inet_opt != NULL && inet_opt->opt.srr) {
67 if (daddr == 0) 67 if (daddr == 0)
68 return -EINVAL; 68 return -EINVAL;
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 71bf1deba4c5..8ceb3cebcad4 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -868,7 +868,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
868 fl6.fl6_sport = inet->inet_sport; 868 fl6.fl6_sport = inet->inet_sport;
869 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); 869 security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
870 870
871 opt = rcu_dereference_protected(np->opt, sock_owned_by_user(sk)); 871 opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk));
872 final_p = fl6_update_dst(&fl6, opt, &final); 872 final_p = fl6_update_dst(&fl6, opt, &final);
873 873
874 dst = ip6_dst_lookup_flow(sk, &fl6, final_p); 874 dst = ip6_dst_lookup_flow(sk, &fl6, final_p);