From patchwork Fri Jun 22 18:13:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 166651 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 484CEB6FA0 for ; Sat, 23 Jun 2012 04:13:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754035Ab2FVSNN (ORCPT ); Fri, 22 Jun 2012 14:13:13 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:45395 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345Ab2FVSNL (ORCPT ); Fri, 22 Jun 2012 14:13:11 -0400 Received: by bkcji2 with SMTP id ji2so1838789bkc.19 for ; Fri, 22 Jun 2012 11:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=QouDUq42W4U3A2n3rHSSVMRkajriPfl1PuXB+PSrbfM=; b=xjunF+KpnBTEkuVgqOV0kUapJwWhD8t8XphcJjnQwOtdrGZU1cZEBWaD/NkCQWIoRC Q38zsgKOHsTVmjAVCI2Eh05digvg/1rwgShxqSNu3coOY+i+W0ItPUekzqu7hpmW4DAY IpueVqTCvss/bSdQWqnH/5haDTttxN8cScb/x2MOFizYd8UUtTeBE1pJSWN20hrUbgob L2ChfE0gyIs3iWX+5AQi2FOPBanpDwJd/gXtyLmDGLrTdF1VQXU7uMhU9pLjHvSx0+4r 9kSIMhLiq0OjcyQN3sxdo9MYaSG2IlgVhWv1akkjlsxQaaI/IrQoe7heEoNzlYNiFiQV 4//g== Received: by 10.204.136.214 with SMTP id s22mr1109175bkt.92.1340388789406; Fri, 22 Jun 2012 11:13:09 -0700 (PDT) Received: from [172.28.88.117] ([74.125.122.49]) by mx.google.com with ESMTPS id x23sm36837714bkw.12.2012.06.22.11.13.06 (version=SSLv3 cipher=OTHER); Fri, 22 Jun 2012 11:13:08 -0700 (PDT) Subject: Re: Bug in net/ipv6/ip6_fib.c:fib6_dump_table() From: Eric Dumazet To: Josh Hunt Cc: "davem@davemloft.net" , "kaber@trash.net" , Debabrata Banerjee , "netdev@vger.kernel.org" , "yoshfuji@linux-ipv6.org" , "jmorris@namei.org" , "pekkas@netcore.fi" , "kuznet@ms2.inr.ac.ru" , "linux-kernel@vger.kernel.org" In-Reply-To: <4FE476A6.1050209@akamai.com> References: <4FE37783.9000409@akamai.com> <1340310469.4604.6702.camel@edumazet-glaptop> <4FE41570.4090803@akamai.com> <1340353746.4604.9502.camel@edumazet-glaptop> <4FE476A6.1050209@akamai.com> Date: Fri, 22 Jun 2012 20:13:05 +0200 Message-ID: <1340388785.4604.11442.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2012-06-22 at 08:44 -0500, Josh Hunt wrote: > Ahh. That makes sense and is what Alexey said before I just didn't put > it all together. So we are OK reverting this patch? I cannot find a path > where the walker's pointers are updated without the tb6_lock write_lock. > There was a bug somewhere, not sure we want to NULL dereference again. Following fix should at least avoid a never ending dump --- 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/ip6_fib.c b/net/ipv6/ip6_fib.c index 74c21b9..6083276 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -1349,8 +1349,8 @@ static int fib6_walk_continue(struct fib6_walker_t *w) if (w->leaf && fn->fn_flags & RTN_RTINFO) { int err; - if (w->count < w->skip) { - w->count++; + if (w->skip) { + w->skip--; continue; }