* [PATCH net] net: bgmac: fix oversized RX frame check
@ 2026-10-23 0:53 Rosen Penev
2026-10-23 0:57 ` netdev-bot+sinfo
0 siblings, 1 reply; 6+ messages in thread
From: Rosen Penev @ 2026-10-23 0:53 UTC (permalink / raw)
To: netdev
Cc: Rafał Miłecki, Broadcom internal kernel review list,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Felix Fietkau, open list
The RX length sanity check compares the length reported in the RX
header against BGMAC_RX_ALLOC_SIZE. That is the size of the whole
fragment, including the space reserved for struct skb_shared_info.
The data area handed to the hardware is only BGMAC_RX_BUF_SIZE bytes,
and the frame starts BGMAC_RX_FRAME_OFFSET bytes into it, so a valid
frame is at most BGMAC_RX_MAX_FRAME_SIZE bytes long.
A corrupted length between those two limits passes the check, and the
following skb_put() runs past the skb tailroom and calls
skb_over_panic() instead of dropping the frame.
Compare against BGMAC_RX_MAX_FRAME_SIZE instead.
Only compile tested. Not tested on hardware.
Fixes: 6a6c708469c9 ("bgmac: add check for oversized packets")
Suggested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index b3a92ae95de3..6873c7bb7a14 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -455,7 +455,7 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
break;
}
- if (len > BGMAC_RX_ALLOC_SIZE) {
+ if (len > BGMAC_RX_MAX_FRAME_SIZE) {
if (net_ratelimit())
netdev_err(bgmac->net_dev, "Found oversized packet at slot %d, DMA issue!\n",
ring->start);
--
2.56.0
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net] net: bgmac: fix oversized RX frame check
2026-10-23 0:53 [PATCH net] net: bgmac: fix oversized RX frame check Rosen Penev
@ 2026-10-23 0:57 ` netdev-bot+sinfo
2026-10-23 1:00 ` Rosen Penev
0 siblings, 1 reply; 6+ messages in thread
From: netdev-bot+sinfo @ 2026-10-23 0:57 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Rafał Miłecki,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Felix Fietkau, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: bgmac: fix oversized RX frame check
2026-10-23 0:57 ` netdev-bot+sinfo
@ 2026-10-23 1:00 ` Rosen Penev
2026-10-23 19:36 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Rosen Penev @ 2026-10-23 1:00 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: netdev, Rafał Miłecki,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Felix Fietkau, linux-kernel
On Thu, Oct 22, 2026 at 5:57 PM <netdev-bot+sinfo@kernel.org> wrote:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
I added Suggested-by in the commit. LLM only used for the description.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: bgmac: fix oversized RX frame check
2026-10-23 1:00 ` Rosen Penev
@ 2026-10-23 19:36 ` Jakub Kicinski
2026-10-23 20:08 ` Florian Fainelli
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-10-23 19:36 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev-bot+sinfo, netdev, Rafał Miłecki,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Paolo Abeni, Felix Fietkau,
linux-kernel
On Thu, 22 Oct 2026 18:00:53 -0700 Rosen Penev wrote:
> > - How the issue was discovered, e.g. hit in production, hit during
> > development, syzbot report, manual code inspection, LLM or static
> > analysis tool scan.
> I added Suggested-by in the commit. LLM only used for the description.
Suggested by is for suggestion of how to write the code,
if Florian reported it appropriate tag is Reported-by
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: bgmac: fix oversized RX frame check
2026-10-23 19:36 ` Jakub Kicinski
@ 2026-10-23 20:08 ` Florian Fainelli
2026-10-23 20:46 ` Rosen Penev
0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2026-10-23 20:08 UTC (permalink / raw)
To: Jakub Kicinski, Rosen Penev
Cc: netdev-bot+sinfo, netdev, Rafał Miłecki,
Broadcom internal kernel review list, Andrew Lunn,
David S. Miller, Eric Dumazet, Paolo Abeni, Felix Fietkau,
linux-kernel
On 10/23/26 12:36, 'Jakub Kicinski' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
> On Thu, 22 Oct 2026 18:00:53 -0700 Rosen Penev wrote:
>>> - How the issue was discovered, e.g. hit in production, hit during
>>> development, syzbot report, manual code inspection, LLM or static
>>> analysis tool scan.
>> I added Suggested-by in the commit. LLM only used for the description.
>
> Suggested by is for suggestion of how to write the code,
> if Florian reported it appropriate tag is Reported-by
This was a suggestion, so I think it is appropriately being used here.
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: bgmac: fix oversized RX frame check
2026-10-23 20:08 ` Florian Fainelli
@ 2026-10-23 20:46 ` Rosen Penev
0 siblings, 0 replies; 6+ messages in thread
From: Rosen Penev @ 2026-10-23 20:46 UTC (permalink / raw)
To: Florian Fainelli
Cc: Jakub Kicinski, netdev-bot+sinfo, netdev,
Rafał Miłecki, Broadcom internal kernel review list,
Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Felix Fietkau, linux-kernel
On Fri, Oct 23, 2026 at 1:08 PM Florian Fainelli
<florian.fainelli@broadcom.com> wrote:
>
> On 10/23/26 12:36, 'Jakub Kicinski' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
> > On Thu, 22 Oct 2026 18:00:53 -0700 Rosen Penev wrote:
> >>> - How the issue was discovered, e.g. hit in production, hit during
> >>> development, syzbot report, manual code inspection, LLM or static
> >>> analysis tool scan.
> >> I added Suggested-by in the commit. LLM only used for the description.
> >
> > Suggested by is for suggestion of how to write the code,
> > if Florian reported it appropriate tag is Reported-by
>
> This was a suggestion, so I think it is appropriately being used here.
So do I apply both tags?
> --
> Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-23 20:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 0:53 [PATCH net] net: bgmac: fix oversized RX frame check Rosen Penev
2026-10-23 0:57 ` netdev-bot+sinfo
2026-10-23 1:00 ` Rosen Penev
2026-10-23 19:36 ` Jakub Kicinski
2026-10-23 20:08 ` Florian Fainelli
2026-10-23 20:46 ` Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®