syzbot


KASAN: global-out-of-bounds Read in qmi_wwan_probe

Status: fixed on 2019/07/29 13:39
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+b68605d7fadd21510de1@syzkaller.appspotmail.com
Fix commit: 904d88d743b0 qmi_wwan: Fix out-of-bounds read
First crash: 1762d, last: 1748d
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 4.14 00/43] 4.14.132-stable review 57 (57) 2019/08/03 07:11
[PATCH AUTOSEL 5.1 01/39] ARM: dts: meson8: fix GPU interrupts and drop an undocumented property 41 (41) 2019/07/11 06:43
[PATCH 4.19 00/72] 4.19.57-stable review 84 (84) 2019/07/04 05:29
[PATCH 5.1 00/55] 5.1.16-stable review 69 (69) 2019/07/04 05:27
[PATCH AUTOSEL 4.19 01/26] irqchip/gic-v3-its: Fix command queue pointer comparison bug 26 (26) 2019/07/03 02:16
KASAN: global-out-of-bounds Read in qmi_wwan_probe 4 (5) 2019/06/24 17:16
[PATCH net,stable] qmi_wwan: Fix out-of-bounds read 2 (2) 2019/06/24 17:09

Sample crash report:
usb 1-1: string descriptor 0 read error: -22
usb 1-1: New USB device found, idVendor=1199, idProduct=9019, bcdDevice=a7.5b
usb 1-1: New USB device strings: Mfr=255, Product=6, SerialNumber=0
usb 1-1: config 0 descriptor??
==================================================================
BUG: KASAN: global-out-of-bounds in qmi_wwan_probe+0x342/0x360 drivers/net/usb/qmi_wwan.c:1487
Read of size 8 at addr ffffffff8618c180 by task kworker/1:1/21

CPU: 1 PID: 21 Comm: kworker/1:1 Not tainted 5.2.0-rc6+ #13
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xca/0x13e lib/dump_stack.c:113
 print_address_description+0x67/0x231 mm/kasan/report.c:188
 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:317
 kasan_report+0xe/0x20 mm/kasan/common.c:614
 qmi_wwan_probe+0x342/0x360 drivers/net/usb/qmi_wwan.c:1487
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
 really_probe+0x281/0x660 drivers/base/dd.c:509
 driver_probe_device+0x104/0x210 drivers/base/dd.c:670
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:777
 bus_for_each_drv+0x15c/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:843
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2111
 usb_set_configuration+0xdf6/0x1670 drivers/usb/core/message.c:2023
 generic_probe+0x9d/0xd5 drivers/usb/core/generic.c:210
 usb_probe_device+0x99/0x100 drivers/usb/core/driver.c:266
 really_probe+0x281/0x660 drivers/base/dd.c:509
 driver_probe_device+0x104/0x210 drivers/base/dd.c:670
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:777
 bus_for_each_drv+0x15c/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:843
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2111
 usb_new_device.cold+0x8c1/0x1016 drivers/usb/core/hub.c:2534
 hub_port_connect drivers/usb/core/hub.c:5089 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
 port_event drivers/usb/core/hub.c:5350 [inline]
 hub_event+0x1ada/0x3590 drivers/usb/core/hub.c:5432
 process_one_work+0x905/0x1570 kernel/workqueue.c:2269
 worker_thread+0x96/0xe20 kernel/workqueue.c:2415
 kthread+0x30b/0x410 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the variable:
 products+0x2f40/0x2fa0

Memory state around the buggy address:
 ffffffff8618c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffffff8618c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff8618c180: fa fa fa fa 00 00 fa fa fa fa fa fa 00 00 00 00
                   ^
 ffffffff8618c200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa
 ffffffff8618c280: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/07/06 10:21 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 f62e1e85 .config console log report syz C ci2-upstream-usb
2019/06/22 03:30 https://github.com/google/kasan.git usb-fuzzer 9939f56ee6c0 34bf9440 .config console log report syz C ci2-upstream-usb
* Struck through repros no longer work on HEAD.