mirror-linux/drivers/net/usb
Laurent Vivier c7159e960f usbnet: limit max_mtu based on device's hard_mtu
The usbnet driver initializes net->max_mtu to ETH_MAX_MTU before calling
the device's bind() callback. When the bind() callback sets
dev->hard_mtu based the device's actual capability (from CDC Ethernet's
wMaxSegmentSize descriptor), max_mtu is never updated to reflect this
hardware limitation).

This allows userspace (DHCP or IPv6 RA) to configure MTU larger than the
device can handle, leading to silent packet drops when the backend sends
packet exceeding the device's buffer size.

Fix this by limiting net->max_mtu to the device's hard_mtu after the
bind callback returns.

See https://gitlab.com/qemu-project/qemu/-/issues/3268 and
    https://bugs.passt.top/attachment.cgi?bugid=189

Fixes: f77f0aee4d ("net: use core MTU range checking in USB NIC drivers")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Link: https://bugs.passt.top/show_bug.cgi?id=189
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Link: https://patch.msgid.link/20260119075518.2774373-1-lvivier@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-01-20 18:58:54 -08:00
..
Kconfig net: usb: lan78xx: add support for generic net selftests via ethtool 2025-08-25 16:22:19 -07:00
Makefile
aqc111.c
aqc111.h
asix.h
asix_common.c net: usb: asix: validate PHY address before use 2025-12-28 09:05:12 +01:00
asix_devices.c net: usb: asix_devices: Check return value of usbnet_get_endpoints 2025-10-29 17:51:48 -07:00
ax88172a.c net: usb: asix: validate PHY address before use 2025-12-28 09:05:12 +01:00
ax88179_178a.c
catc.c
cdc-phonet.c
cdc_eem.c
cdc_ether.c
cdc_mbim.c
cdc_ncm.c cdc_ncm: Flag Intel OEM version of Fibocom L850-GL as WWAN 2025-08-19 17:16:37 -07:00
cdc_subset.c
ch9200.c
cx82310_eth.c
dm9601.c net: usb: dm9601: remove broken SR9700 support 2026-01-15 19:47:28 -08:00
gl620a.c
hso.c
huawei_cdc_ncm.c
int51x1.c
ipheth.c
kalmia.c
kaweth.c
lan78xx.c net: usb: lan78xx: fix use of improperly initialized dev->chipid in lan78xx_reset 2025-10-15 18:27:48 -07:00
lan78xx.h
lg-vl600.c
mcs7830.c
net1080.c
pegasus.c net: usb: pegasus: fix memory leak in update_eth_regs_async() 2026-01-08 08:40:20 -08:00
pegasus.h
plusb.c
qmi_wwan.c net: usb: qmi_wwan: initialize MAC header offset in qmimux_rx_fixup 2025-11-03 17:36:49 -08:00
r8152.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-16 11:06:28 -07:00
r8153_ecm.c
rndis_host.c
rtl8150.c net: usb: rtl8150: fix memory leak on usb_submit_urb() failure 2025-12-23 12:12:34 +01:00
sierra_net.c
smsc75xx.c
smsc75xx.h
smsc95xx.c net: usb: smsc95xx: add support for ethtool pause parameters 2025-07-21 17:42:12 -07:00
smsc95xx.h
sr9700.c net: usb: sr9700: fix incorrect command used to write single register 2025-12-30 10:31:54 +01:00
sr9700.h
sr9800.c
sr9800.h
usbnet.c usbnet: limit max_mtu based on device's hard_mtu 2026-01-20 18:58:54 -08:00
zaurus.c