usb 5-1: USB disconnect, device number 31 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff888114664da8 by task kworker/1:6/7409 CPU: 1 PID: 7409 Comm: kworker/1:6 Not tainted 5.14.0-rc3-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:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x19d/0x4d0 kernel/locking/lockdep.c:5590 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x2f/0x40 kernel/locking/spinlock.c:167 do_wait_for_common kernel/sched/completion.c:86 [inline] __wait_for_common kernel/sched/completion.c:106 [inline] wait_for_common kernel/sched/completion.c:117 [inline] wait_for_completion+0x181/0x280 kernel/sched/completion.c:138 r871xu_dev_remove+0x80/0x320 drivers/staging/rtl8712/usb_intf.c:599 usb_unbind_interface+0x1d8/0x8d0 drivers/usb/core/driver.c:458 __device_release_driver+0x3bd/0x6f0 drivers/base/dd.c:1201 device_release_driver_internal drivers/base/dd.c:1232 [inline] device_release_driver+0x26/0x40 drivers/base/dd.c:1255 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529 device_del+0x502/0xd40 drivers/base/core.c:3542 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419 usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2225 hub_port_connect drivers/usb/core/hub.c:5199 [inline] hub_port_connect_change drivers/usb/core/hub.c:5488 [inline] port_event drivers/usb/core/hub.c:5634 [inline] hub_event+0x1c9c/0x4330 drivers/usb/core/hub.c:5716 process_one_work+0x98d/0x15b0 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3c0/0x4a0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the page: page:ffffea0004519900 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x114664 flags: 0x200000000000000(node=0|zone=2) raw: 0200000000000000 0000000000000000 ffffea0004519908 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x46dc0(GFP_KERNEL|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_ZERO), pid 7, ts 1953053517630, free_ts 1953310753507 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x11d2/0x28b0 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x4e0 mm/page_alloc.c:5391 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_pages_node include/linux/gfp.h:584 [inline] kmalloc_large_node+0x62/0x130 mm/slub.c:4118 __kmalloc_node+0x2da/0x360 mm/slub.c:4134 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0xb4/0xf0 mm/util.c:587 kvmalloc include/linux/mm.h:806 [inline] kvzalloc include/linux/mm.h:814 [inline] alloc_netdev_mqs+0x98/0xe80 net/core/dev.c:10844 r8712_init_netdev+0x1d/0xe0 drivers/staging/rtl8712/os_intfs.c:202 r871xu_drv_init+0xba/0x440 drivers/staging/rtl8712/usb_intf.c:361 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:517 [inline] really_probe+0x23c/0xcd0 drivers/base/dd.c:595 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:747 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:777 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:894 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427 __device_attach+0x228/0x4a0 drivers/base/dd.c:965 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2b3/0x670 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x490 mm/page_alloc.c:3411 kvfree+0x42/0x50 mm/util.c:616 netdev_freemem net/core/dev.c:10798 [inline] free_netdev+0x494/0x5b0 net/core/dev.c:10976 rtl871x_load_fw_cb drivers/staging/rtl8712/hal_init.c:46 [inline] rtl871x_load_fw_cb.cold+0xf7/0x117 drivers/staging/rtl8712/hal_init.c:32 request_firmware_work_func+0x12c/0x230 drivers/base/firmware_loader/main.c:1081 process_one_work+0x98d/0x15b0 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3c0/0x4a0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888114664c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888114664d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888114664d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888114664e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888114664e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================