From patchwork Thu May 21 21:59:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 27508 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 7813EB6F34 for ; Fri, 22 May 2009 07:59:27 +1000 (EST) Received: by ozlabs.org (Postfix) id 6A2A8DE1E2; Fri, 22 May 2009 07:59:27 +1000 (EST) 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 09ADCDE1DE for ; Fri, 22 May 2009 07:59:27 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753786AbZEUV7Q (ORCPT ); Thu, 21 May 2009 17:59:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753703AbZEUV7P (ORCPT ); Thu, 21 May 2009 17:59:15 -0400 Received: from Chamillionaire.breakpoint.cc ([85.10.199.196]:53876 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbZEUV7P (ORCPT ); Thu, 21 May 2009 17:59:15 -0400 Received: id: fw by Chamillionaire.breakpoint.cc with local (easymta 1.00 BETA 1) id 1M7GIF-0000sL-Qs; Thu, 21 May 2009 23:59:15 +0200 Date: Thu, 21 May 2009 23:59:15 +0200 From: Florian Westphal To: Vladimir Ivashchenko Cc: netdev@vger.kernel.org Subject: Re: 2.6.29.1 pktgen crash Message-ID: <20090521215915.GA32737@Chamillionaire.breakpoint.cc> References: <20090520202450.GA12896@francoudi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090520202450.GA12896@francoudi.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Vladimir Ivashchenko wrote: > The attached script leads to a crash when you run it for 2-3 times on 2.6.29.1. The server still remains reachable, but starts misbehaving. > > May 20 21:09:03 tshape-phome2 kernel: BUG: unable to handle kernel paging request at f8bbc008 > May 20 21:09:03 tshape-phome2 kernel: IP: [] pktgen_remove_device+0x88/0xdc [pktgen] > May 20 21:09:03 tshape-phome2 kernel: *pde = 31030067 *pte = 00000000 > May 20 21:09:03 tshape-phome2 kernel: Oops: 0000 [#1] SMP [..] This should fix it: From bca277bb59b865a4e9516953dfc9818af1a7deea Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 21 May 2009 23:52:17 +0200 Subject: [PATCH] pktgen: do not access flows[] beyond its length typo -- pkt_dev->nflows is for stats only, the number of concurrent flows is stored in cflows. Reported-By: Vladimir Ivashchenko Signed-off-by: Florian Westphal --- net/core/pktgen.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 3779c14..8445075 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2447,7 +2447,7 @@ static inline void free_SAs(struct pktgen_dev *pkt_dev) if (pkt_dev->cflows) { /* let go of the SAs if we have them */ int i = 0; - for (; i < pkt_dev->nflows; i++){ + for (; i < pkt_dev->cflows; i++) { struct xfrm_state *x = pkt_dev->flows[i].x; if (x) { xfrm_state_put(x);