Skip to content

Commit

Permalink
ipv6: sctp: fix lockdep splat in sctp_v6_get_dst()
Browse files Browse the repository at this point in the history
While cooking the sctp np->opt rcu fixes, I forgot to move
one rcu_read_unlock() after the added rcu_dereference() in
sctp_v6_get_dst()

This gave lockdep warnings reported by Dave Jones.

Fixes: c836a8b ("ipv6: sctp: add rcu protection around np->opt")
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 7, 2015
1 parent ce212d0 commit 69ce648
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,13 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
}
}
}
rcu_read_unlock();

if (baddr) {
fl6->saddr = baddr->v6.sin6_addr;
fl6->fl6_sport = baddr->v6.sin6_port;
final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final);
dst = ip6_dst_lookup_flow(sk, fl6, final_p);
}
rcu_read_unlock();

out:
if (!IS_ERR_OR_NULL(dst)) {
Expand Down

0 comments on commit 69ce648

Please sign in to comment.