linux/drivers/net/usb
Xiang Mei 8ff7f2a6da usbnet: gl620a: fix out-of-bounds read in genelink_rx_fixup()
genelink_rx_fixup() splits an aggregated RX frame into its individual
packets, using a per-packet length taken from device-supplied data. That
length is only bounded by GL_MAX_PACKET_LEN (1514); it is never compared
against how many bytes were actually received.

A malicious GeneLink (GL620A) device can therefore send a short URB whose
header claims packet_count > 1 and a first packet of up to 1514 bytes.

	skb_put_data(gl_skb, packet->packet_data, size);

then copies past the end of the receive buffer and hands the adjacent slab
contents up the network stack, an out-of-bounds read that leaks kernel heap.
No privilege is required: the path runs in the usbnet RX softirq as soon as
the interface is up.

  BUG: KASAN: slab-out-of-bounds in genelink_rx_fixup (drivers/net/usb/gl620a.c:112)
  Read of size 1514 at addr ffff888011309708 by task ksoftirqd/0/14
  Call Trace:
    ...
    __asan_memcpy (mm/kasan/shadow.c:105)
    genelink_rx_fixup (include/linux/skbuff.h:2814 drivers/net/usb/gl620a.c:112)
    usbnet_bh (drivers/net/usb/usbnet.c:572 drivers/net/usb/usbnet.c:1589)
    process_one_work (kernel/workqueue.c:3322)
    bh_worker (kernel/workqueue.c:3405)
    tasklet_action (kernel/softirq.c:965)
    handle_softirqs (kernel/softirq.c:622)
    run_ksoftirqd (kernel/softirq.c:1076)
    ...

skb_pull() already verifies that the requested length fits the buffer and
returns NULL otherwise. Move it ahead of the copy and check its result, so
a packet that overruns the received data is rejected before it is read.
Well-formed frames, whose packets are fully present, are unaffected.

Fixes: 47ee3051c8 ("[PATCH] USB: usbnet (5/9) module for genesys gl620a cables")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Link: https://patch.msgid.link/20260627205353.4000788-1-xmei5@asu.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-29 18:54:46 -07:00
..
aqc111.c net: usb: aqc111: Do not perform PM inside suspend callback 2026-03-17 13:36:12 +01:00
aqc111.h
asix_common.c net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
asix_devices.c net: usb: asix: ax88772: re-add usbnet_link_change() in phylink callbacks 2026-05-04 19:04:15 -07:00
asix.h net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
ax88172a.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ax88179_178a.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
catc.c net: usb: catc: enable basic endpoint checking 2026-02-17 11:53:36 +01:00
cdc_eem.c
cdc_ether.c net: usb: cdc-ether: unify error handling in probe 2026-03-14 12:22:01 -07:00
cdc_mbim.c drivers: net: drop ipv6_stub usage and use direct function calls 2026-03-29 11:21:23 -07:00
cdc_ncm.c net: usb: cdc_ncm: add Apple Mac USB-C direct networking quirk 2026-05-01 17:17:27 -07:00
cdc_subset.c
cdc-phonet.c net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete() 2026-04-14 12:05:01 +02:00
ch9200.c net: ch9200: fix uninitialised access during mii_nway_restart 2025-05-28 19:10:04 -07:00
cx82310_eth.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm9601.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
gl620a.c usbnet: gl620a: fix out-of-bounds read in genelink_rx_fixup() 2026-06-29 18:54:46 -07:00
hso.c net: hso: refactor endpoint lookup 2026-03-31 19:23:41 -07:00
huawei_cdc_ncm.c
int51x1.c net: usb: int51x1: use usbnet_cdc_update_filter 2026-01-27 17:55:32 -08:00
ipheth.c net: ipeth: refactor endpoint lookup 2026-03-31 19:23:41 -07:00
kalmia.c net: usb: kalmia: bound RX frame length in kalmia_rx_fixup() 2026-06-24 19:00:07 -07:00
kaweth.c net: usb: kaweth: validate USB endpoints 2026-02-25 18:58:05 -08:00
Kconfig net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
lan78xx.c net: usb: lan78xx: restore VLAN and hash filters after link up 2026-06-23 14:50:06 -07:00
lan78xx.h net: usb: lan78xx: fix silent drop of packets with checksum errors 2026-03-09 19:48:33 -07:00
lg-vl600.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile
mcs7830.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
net1080.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
pegasus.c net: usb: pegasus: replace simple_strtoul with kstrtouint 2026-05-13 18:06:56 -07:00
pegasus.h
plusb.c
qmi_wwan.c net: usb: qmi_wwan: add MeiG SRM813Q 2026-05-20 16:55:12 -07:00
r8152.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
r8153_ecm.c cdc_ether|r8152: ThinkPad Hybrid USB-C/A Dock quirk 2025-03-17 21:25:25 +01:00
rndis_host.c rndis_host: enable power management for Telit LE310X1 2026-06-04 18:10:56 -07:00
rtl8150.c net: usb: rtl8150: free skb on usb_submit_urb() failure in xmit 2026-04-27 17:51:14 -07:00
sierra_net.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smsc75xx.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
smsc75xx.h
smsc95xx.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smsc95xx.h
sr9700.c net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
sr9700.h net: usb: sr9700: remove code to drive nonexistent multicast filter 2026-02-03 19:42:15 -08:00
sr9800.c net: usb: introduce usbnet_mii_ioctl helper function 2026-02-03 19:41:19 -08:00
sr9800.h net: usb: remove unnecessary get_drvinfo code and driver versions 2026-01-30 17:44:18 -08:00
usbnet.c net: usb: usbnet: use proper ep number macros 2026-05-14 18:19:03 -07:00
zaurus.c