linux/net/ethtool
Hangbin Liu b2fb1a3363 ethtool: strset: check nla_len overflow
The netlink attribute length field nla_len is a __u16, which can only
represent values up to 65535 bytes. NICs with a large number of
statistics strings (e.g. mlx5_core with thousands of ETH_SS_STATS
entries) can produce a ETHTOOL_A_STRINGSET_STRINGS nest that exceeds
this limit.

When nla_nest_end() writes the actual nest size back to nla_len, the
value is silently truncated. This results in a corrupted netlink message
being sent to userspace: the parser reads a wrong (truncated) attribute
length and misaligns all subsequent attribute boundaries, causing decode
errors.

Fix this by using the new helper nla_nest_end_safe and error out if
the size exceeds U16_MAX.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20260408-b4-ynl_ethtool-v2-5-7623a5e8f70b@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-04-12 11:23:50 -07:00
..
Makefile ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access 2025-11-03 18:32:27 -08:00
bitset.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
bitset.h net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
cabletest.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
channels.c net, ethtool: Disallow leased real rxqs to be resized 2026-04-09 18:21:46 -07:00
cmis.h
cmis_cdb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cmis_fw_update.c
coalesce.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
common.c ethtool: Add RSS indirection table resize helpers 2026-03-23 17:59:54 -07:00
common.h net: ethtool: add get_rx_ring_count callback to optimize RX ring queries 2025-09-18 07:07:37 -07:00
debug.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
eee.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
eeprom.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
features.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
fec.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
ioctl.c net, ethtool: Disallow leased real rxqs to be resized 2026-04-09 18:21:46 -07:00
linkinfo.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
linkmodes.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
linkstate.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
mm.c
module.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
module_fw.h
mse.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
netlink.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
netlink.h net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
pause.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
phc_vclocks.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
phy.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
plca.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
privflags.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
pse-pd.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
rings.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
rss.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
stats.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
strset.c ethtool: strset: check nla_len overflow 2026-04-12 11:23:50 -07:00
ts.h
tsconfig.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00
tsinfo.c net: ethtool: pass genl_info to the ethnl parse_request operation 2026-03-24 20:14:29 -07:00
tunnels.c
wol.c net: ethtool: re-order local includes 2026-03-20 19:10:18 -07:00