Article View: linux.kernel.netdev
Article #21741Re: [PATCH net v3 3/3] tg3: Fix heap overflow in unbuffered NVRAM write path
From: Simon Horman
Date: Tue, 24 Nov 2026 11:54
Date: Tue, 24 Nov 2026 11:54
22 lines
8999 bytes
8999 bytes
On Sun, Nov 22, 2026 at 05:13:51PM +0530, Pavan Chebbi wrote: > On Sun, Nov 22, 2026 at 4:37 PM <netdev-bot+sashiko@kernel.org> wrote: ... > Yes, ethtool -E will now fail with -EINVAL on 5750/5780 boards with SST > flash, since SST_25VF0X0_PAGE_SIZE is 4098. But the unbuffered path > cannot work correctly with a non power of two page size. With pagemask as > 0x1001, phy_addr is not always page aligned, the read loop runs to > j = 4096 and writes 4 bytes at tmp + 4096 of a 4098 byte kmalloc buffer, > which KASAN reports as out of bounds, the program loop then programs 4100 > bytes, and NVRAM_CMD_LAST is never set because pagesize - 4 is 4094. I > have no such board to test, so I cannot say how these writes behaved > in practice, > but refusing them looks better than erasing a sector and programming past it. > > Also I would rather not change the constant to 4096 in this patch. That > would enable the unbuffered erase and program sequence on SST parts for > the first time, and I cannot validate it on hardware. Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261124115415.GM31322@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370296-linux-kernel-netdev=dewy.ruReferences:
<20261118105408.1076095-4-pavan.chebbi@broadcom.com> <179534562327.3135.6438737872601204289@kernel.org> <CALs4sv1iZrM29XeJ7b=veiC1XdT=xo0wBxYm1z4PLWiOAC5N2w@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370296-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 3/3] tg3: Fix heap overflow in unbuffered NVRAM write path Date: Tue, 24 Nov 2026 11:54:15 +0000 Organization: Usenet Network Message-ID: <20261124115415.GM31322@horms.kernel.org> References: <20261118105408.1076095-4-pavan.chebbi@broadcom.com> <179534562327.3135.6438737872601204289@kernel.org> <CALs4sv1iZrM29XeJ7b=veiC1XdT=xo0wBxYm1z4PLWiOAC5N2w@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4127534"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:nlV5rUt4rhvQQG42E96nwFoVRl4= sha256:xWknZJv6IVLyyOxn+uekyt25L0GHc3/mHEq61dsCYAM= sha1:wkIq0UAPN3bx0hYQkWvsmx5sFSw= sha256:MwbsOv7k/7IYdUfGPL7XJzkNElbD+3vBV01kCEZ+g7k= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 72FF3125E00; Tue, 24 Nov 2026 14:54:39 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LsEDcFNP9sKc; Tue, 24 Nov 2026 14:54:34 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370296-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4C354125DFC; Tue, 24 Nov 2026 14:54:24 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 1F933381F8; Tue, 24 Nov 2026 11:54:22 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795521261; b=PJDl6/I6PJfwH9OkOo9sIt0jlBZyS4tx5IJViP4LW9SUwSGajvdiWiSZDqEPFaLOXD3P ihqVs1W3f+MR4S0lqc7+Hu2GzhcIT3OKB1153QwmrKmFfW9Q+OaeomfyN6cy/Y/iSg2qN 5hU1CRQXmYthgocO3OgoXonwRlU/4+eyj1nh4gevxuU41Fz0Sm5n0yhLVhxNDMArC9MkQ v+4bERwuAqZuiqduuAEBJScQZlqdXsrXJ1Q/9+AMYLm0I5F1Fx+Mhtypa6ZaHH+tKuq8M MY1EshYvByRYYFn5cBBVU6n1Ff9PM1MMbt82TpuTno8DkTc3zq3ubE9tm3CYvyOWu2Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795521261; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=5z2ZLB6LGpnYC7gHMcEPo7+znCPfMIHxbLDX8r/bzlc=; b=1LhYfP8hh+c/U2o8Lg/Fds1TDNAsqcHiQhthy/PY6JhcA3/pSzpfz5kfgjTOfP4vj6Eo Fvi4sgnjHaN+nt7dPMudOjUqgh1wgJYyydyfIHnE/LR/BtRORFn+PMbmN4BoDW4bVzQlu w7WaU+e+IkJ4RJxHWK4QDUDfakuXuNPTL0+Ir+MYscZ37UjvMkjPAwj+ojo1lBX0TSDA8 iVBCSRN99WT55+NqxMNr+EMLS3mgUDEOzt1spVUcSx144jiDRU73WKfq7LzSIqXX3L9Bl QzASwCd69O3qTp3IU64SkEpeP/JzmJkuk2yC0MuJpdjsycyaspFH+TPGPVHf7mPpBNw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9bRIz2x; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB306606A32E; Tue, 24 Nov 2026 11:54:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9bRIz2x X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795521261; b=p8I2IKDCQsQ/QbBDMxTy38AzgelcfzMW1nQj8pnK5tCIKW3YXtiqWZnVlyVX7XGYMFJX 7MYSnGIHjLeV1uTEuh30YcLGupVVZosUb1ccTkqd63/2ittAsFyCAM/irswHLEqjBjjWe 7jU9mFo6ckv4VnW7UCD+HQo8q5ung2vcrjuuQMIFJUEcquZfpew7DwENOQFER5ybqAko/ mzq5LAHCCaUOwr7+OmxP/+PPOWRc87WPQfZ/cCCWqartCewRirH8+Zk3QDSFKCE/F48NS 7C7cTyVL6pNO4DkLZjdk0eFhpaWDoP2OvYEq5a7TmoScV5x6K4KolJu+9PlIv7iCXbQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795521261; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=5z2ZLB6LGpnYC7gHMcEPo7+znCPfMIHxbLDX8r/bzlc=; b=5Niu+aFQMiUmPyyR813Fx3J0r3rpTFxFqd7i+gkz3bk1SsMJgD13BOTpuGlzoRj0Oe6s 7PD6Yz4150K0Y0ysDI2J/dgsYGmokzr87tHUQfYBtUs+Wo8mJ/C/ykaP+yf+00fU1pz/c SG6vcOIXqkzCM0kLmm0Y5Sj2sEXH054lgNvdkepez1VdNvwEXjG6IGF9Ko3CJQhw5sJBR KiS7rjTA+e4Bvs1hleV0+Kee0PE3eFUDKbT2Wl3JJK48Axf6B0WRfqeFx6VEd/oqX/9xd LApxCgeW9IHXSpg/qnhz6EkBMWztqqRDm4h5HXZ9oLO8PSsQ6fiaIazsBE6wEn1SffQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9bRIz2x; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9E68606A31E for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 11:54:20 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3C6E1F000C4; Tue, 24 Nov 2026 11:54:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795521260; bh=5z2ZLB6LGpnYC7gHMcEPo7+znCPfMIHxbLDX8r/bzlc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Y9bRIz2xr4e78AVBWAWE9dMYYV5lXFg5AboPK6Xe9vYWUszbP83/s4cid4cVEsSA0 HgwWVo7xVo3fQrE/00VH+afWcJ75E/7xriOOwlXqZceCGcMjm5Jl5e4oi8/MbeMvbu DWZvSdtcOCvFhXRqpIMmf4UbI+Bky4XY8wZSPqC0cBrQUN4mA24QVtlixVj9NZqEdB ZJsh4hzodb8kdKpcYC5AcI6tQWS1+PAgETfcBjaGC+skCXIo2MKKu2PI7ZHyP/FTpL U44NpWFzdwdS2MSbWzYl95I0fp98Oq/B33rZBSYcnbJv9b09rMIs5ubLJUPQq3fn4K lM4aqtCMJkjxA== X-Cc: netdev-bot+sashiko@kernel.org, michael.chan@broadcom.com, kuba@kernel.org, andrew+netdev@lunn.ch, andrew.gospodarek@broadcom.com, davem@davemloft.net, edumazet@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, shravya.k-n@broadcom.com X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <CALs4sv1iZrM29XeJ7b=veiC1XdT=xo0wBxYm1z4PLWiOAC5N2w@mail.gmail.com>