android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alan Stern a05ac5d00e net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb
commit 5e1627cb43ddf1b24b92eb26f8d958a3f5676ccb upstream.

The syzbot fuzzer identified a problem in the usbnet driver:

usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: CPU: 0 PID: 754 at drivers/usb/core/urb.c:504 usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504
Modules linked in:
CPU: 0 PID: 754 Comm: kworker/0:2 Not tainted 6.4.0-rc7-syzkaller-00014-g692b7dc87ca6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Workqueue: mld mld_ifc_work
RIP: 0010:usb_submit_urb+0xed6/0x1880 drivers/usb/core/urb.c:504
Code: 7c 24 18 e8 2c b4 5b fb 48 8b 7c 24 18 e8 42 07 f0 fe 41 89 d8 44 89 e1 4c 89 ea 48 89 c6 48 c7 c7 a0 c9 fc 8a e8 5a 6f 23 fb <0f> 0b e9 58 f8 ff ff e8 fe b3 5b fb 48 81 c5 c0 05 00 00 e9 84 f7
RSP: 0018:ffffc9000463f568 EFLAGS: 00010086
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff88801eb28000 RSI: ffffffff814c03b7 RDI: 0000000000000001
RBP: ffff8881443b7190 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000003
R13: ffff88802a77cb18 R14: 0000000000000003 R15: ffff888018262500
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000556a99c15a18 CR3: 0000000028c71000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 usbnet_start_xmit+0xfe5/0x2190 drivers/net/usb/usbnet.c:1453
 __netdev_start_xmit include/linux/netdevice.h:4918 [inline]
 netdev_start_xmit include/linux/netdevice.h:4932 [inline]
 xmit_one net/core/dev.c:3578 [inline]
 dev_hard_start_xmit+0x187/0x700 net/core/dev.c:3594
...

This bug is caused by the fact that usbnet trusts the bulk endpoint
addresses its probe routine receives in the driver_info structure, and
it does not check to see that these endpoints actually exist and have
the expected type and directions.

The fix is simply to add such a check.

Reported-and-tested-by: [email protected]
Closes: https://lore.kernel.org/linux-usb/[email protected]/
Signed-off-by: Alan Stern <[email protected]>
CC: Oliver Neukum <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-08-11 11:53:59 +02:00
..
appletalk
arcnet
bonding bonding: reset bond's flags when down link is P2P device 2023-08-11 11:53:48 +02:00
caif
can can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED 2023-08-11 11:53:50 +02:00
dsa net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch 2023-06-28 10:18:39 +02:00
ethernet net: ll_temac: fix error checking of irq_of_parse_and_map() 2023-08-11 11:53:57 +02:00
fddi net: defxx: Fix missing err handling in dfx_init() 2023-01-18 11:41:13 +01:00
fjes
hamradio hamradio: baycom_epp: Fix return type of baycom_send_packet() 2023-01-18 11:41:35 +01:00
hippi
hyperv hv_netvsc: Fix race between VF offering and VF association message from host 2022-10-29 10:20:36 +02:00
ieee802154 ieee802154: hwsim: Fix possible memory leaks 2023-06-28 10:18:38 +02:00
ipvlan ipvlan: Fix return value of ipvlan_queue_xmit() 2023-07-27 08:37:12 +02:00
netdevsim
phy Revert "net: phy: dp83867: perform soft reset and retain established link" 2023-06-28 10:18:40 +02:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-14 11:30:48 +01:00
ppp ppp: associate skb with a device at tx 2023-01-18 11:41:37 +01:00
slip
team team: reset team's flags when down link is P2P device 2023-08-11 11:53:48 +02:00
usb net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb 2023-08-11 11:53:59 +02:00
vmxnet3
wan net: lapbether: only support ethernet devices 2023-06-21 15:44:12 +02:00
wimax
wireless wifi: iwlwifi: mvm: avoid baid size integer overflow 2023-07-27 08:37:42 +02:00
xen-netback xen/netback: Fix buffer overrun triggered by unusual packet 2023-08-08 19:56:37 +02:00
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-07-27 08:37:11 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2023-01-18 11:40:49 +01:00
macsec.c
macvlan.c macvlan: enforce a consistent minimal mtu 2022-11-25 17:42:21 +01:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c net/net_failover: fix txq exceeding warning 2023-04-05 11:16:44 +02:00
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2023-01-18 11:41:16 +01:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 11:53:59 +02:00
thunderbolt.c net: thunderbolt: Fix error handling in tbnet_init() 2022-11-25 17:42:16 +01:00
tun.c net: tun_chr_open(): set sk_uid from current_fsuid() 2023-08-11 11:53:59 +02:00
veth.c
virtio_net.c virtio-net: fix race between set queues and probe 2023-08-11 11:53:52 +02:00
vrf.c
vsockmon.c
vxlan.c vxlan: calculate correct header length for GPE 2023-08-11 11:53:47 +02:00
xen-netfront.c xen-netfront: Fix NULL sring after live migration 2022-12-14 11:30:45 +01:00