Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2472pxb; Mon, 31 Jan 2022 03:48:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXAdhYKFvhghvv5OvTcVo2TnFag/RwZ5gDcHXqk06FlDIpIntWevUasmyGVkkoreancmTo X-Received: by 2002:a63:6a48:: with SMTP id f69mr1233243pgc.521.1643629730249; Mon, 31 Jan 2022 03:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629730; cv=none; d=google.com; s=arc-20160816; b=HjcoaWoiBsFnaNTiF8Of4ZPoUFdXic9o71mqe4yGMNSp5d18sy9nD7JrWkl8FwErLZ Ve0S++jYXr1i7oBaLTRcb8yoixZXKNJ6Kexlxg2JitgIAnGprnq2l+RullA/8kcNFYg0 JjFXsghF1X+V8OJo0ZQTaZeJHMr6ovmbDXA8UH86JegW/zYRfYnjoZT/xzXFGt9QdFe7 7ZeqvU42QYZMN/FSyvOvAc4sYG7iyxJTJzOe/UPko38lp27TrFGILqH9kHzd3X1cGSe8 PYeSontysansFP9rEmw8G13p4PxWPBhcWzafrlVPHyW+QbJ8OFX+FaKf0xKYQeOBbOcA 9GWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=zNy0TcES5/m+aDgRqodbhNlUoOm2VvPAyfDKqBqBXvM=; b=l02GP94I8mxptOgsr2F8uuprT5k0NgtUeEmgqOFoI2mAkX9C2VNRbWSiqe+FGPsGIS df3M/anlGoe6Y0NwQe7JPARRytGkIJi+LIsVrJCXfNugGAa1bH6x2clSHVHlUxNIIrwP X8DzvU3e70Opj1mxeCDwP35DQFU0bO085+la8ekYnIbQ56QP8GGZQxbOC1Bd0tY3KxUl lwx5H2iircx7cZ7KQHT4AVSAGBf+y9vIuo9zpEySnKvquHPcBYemqDdgPFgkrIcLiKEv AVrYzqHqacNHpvgHvn1A7f1EdFHrffF0c/pp6Sle1xQzRY8h93gq+ZlKzWyiCQz9spFY ugtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SRpwUf0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u189si12242574pgd.503.2022.01.31.03.48.38; Mon, 31 Jan 2022 03:48:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SRpwUf0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348788AbiA1W36 (ORCPT + 99 others); Fri, 28 Jan 2022 17:29:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235188AbiA1W35 (ORCPT ); Fri, 28 Jan 2022 17:29:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C45FC061714; Fri, 28 Jan 2022 14:29:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 166BA61EEF; Fri, 28 Jan 2022 22:29:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 046FDC340E7; Fri, 28 Jan 2022 22:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643408996; bh=/0PcLhzM3o3gTPcTwW++SS6uCEned56O6MZTTXV0Kuk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SRpwUf0fs/Ep35ll5BhkOoDKUd0qzePeblFcn100koZFuBviowiqLMMMbvfzVAi+x mdPIvRC4X8gVNpeU5aeNYbiK+aBYD+K71/SuzPQvGKyNzCOEtlEm6heFazznoiYuRZ mFZb+ubE7OF1UFB2VMcS0O7wALN/ptxyoT1mLlNTMCjBxtP0HVKkoIax4Cu7nUPPBN i0A2PIJ4NREwA0DS6TJPhFXYZsU59UgSzZazMlnL3nYciZVqFz8JPLMikclmp38dUk KtNrJflFmwgCIo6yAsnaNTSrecmCKKvJdbWbDu3VcnSgE+macV9y2AOo3t7LQi523c SoiPEjrhSry/A== Date: Fri, 28 Jan 2022 14:29:55 -0800 From: Jakub Kicinski To: Camel Guo Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , , Camel Guo , , , , Subject: Re: [PATCH] net: stmmac: dump gmac4 DMA registers correctly Message-ID: <20220128142955.047bd9d4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20220128153642.3129922-1-camel.guo@axis.com> References: <20220128153642.3129922-1-camel.guo@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 28 Jan 2022 16:36:42 +0100 Camel Guo wrote: > From: Camel Guo > > Unlike gmac100, gmac1000, gmac4 has 27 DMA registers and they are > located at DMA_CHAN_BASE_ADDR (0x1100). In order for ethtool to dump > gmac4 DMA registers correctly, this commit checks if a net_device has > gmac4 and uses different logic to dump its DMA registers. > > This fixes the following KASAN warning, which can normally be triggered > by a command similar like "ethtool -d eth0": > > BUG: KASAN: vmalloc-out-of-bounds in dwmac4_dump_dma_regs+0x6d4/0xb30 > Write of size 4 at addr ffffffc010177100 by task ethtool/1839 > kasan_report+0x200/0x21c > __asan_report_store4_noabort+0x34/0x60 > dwmac4_dump_dma_regs+0x6d4/0xb30 > stmmac_ethtool_gregs+0x110/0x204 > ethtool_get_regs+0x200/0x4b0 > dev_ethtool+0x1dac/0x3800 > dev_ioctl+0x7c0/0xb50 > sock_ioctl+0x298/0x6c4 > ... > > Signed-off-by: Camel Guo Can we get a Fixes tag for this? If it was always broken the Fixes tag should point to the commit which added gmac4 support.