aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-11-02 08:42:56 -0400
committerDavid S. Miller <davem@davemloft.net>2011-11-03 18:06:18 -0400
commit918eb39962dfff9490a43cd08176b962cacc7978 (patch)
tree53275f3622cf13f57296481a556c47dd5d92f16f /net
parente2e210c0238eb7073e07af503ae743fa53977120 (diff)
net: add missing bh_unlock_sock() calls
Simon Kirby reported lockdep warnings and following messages : [104661.897577] huh, entered softirq 3 NET_RX ffffffff81613740 preempt_count 00000101, exited with 00000102? [104661.923653] huh, entered softirq 3 NET_RX ffffffff81613740 preempt_count 00000101, exited with 00000102? Problem comes from commit 0e734419 (ipv4: Use inet_csk_route_child_sock() in DCCP and TCP.) If inet_csk_route_child_sock() returns NULL, we should release socket lock before freeing it. Another lock imbalance exists if __inet_inherit_port() returns an error since commit 093d282321da ( tproxy: fix hash locking issue when using port redirection in __inet_inherit_port()) a backport is also needed for >= 2.6.37 kernels. Reported-by: Simon Kirby <sim@hostway.ca> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Balazs Scheidler <bazsi@balabit.hu> CC: KOVACS Krisztian <hidden@balabit.hu> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Simon Kirby <sim@hostway.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ipv4.c1
-rw-r--r--net/ipv4/tcp_ipv4.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 332639b56f4d..90a919afbed7 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -433,6 +433,7 @@ exit:
433 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 433 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
434 return NULL; 434 return NULL;
435put_and_exit: 435put_and_exit:
436 bh_unlock_sock(newsk);
436 sock_put(newsk); 437 sock_put(newsk);
437 goto exit; 438 goto exit;
438} 439}
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 939c55eceb5b..a7443159c400 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1510,6 +1510,7 @@ exit:
1510 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 1510 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
1511 return NULL; 1511 return NULL;
1512put_and_exit: 1512put_and_exit:
1513 bh_unlock_sock(newsk);
1513 sock_put(newsk); 1514 sock_put(newsk);
1514 goto exit; 1515 goto exit;
1515} 1516}