All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+63ee658b9a100ffadbe2@syzkaller.appspotmail.com>
To: kuba@kernel.org, linux-usb@vger.kernel.org, oneukum@suse.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in usbnet_start_xmit/usb_submit_urb
Date: Thu, 18 Nov 2021 09:34:07 -0800	[thread overview]
Message-ID: <000000000000c5f54305d113905e@google.com> (raw)
In-Reply-To: <208f1478-42b2-9db2-4a81-dc8f64bbabbc@suse.com>

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-out-of-bounds Read in usbnet_probe

usb 4-1: config 0 interface 0 altsetting 0 endpoint 0x2 has an invalid bInterval 87, changing to 10
usb 4-1: New USB device found, idVendor=0547, idProduct=2727, bcdDevice=e6.98
usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 4-1: config 0 descriptor??
==================================================================
BUG: KASAN: slab-out-of-bounds in usb_endpoint_xfer_bulk include/uapi/linux/usb/ch9.h:518 [inline]
BUG: KASAN: slab-out-of-bounds in usb_endpoint_is_bulk_in include/uapi/linux/usb/ch9.h:573 [inline]
BUG: KASAN: slab-out-of-bounds in usbnet_probe+0x1b6e/0x2760 drivers/net/usb/usbnet.c:1776
Read of size 1 at addr ffff88811ac09623 by task kworker/1:2/668

CPU: 1 PID: 668 Comm: kworker/1:2 Not tainted 5.15.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 usb_endpoint_xfer_bulk include/uapi/linux/usb/ch9.h:518 [inline]
 usb_endpoint_is_bulk_in include/uapi/linux/usb/ch9.h:573 [inline]
 usbnet_probe+0x1b6e/0x2760 drivers/net/usb/usbnet.c:1776
 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:517 [inline]
 really_probe+0x245/0xcc0 drivers/base/dd.c:596
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x228/0x4a0 drivers/base/dd.c:969
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xc17/0x1ee0 drivers/base/core.c:3396
 usb_set_configuration+0x113f/0x1910 drivers/usb/core/message.c:2170
 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:517 [inline]
 really_probe+0x245/0xcc0 drivers/base/dd.c:596
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x228/0x4a0 drivers/base/dd.c:969
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xc17/0x1ee0 drivers/base/core.c:3396
 usb_new_device.cold+0x63f/0x108e drivers/usb/core/hub.c:2563
 hub_port_connect drivers/usb/core/hub.c:5348 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5488 [inline]
 port_event drivers/usb/core/hub.c:5634 [inline]
 hub_event+0x2357/0x4330 drivers/usb/core/hub.c:5716
 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445
 kthread+0x40b/0x500 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88811ac09600
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 35 bytes inside of
 96-byte region [ffff88811ac09600, ffff88811ac09660)
The buggy address belongs to the page:
page:ffffea00046b0240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11ac09
flags: 0x200000000000200(slab|node=0|zone=2)
raw: 0200000000000200 0000000000000000 dead000000000122 ffff888100041780
raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 1873, ts 80842457098, free_ts 80530458047
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1254/0x2980 mm/page_alloc.c:4155
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381
 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191
 alloc_slab_page mm/slub.c:1770 [inline]
 allocate_slab mm/slub.c:1907 [inline]
 new_slab+0x319/0x490 mm/slub.c:1970
 ___slab_alloc+0x8b9/0xfa0 mm/slub.c:3001
 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088
 slab_alloc_node mm/slub.c:3179 [inline]
 slab_alloc mm/slub.c:3221 [inline]
 __kmalloc+0x2ee/0x310 mm/slub.c:4396
 kmalloc_array include/linux/slab.h:631 [inline]
 kcalloc include/linux/slab.h:660 [inline]
 ext4_find_extent+0xa47/0xd00 fs/ext4/extents.c:865
 ext4_ext_map_blocks+0x1e2/0x6140 fs/ext4/extents.c:4066
 ext4_map_blocks+0x653/0x17d0 fs/ext4/inode.c:637
 ext4_convert_unwritten_extents+0x2db/0x5b0 fs/ext4/extents.c:4773
 ext4_convert_unwritten_io_end_vec+0x122/0x270 fs/ext4/extents.c:4812
 ext4_end_io_end fs/ext4/page-io.c:184 [inline]
 ext4_do_flush_completed_IO fs/ext4/page-io.c:257 [inline]
 ext4_end_io_rsv_work+0x2b3/0x660 fs/ext4/page-io.c:271
 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445
 kthread+0x40b/0x500 kernel/kthread.c:327
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare+0x315/0x710 mm/page_alloc.c:1391
 free_unref_page_prepare mm/page_alloc.c:3317 [inline]
 free_unref_page+0x19/0x580 mm/page_alloc.c:3396
 tlb_batch_list_free mm/mmu_gather.c:61 [inline]
 tlb_finish_mmu+0x24f/0x8c0 mm/mmu_gather.c:343
 unmap_region+0x27f/0x350 mm/mmap.c:2653
 __do_munmap+0x600/0x1260 mm/mmap.c:2884
 __do_sys_brk+0x4b2/0x7d0 mm/mmap.c:255
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Memory state around the buggy address:
 ffff88811ac09500: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff88811ac09580: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
>ffff88811ac09600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                               ^
 ffff88811ac09680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811ac09700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


Tested on:

commit:         048ff862 Merge tag 'usb-5.16-rc1' of git://git.kernel...
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11fb14f6b00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d6b387bc5d3e50f3
dashboard link: https://syzkaller.appspot.com/bug?extid=63ee658b9a100ffadbe2
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch:          https://syzkaller.appspot.com/x/patch.diff?x=103818a1b00000


  reply	other threads:[~2021-11-18 17:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  7:28 [syzbot] WARNING in usbnet_start_xmit/usb_submit_urb syzbot
2021-11-15 14:31 ` Oliver Neukum
2021-12-04 10:18   ` Dmitry Vyukov
2021-11-18 17:20 ` Oliver Neukum
2021-11-18 17:34   ` syzbot [this message]
2021-11-25 13:37 ` Oliver Neukum
2021-11-25 13:48   ` syzbot
2021-11-25 17:39   ` [PATCH] usbnet: sanity check for endpoint types kernel test robot
2021-11-25 17:39     ` kernel test robot
2021-12-09 12:03 ` [syzbot] WARNING in usbnet_start_xmit/usb_submit_urb Oliver Neukum
2021-12-09 12:26   ` syzbot
2023-06-23 13:32 ` [syzbot] [usb?] " syzbot
2023-06-23 15:23   ` Alan Stern
2023-06-23 16:07     ` syzbot
2023-06-23 17:16     ` Alan Stern
2023-07-11 12:42       ` Oliver Neukum
2023-07-11 17:38         ` [PATCH] net: usbnet: Fix " Alan Stern
2023-07-11 20:12           ` Jakub Kicinski
2023-07-12 14:15             ` [PATCH v2] " Alan Stern
2023-07-14  4:00               ` patchwork-bot+netdevbpf
     [not found] <89b4d11e-8e00-c78f-7b5a-5f77c1291088@suse.com>
2021-11-18 15:24 ` [syzbot] " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=000000000000c5f54305d113905e@google.com \
    --to=syzbot+63ee658b9a100ffadbe2@syzkaller.appspotmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.