Thread (2 messages) 2 messages, 2 authors, 24d ago

Re: [PATCH net v2] net: fec: reject oversized fragments before bounce-buffer memcpy

flat view

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-09-24 12:40:53
Also in: imx, lkml, stable

On Wed, Sep 23, 2026 at 06:22:01PM -0300, Aldo Ariel wrote:
Hi Andrew,

PKT_MAXBUF_SIZE = round_down(2048 - 64, 64) = 1984
max_mtu (non-jumbo) = 1984 - VLAN_ETH_HLEN - ETH_FCS_LEN = 1962

So for standard MTU, max_mtu < FEC_ENET_TX_FRSIZE and individual
fragments should not exceed the bounce buffer.

However, when the device supports jumbo frames,
max_buf_size = MAX_JUMBO_BUF_SIZE (~16256) and max_mtu reaches ~16234.
Scatter-gather fragments in that case can exceed FEC_ENET_TX_FRSIZE
while still needing the bounce path for alignment or byte-swap.

Should I respin with a check only for the jumbo path, or is the
unconditional guard acceptable?
Can bounce buffers and jumbo be used at the same time?

How is the scatter-gather size determined? Maybe the better fix is to
set the fragment size based on the size of the bounce buffer when it
is in use?

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help