From patchwork Sat Feb 28 03:16:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle McMartin X-Patchwork-Id: 23866 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 94C71DDE24 for ; Sat, 28 Feb 2009 14:16:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbZB1DQZ (ORCPT ); Fri, 27 Feb 2009 22:16:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752758AbZB1DQZ (ORCPT ); Fri, 27 Feb 2009 22:16:25 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:32791 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbZB1DQY (ORCPT ); Fri, 27 Feb 2009 22:16:24 -0500 Received: from kyle by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1LdFgY-0002dd-L7; Sat, 28 Feb 2009 03:16:18 +0000 Date: Fri, 27 Feb 2009 22:16:18 -0500 From: Kyle McMartin To: Chuck Ebbert Cc: David Miller , netdev@vger.kernel.org Subject: Re: oops / null deref in __inet6_check_established(), kernel 2.6.29-rc6 Message-ID: <20090228031618.GB28503@bombadil.infradead.org> References: <20090224182147.2150468e@dhcp-100-2-144.bos.redhat.com> <20090224.152704.210992553.davem@davemloft.net> <20090224183554.330eb308@dhcp-100-2-144.bos.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090224183554.330eb308@dhcp-100-2-144.bos.redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Kyle McMartin This only seems to show up when CONFIG_NET_NS is enabled. (Reproduced on git HEAD with that option on, doesn't occur with the option off.) I will confess complete ignorance to the network stack, but this patch fixes things... ipv4 seems to have the same namespace support, but increments the sock_net, not the twsk_net. I'll probably put this patch into Fedora, if only to prevent this from being used as a local DoS by an unprivileged user. Signed-off-by: Kyle McMartin --- 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 --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); }