From patchwork Fri Oct 17 21:18:26 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 4911 X-Patchwork-Delegate: jgarzik@pobox.com 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 824A7DDF55 for ; Sat, 18 Oct 2008 08:18:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185AbYJQVS3 (ORCPT ); Fri, 17 Oct 2008 17:18:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753988AbYJQVS2 (ORCPT ); Fri, 17 Oct 2008 17:18:28 -0400 Received: from sj-iport-6.cisco.com ([171.71.176.117]:4360 "EHLO sj-iport-6.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbYJQVS1 (ORCPT ); Fri, 17 Oct 2008 17:18:27 -0400 X-IronPort-AV: E=Sophos;i="4.33,434,1220227200"; d="scan'208";a="177519591" Received: from sj-dkim-1.cisco.com ([171.71.179.21]) by sj-iport-6.cisco.com with ESMTP; 17 Oct 2008 21:18:27 +0000 Received: from sj-core-2.cisco.com (sj-core-2.cisco.com [171.71.177.254]) by sj-dkim-1.cisco.com (8.12.11/8.12.11) with ESMTP id m9HLIRg7002710; Fri, 17 Oct 2008 14:18:27 -0700 Received: from xbh-sjc-221.amer.cisco.com (xbh-sjc-221.cisco.com [128.107.191.63]) by sj-core-2.cisco.com (8.13.8/8.13.8) with ESMTP id m9HLIROQ011429; Fri, 17 Oct 2008 21:18:27 GMT Received: from xfe-sjc-211.amer.cisco.com ([171.70.151.174]) by xbh-sjc-221.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 17 Oct 2008 14:18:27 -0700 Received: from roland-conroe ([10.33.42.9]) by xfe-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 17 Oct 2008 14:18:26 -0700 Received: by roland-conroe (Postfix, from userid 33217) id 6DC49E71E2; Fri, 17 Oct 2008 14:18:26 -0700 (PDT) From: Roland Dreier To: jeff@garzik.org Cc: netdev@vger.kernel.org, divy@chelsio.com, davem@davemloft.net Subject: cxgb3: Fix kernel crash caused by uninitialized l2t_entry.arpq X-Message-Flag: Warning: May contain useful information Date: Fri, 17 Oct 2008 14:18:26 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 X-OriginalArrivalTime: 17 Oct 2008 21:18:26.0863 (UTC) FILETIME=[E51CABF0:01C9309D] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=1296; t=1224278307; x=1225142307; c=relaxed/simple; s=sjdkim1004; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rdreier@cisco.com; z=From:=20Roland=20Dreier=20 |Subject:=20cxgb3=3A=20Fix=20kernel=20crash=20caused=20by=2 0uninitialized=20l2t_entry.arpq |Sender:=20; bh=4aOq4cQa5ew6JEwv/61kT659lFVaSxdwxcFc9drePAI=; b=Lzek0NEx+KnaOFSG6FVe6PMgEb08qQHBFc2WDvX2gK/r4CfGZgO4zugTOX zlXJcbi3CS6lNihVaky3hXWEub/g3kdehyr56eTH24SwYsIZtTBuGO2FeIS5 yTRyXopT88YUYD+rfOG4NNJGFqdG5WVBu7C7FOvx3qTtFMt1EEWGQ=; Authentication-Results: sj-dkim-1; header.From=rdreier@cisco.com; dkim=pass ( sig from cisco.com/sjdkim1004 verified; ); Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 147e70e6 ("cxgb3: Use SKB list interfaces instead of home-grown implementation.") causes a crash in t3_l2t_send_slow() when an iWARP connection request is received. This is because the new l2t_entry.arpq skb queue is never initialized, and therefore trying to add an skb to it causes a NULL dereference. With the old code there was no need to initialize the queues because the l2t_entry structures were zeroed, and the code used NULL to mean empty. Fix this by adding __skb_queue_head_init() when all the l2t_entry structures get allocated. Signed-off-by: Roland Dreier Acked-by: David S. Miller Acked-by: Divy Le ray --- This should probably go to -stable as well, since it looks like the commit that broke things went into 2.6.27-rc6. drivers/net/cxgb3/l2t.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- 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/drivers/net/cxgb3/l2t.c b/drivers/net/cxgb3/l2t.c index 4407ac9..ff1611f 100644 --- a/drivers/net/cxgb3/l2t.c +++ b/drivers/net/cxgb3/l2t.c @@ -431,6 +431,7 @@ struct l2t_data *t3_init_l2t(unsigned int l2t_capacity) for (i = 0; i < l2t_capacity; ++i) { d->l2tab[i].idx = i; d->l2tab[i].state = L2T_STATE_UNUSED; + __skb_queue_head_init(&d->l2tab[i].arpq); spin_lock_init(&d->l2tab[i].lock); atomic_set(&d->l2tab[i].refcnt, 0); }