Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2332731imm; Mon, 28 May 2018 06:13:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1oZD6vwgwoab8Y9NTjzMpDb2BcW0NtDTEFTGVGtae3PEdBYPQup5oUhyE02Qgdq702/vw X-Received: by 2002:a62:4fd8:: with SMTP id f85-v6mr13568814pfj.77.1527513230666; Mon, 28 May 2018 06:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513230; cv=none; d=google.com; s=arc-20160816; b=eVeIn4TimBy8JtMiwm1JGvcrUA+Kfa5zNT4SkyXsQTC//5Cf6/1pkc/NrmxgK7sdnJ QqxPcFnIqwI3oQlNWDx0jKw3dsED9dzJmow2yLkCJya+nEk+25y2N3jOf+uaQh15Uy3z /lwwi4fn0jp0R+MCyosvFSZBb2e7NbHWf9ami4MHDEcaYuVMvC2r5NiPnZ5Rt80BKRAx Cvrqhr4E5YopTkD8iYYaqHbFJhp80QoJrdLwTQGYBBfYUrD1XmukeYdiGe+DEOvCD2OI VCaZaxNHc2d1TJe09ag23qWeA0Ooup3s6Gt3Z5VeTf0qosqnn+W8934KzLSDi0fXcPDJ iJfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=3+Q2K25P3NvOmPxNtseWHnWKcxEAT/mKggG+vBN6L+4=; b=G1Lj4d4HljSWFRakz1TQ1nanUl9dP41J40/it5fP2p/0tQy1zO7dyyWAavviZxI43H HbXvgxiyRs+crNQr14kf2MmxqTI0R1ezaZStynOK6KgYfs5Fxuoz4qVTrEmH2cmmjhiS pfvN3y3vYH8EAV1/j9SxL7LQLPhgMqpeLcqR84Mx9+HTmzJ46WMy5bHYIvOd81PGO3Xm v6jjz3hs1H4PvCTe8yqDr19mlmgGTQTQhFzd6wv8PVdxmFBUAr8qLM6Ez4bStpGX/HhG NwRwA0D96Unk+f6JQ0N1iosGaes2P5cq15D3OR0gJRPXN9leicvgZl4fDpe1pHksqAAL +a7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LRCZ6ETZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si3016773pgq.675.2018.05.28.06.13.35; Mon, 28 May 2018 06:13:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LRCZ6ETZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163759AbeE1KvC (ORCPT + 99 others); Mon, 28 May 2018 06:51:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:40456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163581AbeE1Ku6 (ORCPT ); Mon, 28 May 2018 06:50:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09A1E204EE; Mon, 28 May 2018 10:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504657; bh=mr6d99V/cvVzEXbtf1mZayPejk0O70frEOQDhzPaNT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRCZ6ETZlLyTlmquX8389wAJ1KcglQOw8dudcr9bPbpAgh2P4A+3Jx1kxl8w8HEQZ Ed7tm3UCGGzIGqEx8Igwv5mvHx6Z6GBiWBSNButHKQjgJBYYE11YxjDy0YXRLMHBZU LGefS1xgqdM+nnKUd3SRQQ41JRH4hQ8EauxiMQx0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Yves Kerbrat , Marius Gligor , Aaron Brown , Alexander Duyck , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 218/496] e1000e: allocate ring descriptors with dma_zalloc_coherent Date: Mon, 28 May 2018 12:00:03 +0200 Message-Id: <20180528100329.106906221@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pierre-Yves Kerbrat [ Upstream commit aea3fca005fb45f80869f2e8d56fd4e64c1d1fdb ] Descriptor rings were not initialized at zero when allocated When area contained garbage data, it caused skb_over_panic in e1000_clean_rx_irq (if data had E1000_RXD_STAT_DD bit set) This patch makes use of dma_zalloc_coherent to make sure the ring is memset at 0 to prevent the area from containing garbage. Following is the signature of the panic: IODDR0@0.0: skbuff: skb_over_panic: text:80407b20 len:64010 put:64010 head:ab46d800 data:ab46d842 tail:0xab47d24c end:0xab46df40 dev:eth0 IODDR0@0.0: BUG: failure at net/core/skbuff.c:105/skb_panic()! IODDR0@0.0: Kernel panic - not syncing: BUG! IODDR0@0.0: IODDR0@0.0: Process swapper/0 (pid: 0, threadinfo=81728000, task=8173cc00 ,cpu: 0) IODDR0@0.0: SP = <815a1c0c> IODDR0@0.0: Stack: 00000001 IODDR0@0.0: b2d89800 815e33ac IODDR0@0.0: ea73c040 00000001 IODDR0@0.0: 60040003 0000fa0a IODDR0@0.0: 00000002 IODDR0@0.0: IODDR0@0.0: 804540c0 815a1c70 IODDR0@0.0: b2744000 602ac070 IODDR0@0.0: 815a1c44 b2d89800 IODDR0@0.0: 8173cc00 815a1c08 IODDR0@0.0: IODDR0@0.0: 00000006 IODDR0@0.0: 815a1b50 00000000 IODDR0@0.0: 80079434 00000001 IODDR0@0.0: ab46df40 b2744000 IODDR0@0.0: b2d89800 IODDR0@0.0: IODDR0@0.0: 0000fa0a 8045745c IODDR0@0.0: 815a1c88 0000fa0a IODDR0@0.0: 80407b20 b2789f80 IODDR0@0.0: 00000005 80407b20 IODDR0@0.0: IODDR0@0.0: IODDR0@0.0: Call Trace: IODDR0@0.0: [<804540bc>] skb_panic+0xa4/0xa8 IODDR0@0.0: [<80079430>] console_unlock+0x2f8/0x6d0 IODDR0@0.0: [<80457458>] skb_put+0xa0/0xc0 IODDR0@0.0: [<80407b1c>] e1000_clean_rx_irq+0x2dc/0x3e8 IODDR0@0.0: [<80407b1c>] e1000_clean_rx_irq+0x2dc/0x3e8 IODDR0@0.0: [<804079c8>] e1000_clean_rx_irq+0x188/0x3e8 IODDR0@0.0: [<80407b1c>] e1000_clean_rx_irq+0x2dc/0x3e8 IODDR0@0.0: [<80468b48>] __dev_kfree_skb_any+0x88/0xa8 IODDR0@0.0: [<804101ac>] e1000e_poll+0x94/0x288 IODDR0@0.0: [<8046e9d4>] net_rx_action+0x19c/0x4e8 IODDR0@0.0: ... IODDR0@0.0: Maximum depth to print reached. Use kstack= To specify a custom value (where 0 means to display the full backtrace) IODDR0@0.0: ---[ end Kernel panic - not syncing: BUG! Signed-off-by: Pierre-Yves Kerbrat Signed-off-by: Marius Gligor Tested-by: Aaron Brown Reviewed-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -2329,8 +2329,8 @@ static int e1000_alloc_ring_dma(struct e { struct pci_dev *pdev = adapter->pdev; - ring->desc = dma_alloc_coherent(&pdev->dev, ring->size, &ring->dma, - GFP_KERNEL); + ring->desc = dma_zalloc_coherent(&pdev->dev, ring->size, &ring->dma, + GFP_KERNEL); if (!ring->desc) return -ENOMEM;