From patchwork Tue Aug 16 11:26:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 1071152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7GBQ8V8024839 for ; Tue, 16 Aug 2011 11:26:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752325Ab1HPL0F (ORCPT ); Tue, 16 Aug 2011 07:26:05 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:53032 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821Ab1HPL0E (ORCPT ); Tue, 16 Aug 2011 07:26:04 -0400 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p7GBQ3Jx001705 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Tue, 16 Aug 2011 13:26:03 +0200 Received: from mail1.itwm.fhg.de ([131.246.191.78]:58681) by itwm2.itwm.fhg.de with esmtps (TLSv1:DES-CBC3-SHA:168) (/C=DE/ST=Rheinland-Pfalz/L=Kaiserslautern/O=Fraunhofer ITWM/OU=SLG/CN=mail1.itwm.fhg.de)(verified=1) (Exim 4.74 #1) id 1QtHmV-0004wm-3z; Tue, 16 Aug 2011 13:26:03 +0200 Subject: [PATCH 5/6] Fix possible Null pointer dereference in ipoib_start_xmit() To: linux-nfs@vger.kernel.org, linux-ext4@vger.kernel.org From: Bernd Schubert Cc: hch@infradead.org, yong.fan@whamcloud.com, linux-fsdevel@vger.kernel.org, tytso@mit.edu, adilger@whamcloud.com Date: Tue, 16 Aug 2011 13:26:02 +0200 Message-ID: <20110816112602.1808464.35621.stgit@fsdevel3> In-Reply-To: <20110816112536.1808464.7174.stgit@fsdevel3> References: <20110816112536.1808464.7174.stgit@fsdevel3> User-Agent: StGit/0.15 MIME-Version: 1.0 X-ITWM-CharSet: utf-8 X-ITWM-Scanned-By: mail1.itwm.fhg.de Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 16 Aug 2011 11:26:09 +0000 (UTC) This will fix https://bugzilla.kernel.org/show_bug.cgi?id=41212 fslab2 login: [ 114.392408] EXT4-fs (sdc): barriers disabled [ 114.449737] EXT4-fs (sdc): mounted filesystem with writeback data mode. Opts: journal_async_commit,barrier=0,data=writeback [ 240.944030] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040 [ 240.948007] IP: [] ipoib_start_xmit+0x39/0x280 [ib_ipoib] [...] [ 240.948007] Call Trace: [ 240.948007] [ 240.948007] [] dev_hard_start_xmit+0x2a0/0x590 [ 240.948007] [] ? arp_create+0x70/0x200 [ 240.948007] [] sch_direct_xmit+0xef/0x1c0 Signed-off-by: Bernd Schubert --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 43f89ba..fe89c46 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -717,11 +717,13 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ipoib_dev_priv *priv = netdev_priv(dev); struct ipoib_neigh *neigh; - struct neighbour *n; + struct neighbour *n = NULL; unsigned long flags; - n = dst_get_neighbour(skb_dst(skb)); - if (likely(skb_dst(skb) && n)) { + if (likely(skb_dst(skb))) + n = dst_get_neighbour(skb_dst(skb)); + + if (likely(n)) { if (unlikely(!*to_ipoib_neigh(n))) { ipoib_path_lookup(skb, dev); return NETDEV_TX_OK;