Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4638953yba; Tue, 7 May 2019 23:38:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqycRJ4TxyI4yEJEIKYadK7ozgk9a8xcql1uwWozwu26cEDKHRM1SlsYnCH9tfVFJRh3W4dZ X-Received: by 2002:a63:5608:: with SMTP id k8mr26152700pgb.393.1557297509208; Tue, 07 May 2019 23:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557297509; cv=none; d=google.com; s=arc-20160816; b=VG1NJyWcHMI4DfltPHGMEzxAwvLtt47bsD0780t9e4pe4OlfcnNPib0nkx4t9ve6wk M/fGetS3Z5eiEcnIr0NZpENM5pir0BeUeDiksHfqelhUf6fSfM7a1xZTOc3h5BJ7fsVF tcsrbBNEpvVfhpZFemc6oMr63avgExekJR1NesqTjZKR0ELjCk8Dh4VwF7tJ/WqKiFHw U478yKnIYWsnVe2dBlptOOri+nmwGKuHtIZQ7DtQKziLGbVmsQgtPZLdr0PZxW8oRW3o 8oYgeG1tfaK4XbwElMFWqqcT+ayqmnMlUCIdPRm22dyuwo7UhY/W3zNyweSoSUPe0fpJ G8YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Hy8U3FHsbF4Wcy+yKv7Nqmp0PhwsQWl3p+2FZjj4GG8=; b=wJuwslz4uED+72+n/x4W3zQogC8ZeWrMDGzHbqz4kLCIn/SKKsLWe/XzvMmTpXWDwR Vobc8P+PdXqTWYCJl8tD7hkzcAcH3yxwEwX+D1GNRi7UP4oUHdDcPsL1roB4ACm1V5or xrLOiH5mWj+J3OVpnwaR9cobfQJ7db9E9Lx/poQ1mS7FWjN+Zo3xMRNQ+MP1KV2ifuAK XE514uee3MI6FGrWRPKDVvAStTD3iK8DOisqvkktjFAmUPi3MCajQ5v9ch18pIrZ8Cyn B9v+S5jUfTAq9lVG70YNqELNoiSYT2Gz1Cxwa7DyiEeRVwmNqnCpOsTpX/dgOmsw6qj+ +drw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YmWCwLMi; 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 w21si22147335plq.328.2019.05.07.23.38.13; Tue, 07 May 2019 23:38:29 -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=YmWCwLMi; 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 S1726511AbfEHGfy (ORCPT + 99 others); Wed, 8 May 2019 02:35:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbfEHGfy (ORCPT ); Wed, 8 May 2019 02:35:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A71F521019; Wed, 8 May 2019 06:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557297353; bh=sWVpp/CJFMDokqdQ+85Irw1Hg3zdyDOw5QYwGEIADSQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YmWCwLMindKbYT60YXOnwSJTIp8N/2STq/iAkVM7acQPRj2RRwciDfS88Xb26kbLB U1jBb96f32oZQWcjrr4D4Grmtj/S04SpXfToH6Gqp2bY15+kayD28Gnygs0r/yAI+4 R+tyaoncN3r/o7GZdY7w7y8BRaNuxLAkbzsqznpU= Date: Wed, 8 May 2019 08:35:50 +0200 From: Greg Kroah-Hartman To: Nobuhiro Iwamatsu Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Aaro Koskinen , "David S. Miller" , Sasha Levin Subject: Re: [PATCH 4.19 38/99] net: stmmac: use correct DMA buffer size in the RX descriptor Message-ID: <20190508063550.GA28651@kroah.com> References: <20190506143053.899356316@linuxfoundation.org> <20190506143057.399914447@linuxfoundation.org> <20190508001014.hlemsaqvir3umv2i@toshiba.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190508001014.hlemsaqvir3umv2i@toshiba.co.jp> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 08, 2019 at 09:10:14AM +0900, Nobuhiro Iwamatsu wrote: > Hi, > > On Mon, May 06, 2019 at 04:32:11PM +0200, Greg Kroah-Hartman wrote: > > [ Upstream commit 583e6361414903c5206258a30e5bd88cb03c0254 ] > > > > We always program the maximum DMA buffer size into the receive descriptor, > > although the allocated size may be less. E.g. with the default MTU size > > we allocate only 1536 bytes. If somebody sends us a bigger frame, then > > memory may get corrupted. > > > > Fix by using exact buffer sizes. > > > > Signed-off-by: Aaro Koskinen > > Signed-off-by: David S. Miller > > Signed-off-by: Sasha Levin > > --- > > .../net/ethernet/stmicro/stmmac/descs_com.h | 22 ++++++++++++------- > > .../ethernet/stmicro/stmmac/dwmac4_descs.c | 2 +- > > .../ethernet/stmicro/stmmac/dwxgmac2_descs.c | 2 +- > > .../net/ethernet/stmicro/stmmac/enh_desc.c | 10 ++++++--- > > drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- > > .../net/ethernet/stmicro/stmmac/norm_desc.c | 10 ++++++--- > > .../net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++-- > > This commit is incomplete and we need the following commit: > > commit f87db4dbd52f2f8a170a2b51cb0926221ca7c9e2 > Author: YueHaibing > Date: Wed Apr 17 09:49:39 2019 +0800 > > net: stmmac: Use bfsize1 in ndesc_init_rx_desc > > gcc warn this: > > drivers/net/ethernet/stmicro/stmmac/norm_desc.c: In function ndesc_init_rx_desc: > drivers/net/ethernet/stmicro/stmmac/norm_desc.c:138:6: warning: variable 'bfsize1' set but not used [-Wunused-but-set-variable] > > Like enh_desc_init_rx_desc, we should use bfsize1 > in ndesc_init_rx_desc to calculate 'p->des1' > > Fixes: 583e63614149 ("net: stmmac: use correct DMA buffer size in the RX descriptor") > Signed-off-by: YueHaibing > Reviewed-by: Aaro Koskinen > Signed-off-by: David S. Miller > > And this fix is also needed for 5.0.14-rc. > Please apply this commit to 4.19.y-rc and 5.0.y-rc. Thanks, now queued up. greg k-h