syzbot


KASAN: invalid-free in rsi_91x_deinit

Status: fixed on 2019/11/29 01:00
Subsystems: usb wireless
[Documentation on labels]
Reported-by: syzbot+7c72edfb407b2bd866ce@syzkaller.appspotmail.com
Fix commit: 8b51dc729147 rsi: fix a double free bug in rsi_91x_deinit()
First crash: 1831d, last: 1680d
Discussions (8)
Title Replies (including bot) Last reply
KASAN: invalid-free in rsi_91x_deinit 3 (4) 2019/11/28 17:09
Reminder: 52 active syzbot reports in usb subsystem 4 (4) 2019/09/19 19:01
Reminder: 52 active syzbot reports in usb subsystem 1 (1) 2019/08/22 03:28
Reminder: 11 open syzbot bugs in "net/wireless" subsystem 1 (1) 2019/07/24 01:47
Reminder: 67 open syzbot bugs in usb subsystem 1 (1) 2019/07/24 01:35
Reminder: 47 open syzbot bugs in usb subsystem 1 (1) 2019/07/09 19:01
Reminder: 12 open syzbot bugs in "net/wireless" subsystem 1 (1) 2019/06/25 05:51
Reminder: 42 open syzbot bugs in usb subsystem 1 (1) 2019/06/25 03:44

Sample crash report:
usb 1-1: config 31 interface 202 altsetting 0 bulk endpoint 0x3 has invalid maxpacket 0
usb 1-1: New USB device found, idVendor=1618, idProduct=9113, bcdDevice=a6.1e
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
rsi_91x: rsi_probe: Failed to init usb interface
==================================================================
BUG: KASAN: double-free or invalid-free in rsi_91x_deinit+0x270/0x2f0 drivers/net/wireless/rsi/rsi_91x_main.c:407

CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.3.0-rc7+ #0
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+0x6a/0x32c mm/kasan/report.c:351
 kasan_report_invalid_free+0x61/0xa0 mm/kasan/report.c:444
 __kasan_slab_free+0x162/0x180 mm/kasan/common.c:434
 slab_free_hook mm/slub.c:1423 [inline]
 slab_free_freelist_hook mm/slub.c:1474 [inline]
 slab_free mm/slub.c:3016 [inline]
 kfree+0xe4/0x2f0 mm/slub.c:3957
 rsi_91x_deinit+0x270/0x2f0 drivers/net/wireless/rsi/rsi_91x_main.c:407
 rsi_probe+0xcec/0x15a0 drivers/net/wireless/rsi/rsi_91x_usb.c:834
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
 really_probe+0x281/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 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/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2536
 hub_port_connect drivers/usb/core/hub.c:5098 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5213 [inline]
 port_event drivers/usb/core/hub.c:5359 [inline]
 hub_event+0x1b5c/0x3640 drivers/usb/core/hub.c:5441
 process_one_work+0x92b/0x1530 kernel/workqueue.c:2269
 worker_thread+0x96/0xe20 kernel/workqueue.c:2415
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 12:
 save_stack+0x1b/0x80 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc mm/kasan/common.c:493 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:466
 kmalloc include/linux/slab.h:552 [inline]
 kzalloc include/linux/slab.h:748 [inline]
 rsi_init_usb_interface drivers/net/wireless/rsi/rsi_91x_usb.c:599 [inline]
 rsi_probe+0x11a/0x15a0 drivers/net/wireless/rsi/rsi_91x_usb.c:780
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
 really_probe+0x281/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 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/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2536
 hub_port_connect drivers/usb/core/hub.c:5098 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5213 [inline]
 port_event drivers/usb/core/hub.c:5359 [inline]
 hub_event+0x1b5c/0x3640 drivers/usb/core/hub.c:5441
 process_one_work+0x92b/0x1530 kernel/workqueue.c:2269
 worker_thread+0x96/0xe20 kernel/workqueue.c:2415
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Freed by task 12:
 save_stack+0x1b/0x80 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_slab_free+0x130/0x180 mm/kasan/common.c:455
 slab_free_hook mm/slub.c:1423 [inline]
 slab_free_freelist_hook mm/slub.c:1474 [inline]
 slab_free mm/slub.c:3016 [inline]
 kfree+0xe4/0x2f0 mm/slub.c:3957
 rsi_init_usb_interface drivers/net/wireless/rsi/rsi_91x_usb.c:648 [inline]
 rsi_probe+0xdfd/0x15a0 drivers/net/wireless/rsi/rsi_91x_usb.c:780
 usb_probe_interface+0x305/0x7a0 drivers/usb/core/driver.c:361
 really_probe+0x281/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 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/0x6d0 drivers/base/dd.c:548
 driver_probe_device+0x101/0x1b0 drivers/base/dd.c:721
 __device_attach_driver+0x1c2/0x220 drivers/base/dd.c:828
 bus_for_each_drv+0x162/0x1e0 drivers/base/bus.c:454
 __device_attach+0x217/0x360 drivers/base/dd.c:894
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:514
 device_add+0xae6/0x16f0 drivers/base/core.c:2165
 usb_new_device.cold+0x6a4/0xe79 drivers/usb/core/hub.c:2536
 hub_port_connect drivers/usb/core/hub.c:5098 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5213 [inline]
 port_event drivers/usb/core/hub.c:5359 [inline]
 hub_event+0x1b5c/0x3640 drivers/usb/core/hub.c:5441
 process_one_work+0x92b/0x1530 kernel/workqueue.c:2269
 worker_thread+0x96/0xe20 kernel/workqueue.c:2415
 kthread+0x318/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff8881d3bc6280
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 0 bytes inside of
 512-byte region [ffff8881d3bc6280, ffff8881d3bc6480)
The buggy address belongs to the page:
page:ffffea00074ef180 refcount:1 mapcount:0 mapping:ffff8881da002500 index:0x0 compound_mapcount: 0
flags: 0x200000000010200(slab|head)
raw: 0200000000010200 dead000000000100 dead000000000122 ffff8881da002500
raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881d3bc6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881d3bc6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881d3bc6280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8881d3bc6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

Crashes (109):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/09/07 03:36 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 a60cb4cd .config console log report syz C ci2-upstream-usb
2019/08/30 21:34 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 9adfa876 .config console log report syz C ci2-upstream-usb
2019/08/21 06:08 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 6b8391d0 .config console log report syz C ci2-upstream-usb
2019/08/09 18:50 https://github.com/google/kasan.git usb-fuzzer e96407b49762 aff9e255 .config console log report syz C ci2-upstream-usb
2019/07/23 07:17 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 bb071d58 .config console log report syz C ci2-upstream-usb
2019/07/11 22:32 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 186a30b9 .config console log report syz C ci2-upstream-usb
2019/07/11 06:59 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 ff7bf04c .config console log report syz C ci2-upstream-usb
2019/07/09 19:59 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 f62e1e85 .config console log report syz C ci2-upstream-usb
2019/06/28 23:03 https://github.com/google/kasan.git usb-fuzzer 7829a896a587 7509bf36 .config console log report syz C ci2-upstream-usb
2019/06/04 04:44 https://github.com/google/kasan.git usb-fuzzer 69bbe8c72e6f ce07a7ae .config console log report syz C ci2-upstream-usb
2019/04/20 08:41 https://github.com/google/kasan.git usb-fuzzer d34f9519daaa b0e8efcb .config console log report syz C ci2-upstream-usb
2019/09/17 17:44 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 13dcda9b .config console log report ci2-upstream-usb
2019/09/17 10:11 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 51ca0454 .config console log report ci2-upstream-usb
2019/09/16 07:06 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 32d59357 .config console log report ci2-upstream-usb
2019/09/12 13:10 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 0b7672ee .config console log report ci2-upstream-usb
2019/09/11 08:24 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 a60cb4cd .config console log report ci2-upstream-usb
2019/09/10 04:04 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 a60cb4cd .config console log report ci2-upstream-usb
2019/09/09 13:42 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 a60cb4cd .config console log report ci2-upstream-usb
2019/09/05 11:57 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 040fda58 .config console log report ci2-upstream-usb
2019/09/04 13:33 https://github.com/google/kasan.git usb-fuzzer f0df5c1be1e9 d994512d .config console log report ci2-upstream-usb
2019/09/03 01:26 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 14544a56 .config console log report ci2-upstream-usb
2019/09/01 19:51 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 bad3cce2 .config console log report ci2-upstream-usb
2019/08/30 09:00 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 cd626f3b .config console log report ci2-upstream-usb
2019/08/30 06:29 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 cd626f3b .config console log report ci2-upstream-usb
2019/08/29 11:02 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 cd626f3b .config console log report ci2-upstream-usb
2019/08/28 14:42 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 1eb076e9 .config console log report ci2-upstream-usb
2019/08/27 17:02 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 d21c5d9d .config console log report ci2-upstream-usb
2019/08/27 09:01 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 d21c5d9d .config console log report ci2-upstream-usb
2019/08/26 22:03 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 d21c5d9d .config console log report ci2-upstream-usb
2019/08/23 21:46 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 78ded196 .config console log report ci2-upstream-usb
2019/08/22 23:24 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 c6c81a0b .config console log report ci2-upstream-usb
2019/08/21 10:09 https://github.com/google/kasan.git usb-fuzzer eea39f24f4a5 4ea67ff8 .config console log report ci2-upstream-usb
2019/08/17 17:49 https://github.com/google/kasan.git usb-fuzzer d0847550e22d 55bf8926 .config console log report ci2-upstream-usb
2019/08/14 23:24 https://github.com/google/kasan.git usb-fuzzer d0847550e22d 5576551b .config console log report ci2-upstream-usb
2019/08/14 11:18 https://github.com/google/kasan.git usb-fuzzer d0847550e22d ef801a3e .config console log report ci2-upstream-usb
2019/08/13 13:01 https://github.com/google/kasan.git usb-fuzzer d0847550e22d 74d61399 .config console log report ci2-upstream-usb
2019/08/10 15:12 https://github.com/google/kasan.git usb-fuzzer e96407b49762 acb51638 .config console log report ci2-upstream-usb
2019/08/06 23:33 https://github.com/google/kasan.git usb-fuzzer e96407b49762 da562c0b .config console log report ci2-upstream-usb
2019/08/06 21:19 https://github.com/google/kasan.git usb-fuzzer e96407b49762 da562c0b .config console log report ci2-upstream-usb
2019/08/05 00:51 https://github.com/google/kasan.git usb-fuzzer e96407b49762 6affd8e8 .config console log report ci2-upstream-usb
2019/08/04 22:48 https://github.com/google/kasan.git usb-fuzzer e96407b49762 6affd8e8 .config console log report ci2-upstream-usb
2019/08/03 19:58 https://github.com/google/kasan.git usb-fuzzer e96407b49762 6affd8e8 .config console log report ci2-upstream-usb
2019/08/01 00:24 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf c692b5bd .config console log report ci2-upstream-usb
2019/07/31 18:15 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf 995b2a26 .config console log report ci2-upstream-usb
2019/07/30 14:12 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf f28bf2a5 .config console log report ci2-upstream-usb
2019/07/30 10:30 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf f28bf2a5 .config console log report ci2-upstream-usb
2019/07/30 00:33 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf f67095ee .config console log report ci2-upstream-usb
2019/07/29 22:13 https://github.com/google/kasan.git usb-fuzzer 7f7867ff95bf f67095ee .config console log report ci2-upstream-usb
2019/07/29 11:34 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/29 06:16 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/28 16:03 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/28 10:24 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/27 23:15 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/27 07:47 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/27 03:04 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 c85e1c5b .config console log report ci2-upstream-usb
2019/07/26 09:20 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 732bc5a0 .config console log report ci2-upstream-usb
2019/07/26 06:02 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 732bc5a0 .config console log report ci2-upstream-usb
2019/07/26 04:14 https://github.com/google/kasan.git usb-fuzzer 6a3599ceaa39 732bc5a0 .config console log report ci2-upstream-usb
* Struck through repros no longer work on HEAD.