[PATCH net-next 0/9] net: safe guard net/core/tso.c users

Eric Dumazet
2026-04-03T04:32:40Z

Most net/core/tso.c users assume headers length is smaller than
TSO_HEADER_SIZE. This is because they use pre-allocated and
pre-mapped piece of memory of (N * TSO_HEADER_SIZE) bytes.

Add tso_features_check() helper so that these drivers
can request a fallback to GSO if headers are too big.

We could in the future add more checks in tso_features_check()
against max number of segments per TSO packet, as many
drivers also seem to drop packets if gso_size is too small
relative to their TX ring sizes.

Eric Dumazet (9):
net: tso: add tso_features_check()
net: mvneta: use tso_features_check()
net: thunderx: use tso_features_check()
dpaa2-eth: use tso_features_check()
net: enetc: use tso_features_check()
net: fec: use tso_features_check()
net: mv643xx_eth: use tso_features_check()
net: mvpp2: use tso_features_check()
octeontx2-pf: use tso_features_check()

drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 ++
drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 1 +
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 ++
drivers/net/ethernet/freescale/enetc/enetc.c | 2 ++
drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 2 ++
drivers/net/ethernet/freescale/enetc/enetc_pf.c | 2 ++
drivers/net/ethernet/freescale/enetc/enetc_vf.c | 2 ++
drivers/net/ethernet/freescale/fec_main.c | 2 ++
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 ++
drivers/net/ethernet/marvell/mvneta.c | 2 ++
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++
.../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 1 +
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++
include/net/tso.h | 11 +++++++++++
net/core/tso.c | 12 ++++++++++++
17 files changed, 51 insertions(+)

--
2.53.0.1213.gd9a14994de-goog