bisecting fixing commit since f5b7769eb0400ec5217a47e41148a9f816ca1f9f building syzkaller on 27c5f59f504f562333e3cd5e715fea5cb69c396e testing commit f5b7769eb0400ec5217a47e41148a9f816ca1f9f with gcc (GCC) 8.1.0 kernel signature: 042277ff1b4bf42f2fd376cb96be893128535171caa95615cf99533e00d4069d all runs: crashed: KASAN: use-after-free Read in blkdev_get testing current HEAD 98790bbac4db1697212ce9462ec35ca09c4a2810 testing commit 98790bbac4db1697212ce9462ec35ca09c4a2810 with gcc (GCC) 8.1.0 kernel signature: 914237f2078386e61a1b5041dc0f5eec3c120dd3c99182d20fe6b807fb6c08a5 all runs: crashed: KASAN: use-after-free Read in blkdev_get revisions tested: 2, total time: 27m10.933783743s (build: 9m40.272849766s, test: 16m12.402498954s) the crash still happens on HEAD commit msg: Merge tag 'efi-urgent-2020-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip crash: KASAN: use-after-free Read in blkdev_get REISERFS warning (device loop1): sh-2022 reiserfs_fill_super: unable to initialize journal space REISERFS (device loop3): using ordered data mode REISERFS warning (device loop0): sh-2022 reiserfs_fill_super: unable to initialize journal space reiserfs: using flush barriers ================================================================== BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:938 [inline] BUG: KASAN: use-after-free in __mutex_lock+0x10cc/0x1400 kernel/locking/mutex.c:1103 Read of size 8 at addr ffff8881b85fe138 by task syz-executor4/30099 CPU: 1 PID: 30099 Comm: syz-executor4 Not tainted 5.7.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x12f/0x187 lib/dump_stack.c:118 print_address_description.constprop.8+0x3f/0x60 mm/kasan/report.c:382 __kasan_report.cold.11+0x23/0x3a mm/kasan/report.c:511 kasan_report+0x38/0x50 mm/kasan/common.c:625 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:146 __mutex_lock_common kernel/locking/mutex.c:938 [inline] __mutex_lock+0x10cc/0x1400 kernel/locking/mutex.c:1103 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1118 blkdev_get+0xb2/0x230 fs/block_dev.c:1754 blkdev_get_by_dev+0x31/0x50 fs/block_dev.c:1851 journal_init_dev fs/reiserfs/journal.c:2616 [inline] journal_init+0xa0c/0x66d0 fs/reiserfs/journal.c:2763 reiserfs_fill_super+0x99b/0x2800 fs/reiserfs/super.c:2032 mount_bdev+0x27b/0x340 fs/super.c:1417 get_super_block+0x10/0x20 fs/reiserfs/super.c:2606 legacy_get_tree+0x103/0x1f0 fs/fs_context.c:622 vfs_get_tree+0x8b/0x2d0 fs/super.c:1547 do_new_mount fs/namespace.c:2816 [inline] do_mount+0x1287/0x1c30 fs/namespace.c:3141 __do_sys_mount fs/namespace.c:3350 [inline] __se_sys_mount fs/namespace.c:3327 [inline] __x64_sys_mount+0x169/0x1c0 fs/namespace.c:3327 do_syscall_64+0xd0/0x630 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x4586aa Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 dd 8f fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ba 8f fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007f6f097b9a88 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000228 RCX: 00000000004586aa RDX: 00007f6f097b9ad0 RSI: 0000000020000100 RDI: 00007f6f097b9af0 RBP: 0000000000000001 R08: 00007f6f097b9b30 R09: 00007f6f097b9ad0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000001 R14: 00000000004d2f98 R15: 0000000000000000 Allocated by task 30099: save_stack+0x21/0x50 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc.constprop.7+0xc1/0xd0 mm/kasan/common.c:495 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:503 slab_post_alloc_hook mm/slab.h:586 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x121/0x740 mm/slab.c:3484 bdev_alloc_inode+0x15/0x30 fs/block_dev.c:772 alloc_inode+0x5f/0x1a0 fs/inode.c:232 iget5_locked+0x103/0x190 fs/inode.c:1148 bdget+0x90/0x4e0 fs/block_dev.c:905 blkdev_get_by_dev+0x1b/0x50 fs/block_dev.c:1847 journal_init_dev fs/reiserfs/journal.c:2616 [inline] journal_init+0xa0c/0x66d0 fs/reiserfs/journal.c:2763 reiserfs_fill_super+0x99b/0x2800 fs/reiserfs/super.c:2032 mount_bdev+0x27b/0x340 fs/super.c:1417 get_super_block+0x10/0x20 fs/reiserfs/super.c:2606 legacy_get_tree+0x103/0x1f0 fs/fs_context.c:622 vfs_get_tree+0x8b/0x2d0 fs/super.c:1547 do_new_mount fs/namespace.c:2816 [inline] do_mount+0x1287/0x1c30 fs/namespace.c:3141 __do_sys_mount fs/namespace.c:3350 [inline] __se_sys_mount fs/namespace.c:3327 [inline] __x64_sys_mount+0x169/0x1c0 fs/namespace.c:3327 do_syscall_64+0xd0/0x630 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 1: save_stack+0x21/0x50 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/common.c:456 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x86/0x2e0 mm/slab.c:3694 bdev_free_inode+0x17/0x20 fs/block_dev.c:780 i_callback+0x3f/0x70 fs/inode.c:221 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x59e/0x13b0 kernel/rcu/tree.c:2433 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2442 __do_softirq+0x248/0x9a6 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881b85fe0c0 which belongs to the cache bdev_cache of size 1448 The buggy address is located 120 bytes inside of 1448-byte region [ffff8881b85fe0c0, ffff8881b85fe668) The buggy address belongs to the page: page:ffffea0006e17f80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881b85feffe flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea0006e16148 ffffea00074ccc08 ffff8881da1abc40 raw: ffff8881b85feffe ffff8881b85fe0c0 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881b85fe000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881b85fe080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8881b85fe100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881b85fe180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881b85fe200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================