* [PATCH net] net: lib8390: avoid truncating the expected receive page
@ 2026-11-18 2:22 Tim Douglas
2026-11-19 11:48 ` Daniel Machon
2026-11-21 21:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Tim Douglas @ 2026-11-18 2:22 UTC (permalink / raw)
To: netdev; +Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel
For a receive ring ending at page 0xff, the expected next page can
exceed 0xff before the ring size is subtracted. The value is
truncated when stored in an unsigned char, so a valid frame that
wraps around the ring can be rejected and queued frames dropped.
Store the intermediate value in an int.
This was observed with the 64 KiB receive ring enabled on a
Farallon EtherMac LC-TP. With the fix, three 16 MiB downloads on a
Performa 6200CD using a kernel with local platform support completed
without receive errors. The pcnet_cs driver also uses a receive ring
ending at page 0xff for Socket EA cards with the large buffer enabled.
AI assistance was used to investigate the receive errors and draft
the fix.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Tim Douglas <me@timdoug.com>
---
drivers/net/ethernet/8390/lib8390.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index 84aeb8054..93c514602 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -660,7 +660,8 @@ static void ei_receive(struct net_device *dev)
{
unsigned long e8390_base = dev->base_addr;
struct ei_device *ei_local = netdev_priv(dev);
- unsigned char rxing_page, this_frame, next_frame;
+ unsigned char rxing_page, this_frame;
+ int next_frame;
unsigned short current_offset;
int rx_pkt_count = 0;
struct e8390_pkt_hdr rx_frame;
base-commit: 76115f0ab948a6aeb66a0b9bd4e074ed52cd6946
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] net: lib8390: avoid truncating the expected receive page
2026-11-18 2:22 [PATCH net] net: lib8390: avoid truncating the expected receive page Tim Douglas
@ 2026-11-19 11:48 ` Daniel Machon
2026-11-21 21:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Machon @ 2026-11-19 11:48 UTC (permalink / raw)
To: Tim Douglas
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel
> For a receive ring ending at page 0xff, the expected next page can
> exceed 0xff before the ring size is subtracted. The value is
> truncated when stored in an unsigned char, so a valid frame that
> wraps around the ring can be rejected and queued frames dropped.
> Store the intermediate value in an int.
>
> This was observed with the 64 KiB receive ring enabled on a
> Farallon EtherMac LC-TP. With the fix, three 16 MiB downloads on a
> Performa 6200CD using a kernel with local platform support completed
> without receive errors. The pcnet_cs driver also uses a receive ring
> ending at page 0xff for Socket EA cards with the large buffer enabled.
>
> AI assistance was used to investigate the receive errors and draft
> the fix.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Tim Douglas <me@timdoug.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] net: lib8390: avoid truncating the expected receive page
2026-11-18 2:22 [PATCH net] net: lib8390: avoid truncating the expected receive page Tim Douglas
2026-11-19 11:48 ` Daniel Machon
@ 2026-11-21 21:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-21 21:10 UTC (permalink / raw)
To: Tim Douglas
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 17 Nov 2026 21:22:17 -0500 you wrote:
> For a receive ring ending at page 0xff, the expected next page can
> exceed 0xff before the ring size is subtracted. The value is
> truncated when stored in an unsigned char, so a valid frame that
> wraps around the ring can be rejected and queued frames dropped.
> Store the intermediate value in an int.
>
> This was observed with the 64 KiB receive ring enabled on a
> Farallon EtherMac LC-TP. With the fix, three 16 MiB downloads on a
> Performa 6200CD using a kernel with local platform support completed
> without receive errors. The pcnet_cs driver also uses a receive ring
> ending at page 0xff for Socket EA cards with the large buffer enabled.
>
> [...]
Here is the summary with links:
- [net] net: lib8390: avoid truncating the expected receive page
https://git.kernel.org/netdev/net-next/c/720a6f58c0ba
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-21 21:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 2:22 [PATCH net] net: lib8390: avoid truncating the expected receive page Tim Douglas
2026-11-19 11:48 ` Daniel Machon
2026-11-21 21:10 ` patchwork-bot+netdevbpf
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®