blk_update_request: I/O error, dev loop44, sector 8 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 lbmIODone: I/O error in JFS log ================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x262/0x2b0 kernel/locking/spinlock_debug.c:112 Read of size 4 at addr ffff888016b41254 by task kworker/0:1H/2943 CPU: 0 PID: 2943 Comm: kworker/0:1H Tainted: G W 5.13.0-next-20210707-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: kblockd blk_mq_run_work_fn 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] do_raw_spin_lock+0x262/0x2b0 kernel/locking/spinlock_debug.c:112 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline] _raw_spin_lock_irqsave+0x41/0x50 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137 lbmIODone+0x4eb/0x10d0 fs/jfs/jfs_logmgr.c:2295 bio_endio+0x622/0x7b0 block/bio.c:1413 req_bio_endio block/blk-core.c:263 [inline] blk_update_request+0x68b/0x1450 block/blk-core.c:1438 blk_mq_end_request+0x4c/0x510 block/blk-mq.c:565 blk_mq_dispatch_rq_list+0xe79/0x1f00 block/blk-mq.c:1399 __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_run_work_fn+0x55/0x70 block/blk-mq.c:1832 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 31483: 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_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1830 [inline] lmLogInit+0x3af/0x17a0 fs/jfs/jfs_logmgr.c:1278 lmLogOpen+0x48e/0x13e0 fs/jfs/jfs_logmgr.c:1124 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x877/0xc80 fs/jfs/super.c:570 mount_bdev+0x34d/0x410 fs/super.c:1368 legacy_get_tree+0x105/0x220 fs/fs_context.c:592 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 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 Freed by task 31483: 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:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:229 [inline] slab_free_hook mm/slub.c:1650 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1675 slab_free mm/slub.c:3235 [inline] kfree+0xeb/0x650 mm/slub.c:4295 lbmLogShutdown fs/jfs/jfs_logmgr.c:1873 [inline] lmLogInit+0xb04/0x17a0 fs/jfs/jfs_logmgr.c:1424 lmLogOpen+0x48e/0x13e0 fs/jfs/jfs_logmgr.c:1124 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x877/0xc80 fs/jfs/super.c:570 mount_bdev+0x34d/0x410 fs/super.c:1368 legacy_get_tree+0x105/0x220 fs/fs_context.c:592 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433 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 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1f0/0x4c0 kernel/umh.c:435 kobject_uevent_env+0xf8f/0x1650 lib/kobject_uevent.c:618 loop_configure+0x1249/0x1590 drivers/block/loop.c:258 lo_ioctl+0x403/0x1610 drivers/block/loop.c:1773 blkdev_ioctl+0x2a1/0x6d0 block/ioctl.c:585 block_ioctl+0xf9/0x140 fs/block_dev.c:1602 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1f0/0x4c0 kernel/umh.c:435 kobject_uevent_env+0xf8f/0x1650 lib/kobject_uevent.c:618 loop_configure+0x1249/0x1590 drivers/block/loop.c:258 lo_ioctl+0x403/0x1610 drivers/block/loop.c:1773 blkdev_ioctl+0x2a1/0x6d0 block/ioctl.c:585 block_ioctl+0xf9/0x140 fs/block_dev.c:1602 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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 ffff888016b41200 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 84 bytes inside of 192-byte region [ffff888016b41200, ffff888016b412c0) The buggy address belongs to the page: page:ffffea00005ad040 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888016b41600 pfn:0x16b41 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888010841a00 raw: ffff888016b41600 000000008010000e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 10119574400, free_ts 10106409753 prep_new_page mm/page_alloc.c:2444 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4177 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5385 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2119 alloc_pages+0x238/0x2a0 mm/mempolicy.c:2242 alloc_slab_page mm/slub.c:1713 [inline] allocate_slab+0x32b/0x4c0 mm/slub.c:1853 new_slab mm/slub.c:1916 [inline] new_slab_objects mm/slub.c:2662 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2825 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2865 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2989 [inline] __kmalloc+0x312/0x330 mm/slub.c:4133 kmalloc include/linux/slab.h:596 [inline] usb_alloc_urb+0x65/0xb0 drivers/usb/core/urb.c:74 hub_configure drivers/usb/core/hub.c:1636 [inline] hub_probe.cold+0x212a/0x2a77 drivers/usb/core/hub.c:1885 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1354 [inline] free_pcp_prepare+0x312/0x7d0 mm/page_alloc.c:1405 free_unref_page_prepare mm/page_alloc.c:3340 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3419 mm_free_pgd kernel/fork.c:636 [inline] __mmdrop+0xcb/0x3f0 kernel/fork.c:738 mmdrop include/linux/sched/mm.h:49 [inline] __mmput+0x3b4/0x470 kernel/fork.c:1162 mmput+0x58/0x60 kernel/fork.c:1173 free_bprm+0x65/0x2e0 fs/exec.c:1479 kernel_execve+0x380/0x460 fs/exec.c:1976 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888016b41100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888016b41180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888016b41200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888016b41280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888016b41300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================