bisecting fixing commit since f40ddce88593482919761f74910f42f4b84c004b building syzkaller on 3e5ed8b45e7a561d6344a4d3d7bf3bfb8f24a7b3 testing commit f40ddce88593482919761f74910f42f4b84c004b with gcc (GCC) 10.2.1 20210217 kernel signature: 401ae697250340a8f19fafbe34755b1004207c8f3a328d8b50087c42f968b433 run #0: crashed: KASAN: use-after-free Read in blk_update_request run #1: crashed: KASAN: use-after-free Read in blk_update_request run #2: crashed: KASAN: use-after-free Read in blk_update_request run #3: crashed: KASAN: use-after-free Read in blk_update_request run #4: crashed: KASAN: use-after-free Read in blk_update_request run #5: crashed: KASAN: use-after-free Read in blk_update_request run #6: OK run #7: OK run #8: OK run #9: OK run #10: OK run #11: OK run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK reproducer seems to be flaky testing current HEAD b741596468b010af2846b75f5e75a842ce344a6e testing commit b741596468b010af2846b75f5e75a842ce344a6e with gcc (GCC) 10.2.1 20210217 kernel signature: cea49cc6d9ceab08076aabd0ad68328081495054ed84702ee11c4c7da8bb580e run #0: crashed: KASAN: use-after-free Read in blk_update_request run #1: crashed: KASAN: use-after-free Read in blk_update_request run #2: crashed: KASAN: use-after-free Read in blk_update_request run #3: crashed: KASAN: use-after-free Read in blk_update_request run #4: crashed: KASAN: use-after-free Read in blk_update_request run #5: crashed: KASAN: use-after-free Read in blk_update_request run #6: crashed: KASAN: use-after-free Read in blk_update_request run #7: OK run #8: OK run #9: OK run #10: OK run #11: OK run #12: OK run #13: OK run #14: OK run #15: OK run #16: OK run #17: OK run #18: OK run #19: OK Reproducer flagged being flaky revisions tested: 2, total time: 38m55.052672171s (build: 14m9.716103338s, test: 24m2.673768574s) the crash still happens on HEAD commit msg: Merge tag 'riscv-for-linus-5.13-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux crash: KASAN: use-after-free Read in blk_update_request ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3e4e/0x5560 kernel/locking/lockdep.c:4772 Read of size 8 at addr ffff888021746168 by task ksoftirqd/0/12 CPU: 0 PID: 12 Comm: ksoftirqd/0 Not tainted 5.12.0-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+0x93/0xc2 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 __lock_acquire+0x3e4e/0x5560 kernel/locking/lockdep.c:4772 lock_acquire kernel/locking/lockdep.c:5512 [inline] lock_acquire+0x1ab/0x730 kernel/locking/lockdep.c:5477 __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 req_bio_endio block/blk-core.c:265 [inline] blk_update_request+0x73e/0x11d0 block/blk-core.c:1454 blk_mq_end_request+0x46/0x480 block/blk-mq.c:565 blk_complete_reqs+0x90/0xc0 block/blk-mq.c:577 __do_softirq+0x29b/0x9f6 kernel/softirq.c:559 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x561/0x8e0 kernel/smpboot.c:165 kthread+0x36f/0x450 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 20347: 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:428 [inline] ____kasan_kmalloc mm/kasan/common.c:507 [inline] __kasan_kmalloc+0x7c/0x90 mm/kasan/common.c:516 kmalloc include/linux/slab.h:556 [inline] lbmLogInit fs/jfs/jfs_logmgr.c:1829 [inline] lmLogInit+0x300/0x12b0 fs/jfs/jfs_logmgr.c:1278 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x67d/0x1010 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0x229/0x430 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x78c/0xb10 fs/jfs/super.c:570 mount_bdev+0x2cb/0x3b0 fs/super.c:1368 legacy_get_tree+0xfa/0x1f0 fs/fs_context.c:592 vfs_get_tree+0x7f/0x2c0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x7f3/0x1a40 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+0x1f5/0x260 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 20347: 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+0xe0/0x110 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1581 [inline] slab_free_freelist_hook+0xa1/0x180 mm/slub.c:1606 slab_free mm/slub.c:3166 [inline] kfree+0xdb/0x3c0 mm/slub.c:4225 lbmLogShutdown fs/jfs/jfs_logmgr.c:1872 [inline] lmLogInit+0x896/0x12b0 fs/jfs/jfs_logmgr.c:1423 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x67d/0x1010 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0x229/0x430 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x78c/0xb10 fs/jfs/super.c:570 mount_bdev+0x2cb/0x3b0 fs/super.c:1368 legacy_get_tree+0xfa/0x1f0 fs/fs_context.c:592 vfs_get_tree+0x7f/0x2c0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x7f3/0x1a40 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+0x1f5/0x260 fs/namespace.c:3433 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 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+0xc5/0xf0 mm/kasan/generic.c:345 insert_work+0x42/0x300 kernel/workqueue.c:1331 __queue_work+0x49c/0xc70 kernel/workqueue.c:1497 queue_work_on+0x64/0x70 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1b8/0x430 kernel/umh.c:435 kobject_uevent_env+0xc67/0x1290 lib/kobject_uevent.c:618 loop_configure+0xdaf/0x10c0 drivers/block/loop.c:256 lo_ioctl+0x3b9/0x1540 drivers/block/loop.c:1690 blkdev_ioctl+0x24c/0x5f0 block/ioctl.c:585 block_ioctl+0xd4/0x130 fs/block_dev.c:1664 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+0x11f/0x190 fs/ioctl.c:1055 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 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+0xc5/0xf0 mm/kasan/generic.c:345 insert_work+0x42/0x300 kernel/workqueue.c:1331 __queue_work+0x49c/0xc70 kernel/workqueue.c:1497 queue_work_on+0x64/0x70 kernel/workqueue.c:1524 queue_work include/linux/workqueue.h:507 [inline] call_usermodehelper_exec+0x1b8/0x430 kernel/umh.c:435 kobject_uevent_env+0xc67/0x1290 lib/kobject_uevent.c:618 __loop_clr_fd+0x60c/0xf50 drivers/block/loop.c:1249 loop_clr_fd drivers/block/loop.c:1337 [inline] lo_ioctl+0x37a/0x1540 drivers/block/loop.c:1695 blkdev_ioctl+0x24c/0x5f0 block/ioctl.c:585 block_ioctl+0xd4/0x130 fs/block_dev.c:1664 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+0x11f/0x190 fs/ioctl.c:1055 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888021746100 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 104 bytes inside of 192-byte region [ffff888021746100, ffff8880217461c0) The buggy address belongs to the page: page:000000003477123c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x21746 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000710a00 0000000200000002 ffff88800f041a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888021746000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888021746080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888021746100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888021746180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888021746200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================