From: Simon Horman <horms@kernel.org>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
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
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 [thread overview]
Message-ID: <20261124115415.GM31322@horms.kernel.org> (raw)
In-Reply-To: <CALs4sv1iZrM29XeJ7b=veiC1XdT=xo0wBxYm1z4PLWiOAC5N2w@mail.gmail.com>
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>
prev parent reply other threads:[~2026-11-24 11:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:54 [PATCH net v3 0/3] tg3: Bug fixes Pavan Chebbi
2026-11-18 10:52 ` netdev-bot+sinfo
2026-11-18 10:54 ` [PATCH net v3 1/3] tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported Pavan Chebbi
2026-11-22 11:07 ` netdev-bot+sashiko
2026-11-24 11:43 ` Simon Horman
2026-11-18 10:54 ` [PATCH net v3 2/3] tg3: Skip management FW version when APE firmware is not ready Pavan Chebbi
2026-11-24 11:46 ` Simon Horman
2026-11-18 10:54 ` [PATCH net v3 3/3] tg3: Fix heap overflow in unbuffered NVRAM write path Pavan Chebbi
2026-11-22 11:07 ` netdev-bot+sashiko
2026-11-22 11:43 ` Pavan Chebbi
2026-11-24 11:54 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124115415.GM31322@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=shravya.k-n@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox