Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311285

[PATCH 3.2 02/70] ipv6: sctp: fix lockdep splat in sctp_v6_get_dst()

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3.2 02/70] ipv6: sctp: fix lockdep splat in sctp_v6_get_dst()
Date 2016-01-18 04:40 +0100
Message-ID <qS8PG-3ml-57@gated-at.bofh.it> (permalink)
References <qS8FX-3hu-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.2.76-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

commit 69ce6487dcd364245a3d26322fc8f4ffd1e8d947 upstream.

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: c836a8ba9386 ("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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sctp/ipv6.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -314,14 +314,13 @@ static void sctp_v6_get_dst(struct sctp_
 			}
 		}
 	}
-	rcu_read_unlock();
-
 	if (baddr) {
 		ipv6_addr_copy(&fl6->saddr, &baddr->v6.sin6_addr);
 		fl6->fl6_sport = baddr->v6.sin6_port;
 		final_p = fl6_update_dst(fl6, np->opt, &final);
 		dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
 	}
+	rcu_read_unlock();
 
 out:
 	if (!IS_ERR(dst)) {

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.2 02/70] ipv6: sctp: fix lockdep splat in sctp_v6_get_dst() Ben Hutchings <ben@decadent.org.uk> - 2016-01-18 04:40 +0100

csiph-web