================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3e6f/0x54c0 kernel/locking/lockdep.c:4771 Read of size 8 at addr ffff888011f31e68 by task ksoftirqd/0/13 CPU: 0 PID: 13 Comm: ksoftirqd/0 Not tainted 5.12.0-rc2-next-20210310-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 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 __lock_acquire+0x3e6f/0x54c0 kernel/locking/lockdep.c:4771 lock_acquire kernel/locking/lockdep.c:5511 [inline] lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5476 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/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:2294 bio_endio+0x3f4/0x800 block/bio.c:1436 req_bio_endio block/blk-core.c:265 [inline] blk_update_request+0x68b/0x1480 block/blk-core.c:1456 blk_mq_end_request+0x4c/0x510 block/blk-mq.c:564 lo_complete_rq+0x20d/0x2d0 drivers/block/loop.c:497 blk_complete_reqs+0x9d/0xd0 block/blk-mq.c:576 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 run_ksoftirqd kernel/softirq.c:652 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:644 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:165 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 6135: 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:556 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1829 [inline] lmLogInit+0x3af/0x1790 fs/jfs/jfs_logmgr.c:1278 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x7c8/0x13e0 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x871/0xc80 fs/jfs/super.c:570 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:592 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:2903 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3233 do_mount fs/namespace.c:3246 [inline] __do_sys_mount fs/namespace.c:3454 [inline] __se_sys_mount fs/namespace.c:3431 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3431 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 6135: 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:200 [inline] slab_free_hook mm/slub.c:1563 [inline] slab_free_freelist_hook+0x92/0x210 mm/slub.c:1601 slab_free mm/slub.c:3162 [inline] kfree+0xe5/0x7f0 mm/slub.c:4216 lbmLogShutdown fs/jfs/jfs_logmgr.c:1872 [inline] lmLogInit+0xb04/0x1790 fs/jfs/jfs_logmgr.c:1423 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x7c8/0x13e0 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x871/0xc80 fs/jfs/super.c:570 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:592 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:2903 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3233 do_mount fs/namespace.c:3246 [inline] __do_sys_mount fs/namespace.c:3454 [inline] __se_sys_mount fs/namespace.c:3431 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3431 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 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:345 insert_work+0x48/0x370 kernel/workqueue.c:1331 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1497 queue_work_on+0xee/0x110 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1f0/0x4c0 kernel/umh.c:433 kobject_uevent_env+0xf9f/0x1680 lib/kobject_uevent.c:617 __loop_clr_fd+0x662/0xff0 drivers/block/loop.c:1248 lo_release+0x1ac/0x1f0 drivers/block/loop.c:1923 __blkdev_put+0x54e/0x800 fs/block_dev.c:1588 blkdev_put+0x92/0x580 fs/block_dev.c:1641 blkdev_close+0x8c/0xb0 fs/block_dev.c:1649 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:301 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:345 insert_work+0x48/0x370 kernel/workqueue.c:1331 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1497 queue_work_on+0xee/0x110 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1f0/0x4c0 kernel/umh.c:433 kobject_uevent_env+0xf9f/0x1680 lib/kobject_uevent.c:617 loop_configure+0x10cb/0x13a0 drivers/block/loop.c:255 lo_ioctl+0x3f7/0x1620 drivers/block/loop.c:1681 blkdev_ioctl+0x2a1/0x6d0 block/ioctl.c:583 block_ioctl+0xf9/0x140 fs/block_dev.c:1667 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888011f31e00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 104 bytes inside of 192-byte region [ffff888011f31e00, ffff888011f31ec0) The buggy address belongs to the page: page:000000001c528470 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f31 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00005b2dc0 0000000300000003 ffff888010841a00 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888011f31d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011f31d80: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888011f31e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888011f31e80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888011f31f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================