usb 4-1: USB disconnect, device number 2 ================================================================== BUG: KASAN: use-after-free in usb_audio_disconnect+0x673/0x720 sound/usb/card.c:918 Read of size 2 at addr ffff88802ac68f24 by task kworker/1:1/26 CPU: 1 PID: 26 Comm: kworker/1:1 Not tainted 5.12.0-rc1-syzkaller #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:79 [inline] dump_stack+0x93/0xc2 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 usb_audio_disconnect+0x673/0x720 sound/usb/card.c:918 usb_unbind_interface+0x183/0x7e0 drivers/usb/core/driver.c:458 __device_release_driver+0x32f/0x660 drivers/base/dd.c:1156 device_release_driver_internal drivers/base/dd.c:1187 [inline] device_release_driver+0x21/0x30 drivers/base/dd.c:1210 bus_remove_device+0x298/0x550 drivers/base/bus.c:533 device_del+0x494/0xc10 drivers/base/core.c:3421 usb_disable_device+0x29c/0x660 drivers/usb/core/message.c:1413 usb_disconnect.cold+0x20c/0x681 drivers/usb/core/hub.c:2218 hub_port_connect drivers/usb/core/hub.c:5074 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0xb22/0x36b0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 26: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] ____kasan_kmalloc mm/kasan/common.c:465 [inline] __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:684 [inline] snd_card_new+0xac/0xba0 sound/core/init.c:176 snd_usb_audio_create sound/usb/card.c:588 [inline] usb_audio_probe+0x1104/0x2930 sound/usb/card.c:755 usb_probe_interface+0x274/0x6a0 drivers/usb/core/driver.c:396 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x9eb/0x1ad0 drivers/base/core.c:3242 usb_set_configuration+0x9fc/0x1750 drivers/usb/core/message.c:2164 usb_generic_driver_probe+0x74/0xa0 drivers/usb/core/generic.c:238 usb_probe_device+0x98/0x240 drivers/usb/core/driver.c:293 really_probe+0x1fd/0xc60 drivers/base/dd.c:554 driver_probe_device+0x1ed/0x380 drivers/base/dd.c:740 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:431 __device_attach+0x1db/0x400 drivers/base/dd.c:914 bus_probe_device+0x19d/0x250 drivers/base/bus.c:491 device_add+0x9eb/0x1ad0 drivers/base/core.c:3242 usb_new_device.cold+0x69a/0xee1 drivers/usb/core/hub.c:2555 hub_port_connect drivers/usb/core/hub.c:5223 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0x10a3/0x36b0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 26: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xf5/0x130 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x72/0x1b0 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xe5/0x7b0 mm/slub.c:4213 device_release+0x93/0x200 drivers/base/core.c:2108 kobject_cleanup lib/kobject.c:705 [inline] kobject_release lib/kobject.c:736 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x139/0x410 lib/kobject.c:753 snd_card_free_when_closed+0x21/0x30 sound/core/init.c:518 usb_audio_disconnect+0x271/0x720 sound/usb/card.c:913 usb_unbind_interface+0x183/0x7e0 drivers/usb/core/driver.c:458 __device_release_driver+0x32f/0x660 drivers/base/dd.c:1156 device_release_driver_internal drivers/base/dd.c:1187 [inline] device_release_driver+0x21/0x30 drivers/base/dd.c:1210 bus_remove_device+0x298/0x550 drivers/base/bus.c:533 device_del+0x494/0xc10 drivers/base/core.c:3421 usb_disable_device+0x29c/0x660 drivers/usb/core/message.c:1413 usb_disconnect.cold+0x20c/0x681 drivers/usb/core/hub.c:2218 hub_port_connect drivers/usb/core/hub.c:5074 [inline] hub_port_connect_change drivers/usb/core/hub.c:5363 [inline] port_event drivers/usb/core/hub.c:5509 [inline] hub_event+0xb22/0x36b0 drivers/usb/core/hub.c:5591 process_one_work+0x84c/0x13b0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88802ac68000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 3876 bytes inside of 8192-byte region [ffff88802ac68000, ffff88802ac6a000) The buggy address belongs to the page: page:00000000258ce114 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ac68 head:00000000258ce114 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 0000000000000000 0000000100000001 ffff88800ec42280 raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802ac68e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ac68e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802ac68f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ac68f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ac69000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================