================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff88814b004da8 by task kworker/1:4/14517 CPU: 1 PID: 14517 Comm: kworker/1:4 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 Allocated by task 10751: 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:434 [inline] __kasan_slab_alloc+0x61/0x80 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x1d3/0x360 mm/slub.c:2969 mempool_alloc+0x146/0x350 mm/mempool.c:393 __sg_alloc_table+0x244/0x380 lib/scatterlist.c:302 sg_alloc_table_chained+0x9b/0x1e0 lib/sg_pool.c:132 scsi_alloc_sgtables+0x1e8/0xb90 drivers/scsi/scsi_lib.c:1001 sd_setup_read_write_cmnd drivers/scsi/sd.c:1225 [inline] sd_init_command+0x2a0/0x35a0 drivers/scsi/sd.c:1351 scsi_prepare_cmd drivers/scsi/scsi_lib.c:1570 [inline] scsi_queue_rq+0x121d/0x3270 drivers/scsi/scsi_lib.c:1665 blk_mq_dispatch_rq_list+0x422/0x1f00 block/blk-mq.c:1380 __blk_mq_do_dispatch_sched+0x3bc/0x930 block/blk-mq-sched.c:201 blk_mq_do_dispatch_sched block/blk-mq-sched.c:214 [inline] __blk_mq_sched_dispatch_requests+0x2a0/0x410 block/blk-mq-sched.c:334 blk_mq_sched_dispatch_requests+0xfb/0x180 block/blk-mq-sched.c:360 __blk_mq_run_hw_queue+0xd8/0x150 block/blk-mq.c:1500 __blk_mq_delay_run_hw_queue+0x584/0x5f0 block/blk-mq.c:1577 blk_mq_run_hw_queue+0x16c/0x2f0 block/blk-mq.c:1630 blk_mq_sched_insert_requests+0x1de/0x690 block/blk-mq-sched.c:513 blk_mq_flush_plug_list+0x3d8/0x560 block/blk-mq.c:1955 blk_flush_plug_list+0x4d/0x60 block/blk-core.c:1731 blk_mq_submit_bio+0xad2/0x1590 block/blk-mq.c:2256 __submit_bio_noacct_mq block/blk-core.c:1011 [inline] submit_bio_noacct block/blk-core.c:1044 [inline] submit_bio_noacct+0xc97/0x1080 block/blk-core.c:1027 submit_bio+0x17e/0x350 block/blk-core.c:1106 iomap_dio_submit_bio+0x293/0x360 fs/iomap/direct-io.c:76 iomap_dio_bio_actor+0x934/0x1080 fs/iomap/direct-io.c:342 iomap_dio_actor+0x89/0x550 fs/iomap/direct-io.c:419 iomap_apply+0x2a3/0xa90 fs/iomap/apply.c:84 __iomap_dio_rw+0x725/0x12c0 fs/iomap/direct-io.c:561 iomap_dio_rw+0x30/0x90 fs/iomap/direct-io.c:649 ext4_dio_write_iter fs/ext4/file.c:568 [inline] ext4_file_write_iter+0xa50/0x19c0 fs/ext4/file.c:678 call_write_iter include/linux/fs.h:2114 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x707/0x9f0 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88814b004c80 which belongs to the cache sgpool-64 of size 2048 The buggy address is located 296 bytes inside of 2048-byte region [ffff88814b004c80, ffff88814b005480) The buggy address belongs to the page: page:ffffea00052c0000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14b000 head:ffffea00052c0000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x200000000010200(slab|head|node=0|zone=2) raw: 0200000000010200 0000000000000000 dead000000000122 ffff88810ccbac80 raw: 0000000000000000 00000000800f000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 10751, ts 3458035082833, free_ts 3458010047117 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+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2800 __slab_alloc+0x68/0x80 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x339/0x360 mm/slub.c:2969 mempool_alloc+0x146/0x350 mm/mempool.c:393 __sg_alloc_table+0x244/0x380 lib/scatterlist.c:302 sg_alloc_table_chained+0x9b/0x1e0 lib/sg_pool.c:132 scsi_alloc_sgtables+0x1e8/0xb90 drivers/scsi/scsi_lib.c:1001 sd_setup_read_write_cmnd drivers/scsi/sd.c:1225 [inline] sd_init_command+0x2a0/0x35a0 drivers/scsi/sd.c:1351 scsi_prepare_cmd drivers/scsi/scsi_lib.c:1570 [inline] scsi_queue_rq+0x121d/0x3270 drivers/scsi/scsi_lib.c:1665 blk_mq_dispatch_rq_list+0x422/0x1f00 block/blk-mq.c:1380 __blk_mq_do_dispatch_sched+0x3bc/0x930 block/blk-mq-sched.c:201 blk_mq_do_dispatch_sched block/blk-mq-sched.c:214 [inline] __blk_mq_sched_dispatch_requests+0x2a0/0x410 block/blk-mq-sched.c:334 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: ffff88814b004c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88814b004d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88814b004d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88814b004e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88814b004e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================