syzbot


KASAN: use-after-free Read in snd_info_free_entry

Status: fixed on 2019/05/27 12:48
Subsystems: usb sound
[Documentation on labels]
Reported-by: syzbot+48df349490c36f9f54ab@syzkaller.appspotmail.com
Fix commit: 2a3f7221acdd ALSA: core: Fix card races between register and disconnect 8c2f870890fd ALSA: info: Fix racy addition/deletion of nodes
First crash: 2048d, last: 2017d
Duplicate bugs (3)
duplicates (3):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
WARNING in snd_info_free_entry sound usb syz 3 2008d 2017d 0/28 closed as dup on 2019/05/15 12:39
BUG: corrupted list in snd_info_free_entry usb sound C 44 2021d 2050d 0/28 closed as dup on 2019/04/16 14:06
BUG: corrupted list in snd_info_create_entry sound usb syz 2 2033d 2046d 0/28 closed as dup on 2019/04/16 14:06
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 3.16 000/157] 3.16.72-rc1 review 162 (162) 2019/08/11 15:25
[PATCH 5.0 000/115] 5.0.10-stable review 124 (124) 2019/04/27 06:49
[PATCH 4.9 00/44] 4.9.171-stable review 50 (50) 2019/04/25 21:40
[PATCH 4.19 00/96] 4.19.37-stable review 102 (102) 2019/04/25 19:38
[PATCH 4.14 00/70] 4.14.114-stable review 76 (76) 2019/04/25 19:38
[PATCH 4.4 000/168] 4.4.179-stable review 178 (178) 2019/04/25 19:37
[PATCH 3.18 000/104] 3.18.139-stable review 112 (112) 2019/04/25 19:36
KASAN: use-after-free Read in snd_info_free_entry 0 (1) 2019/04/14 20:06

Sample crash report:
snd_usb_toneport 5-1:0.0: set_interface failed
snd_usb_toneport 5-1:0.0: Line 6 POD Studio UX2 now disconnected
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0xe0/0xef lib/list_debug.c:51
Read of size 8 at addr ffff8880a7a5a9a8 by task kworker/1:1/5660

CPU: 1 PID: 5660 Comm: kworker/1:1 Not tainted 5.1.0-rc5-319617-gd34f951 #5
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+0xe8/0x16e lib/dump_stack.c:113
 print_address_description+0x6c/0x236 mm/kasan/report.c:187
 kasan_report.cold+0x1a/0x3c mm/kasan/report.c:317
 __list_del_entry_valid+0xe0/0xef lib/list_debug.c:51
 __list_del_entry include/linux/list.h:117 [inline]
 list_del include/linux/list.h:125 [inline]
 snd_info_free_entry+0x137/0x340 sound/core/info.c:795
 snd_info_card_free+0x43/0x90 sound/core/info.c:606
 snd_card_do_free sound/core/init.c:469 [inline]
 release_card_device+0x8b/0x100 sound/core/init.c:156
 device_release+0x7d/0x210 drivers/base/core.c:1064
 kobject_cleanup lib/kobject.c:662 [inline]
 kobject_release lib/kobject.c:691 [inline]
 kref_put include/linux/kref.h:67 [inline]
 kobject_put+0x1df/0x4f0 lib/kobject.c:708
 put_device+0x21/0x30 drivers/base/core.c:2205
 snd_card_free_when_closed+0x3a/0x50 sound/core/init.c:493
 line6_disconnect.cold+0xa3/0xbc sound/usb/line6/driver.c:833
 line6_probe+0xb23/0x1150 sound/usb/line6/driver.c:799
 usb_probe_interface+0x31d/0x820 drivers/usb/core/driver.c:361
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_set_configuration+0xdf7/0x1740 drivers/usb/core/message.c:2021
 generic_probe+0xa2/0xda drivers/usb/core/generic.c:210
 usb_probe_device+0xc0/0x150 drivers/usb/core/driver.c:266
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_new_device.cold+0x537/0xccf 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+0x1398/0x3b00 drivers/usb/core/hub.c:5432
 process_one_work+0x90f/0x1580 kernel/workqueue.c:2269
 process_scheduled_works kernel/workqueue.c:2331 [inline]
 worker_thread+0x7b0/0xe20 kernel/workqueue.c:2417
 kthread+0x313/0x420 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

Allocated by task 12:
 set_track mm/kasan/common.c:87 [inline]
 __kasan_kmalloc mm/kasan/common.c:497 [inline]
 __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:470
 kmalloc include/linux/slab.h:547 [inline]
 kzalloc include/linux/slab.h:742 [inline]
 snd_info_create_entry+0x56/0x400 sound/core/info.c:701
 snd_info_create_module_entry sound/core/info.c:737 [inline]
 create_subdir+0x27/0xa0 sound/core/info.c:454
 snd_info_card_create+0xcf/0x230 sound/core/info.c:528
 snd_card_new+0x61d/0x920 sound/core/init.c:255
 line6_probe+0x135/0x1150 sound/usb/line6/driver.c:736
 usb_probe_interface+0x31d/0x820 drivers/usb/core/driver.c:361
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_set_configuration+0xdf7/0x1740 drivers/usb/core/message.c:2021
 generic_probe+0xa2/0xda drivers/usb/core/generic.c:210
 usb_probe_device+0xc0/0x150 drivers/usb/core/driver.c:266
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_new_device.cold+0x537/0xccf 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+0x1398/0x3b00 drivers/usb/core/hub.c:5432
 process_one_work+0x90f/0x1580 kernel/workqueue.c:2269
 process_scheduled_works kernel/workqueue.c:2331 [inline]
 worker_thread+0x7b0/0xe20 kernel/workqueue.c:2417
 kthread+0x313/0x420 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

Freed by task 12:
 set_track mm/kasan/common.c:87 [inline]
 __kasan_slab_free+0x130/0x180 mm/kasan/common.c:459
 slab_free_hook mm/slub.c:1429 [inline]
 slab_free_freelist_hook+0x5e/0x140 mm/slub.c:1456
 slab_free mm/slub.c:3003 [inline]
 kfree+0xce/0x280 mm/slub.c:3958
 snd_info_free_entry+0x29a/0x340 sound/core/info.c:799
 snd_info_card_free+0x43/0x90 sound/core/info.c:606
 snd_card_do_free sound/core/init.c:469 [inline]
 release_card_device+0x8b/0x100 sound/core/init.c:156
 device_release+0x7d/0x210 drivers/base/core.c:1064
 kobject_cleanup lib/kobject.c:662 [inline]
 kobject_release lib/kobject.c:691 [inline]
 kref_put include/linux/kref.h:67 [inline]
 kobject_put+0x1df/0x4f0 lib/kobject.c:708
 put_device+0x21/0x30 drivers/base/core.c:2205
 snd_card_free_when_closed+0x3a/0x50 sound/core/init.c:493
 line6_disconnect.cold+0xa3/0xbc sound/usb/line6/driver.c:833
 line6_probe+0xb23/0x1150 sound/usb/line6/driver.c:799
 usb_probe_interface+0x31d/0x820 drivers/usb/core/driver.c:361
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_set_configuration+0xdf7/0x1740 drivers/usb/core/message.c:2021
 generic_probe+0xa2/0xda drivers/usb/core/generic.c:210
 usb_probe_device+0xc0/0x150 drivers/usb/core/driver.c:266
 really_probe+0x2da/0xb10 drivers/base/dd.c:509
 driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
 __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
 __device_attach+0x223/0x3a0 drivers/base/dd.c:844
 bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
 device_add+0xad2/0x16e0 drivers/base/core.c:2106
 usb_new_device.cold+0x537/0xccf 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+0x1398/0x3b00 drivers/usb/core/hub.c:5432
 process_one_work+0x90f/0x1580 kernel/workqueue.c:2269
 process_scheduled_works kernel/workqueue.c:2331 [inline]
 worker_thread+0x7b0/0xe20 kernel/workqueue.c:2417
 kthread+0x313/0x420 kernel/kthread.c:253
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff8880a7a5a8c0
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 232 bytes inside of
 256-byte region [ffff8880a7a5a8c0, ffff8880a7a5a9c0)
The buggy address belongs to the page:
page:ffffea00029e9680 count:1 mapcount:0 mapping:ffff88812c3f4e00 index:0xffff8880a7a5ab40
flags: 0xfff00000000200(slab)
raw: 00fff00000000200 ffffea00027e8cc0 0000000300000003 ffff88812c3f4e00
raw: ffff8880a7a5ab40 00000000800c000b 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a7a5a880: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880a7a5a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a7a5a980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                  ^
 ffff8880a7a5aa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880a7a5aa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (47):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/04/23 18:22 https://github.com/google/kasan.git usb-fuzzer d34f9519daaa 2398edea .config console log report syz C ci2-upstream-usb
2019/04/14 15:53 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz C ci2-upstream-usb
2019/05/15 08:08 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce bd4e3ac7 .config console log report syz ci2-upstream-usb
2019/05/15 04:39 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 2e630085 .config console log report syz ci2-upstream-usb
2019/05/14 17:53 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce ada3c44c .config console log report syz ci2-upstream-usb
2019/05/10 14:13 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 018207ef .config console log report syz ci2-upstream-usb
2019/05/06 10:48 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/06 09:44 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/05 03:19 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/05 02:33 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/04 19:34 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/04 00:00 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce d28f4ce5 .config console log report syz ci2-upstream-usb
2019/05/03 05:24 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce e9039493 .config console log report syz ci2-upstream-usb
2019/05/03 04:26 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce e9039493 .config console log report syz ci2-upstream-usb
2019/05/02 18:50 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce e9039493 .config console log report syz ci2-upstream-usb
2019/05/02 07:07 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 1852eb18 .config console log report syz ci2-upstream-usb
2019/05/01 21:20 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 7516d9fa .config console log report syz ci2-upstream-usb
2019/05/01 10:47 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 618456b4 .config console log report syz ci2-upstream-usb
2019/05/01 10:02 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 618456b4 .config console log report syz ci2-upstream-usb
2019/05/01 04:57 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 618456b4 .config console log report syz ci2-upstream-usb
2019/04/30 04:46 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/30 00:47 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/29 12:32 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/29 07:48 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/29 07:02 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/27 20:48 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/27 15:27 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/27 05:29 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/26 10:05 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/26 06:56 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/26 03:08 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce b617407b .config console log report syz ci2-upstream-usb
2019/04/25 23:03 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce f46aabc8 .config console log report syz ci2-upstream-usb
2019/04/25 19:28 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce f46aabc8 .config console log report syz ci2-upstream-usb
2019/04/25 07:20 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 8e3c52b1 .config console log report syz ci2-upstream-usb
2019/04/25 02:38 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 8e3c52b1 .config console log report syz ci2-upstream-usb
2019/04/25 01:03 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 8e3c52b1 .config console log report syz ci2-upstream-usb
2019/04/24 19:30 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 8e3c52b1 .config console log report syz ci2-upstream-usb
2019/04/24 15:55 https://github.com/google/kasan.git usb-fuzzer 43151d6c3fce 8e3c52b1 .config console log report syz ci2-upstream-usb
2019/04/16 01:34 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/15 23:13 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/15 22:25 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/15 17:36 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/15 08:42 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/15 06:32 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/14 23:17 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/14 21:07 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
2019/04/14 09:25 https://github.com/google/kasan.git usb-fuzzer 9a33b36996cb 505ab413 .config console log report syz ci2-upstream-usb
* Struck through repros no longer work on HEAD.