diff mbox

ipv6: don't use tw net when accounting for recycled tw

Message ID 49A67DAB.9060203@openvz.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Pavel Emelyanov Feb. 26, 2009, 11:31 a.m. UTC
We already have a valid net in that place, but this is not just a
cleanup - the tw pointer can be NULL there sometimes, thus causing
an oops in NET_NS=y case.

The same place in ipv4 code already works correctly using existing 
net, rather than tw's one.

The bug exists since 2.6.27.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Feb. 26, 2009, 11:35 a.m. UTC | #1
From: Pavel Emelyanov <xemul@openvz.org>
Date: Thu, 26 Feb 2009 14:31:55 +0300

> We already have a valid net in that place, but this is not just a
> cleanup - the tw pointer can be NULL there sometimes, thus causing
> an oops in NET_NS=y case.
> 
> The same place in ipv4 code already works correctly using existing 
> net, rather than tw's one.
> 
> The bug exists since 2.6.27.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 8fe267f..1bcc343 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -258,11 +258,11 @@  unique:
 
 	if (twp != NULL) {
 		*twp = tw;
-		NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
+		NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
 	} else if (tw != NULL) {
 		/* Silly. Should hash-dance instead... */
 		inet_twsk_deschedule(tw, death_row);
-		NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
+		NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
 
 		inet_twsk_put(tw);
 	}