bisecting fixing commit since b850307b279cbd12ab8c654d1a3dfe55319cc475 building syzkaller on 9f9845eb28f0b516d36cb5478bae8dd5714733f1 testing commit b850307b279cbd12ab8c654d1a3dfe55319cc475 with gcc (GCC) 8.1.0 kernel signature: 3dcd78d57589a7e47b6cf9c352a91db3e9019bc82695f5614c78191437e05839 all runs: crashed: KASAN: use-after-free Read in btrfs_mount testing current HEAD 14b58326976de6ef3998eefec1dd7f8b38b97a75 testing commit 14b58326976de6ef3998eefec1dd7f8b38b97a75 with gcc (GCC) 8.1.0 kernel signature: 14fe23209f2c4e8555c337ab5b6afdf6b2c18d5c5ad476d1a5887099f8463298 all runs: crashed: KASAN: use-after-free Read in btrfs_mount revisions tested: 2, total time: 25m23.058436682s (build: 17m58.439520377s, test: 6m11.11720695s) the crash still happens on HEAD commit msg: Linux 4.14.193 crash: KASAN: use-after-free Read in btrfs_mount RBP: 000000000078bf00 R08: 00007f63be900b40 R09: 00007f63be900ae0 R10: 0000000000000005 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000c2b R14: 00000000004ce7e0 R15: 00007f63be9016d4 ================================================================== BUG: KASAN: use-after-free in free_fs_info fs/btrfs/ctree.h:2931 [inline] BUG: KASAN: use-after-free in btrfs_mount+0x2819/0x2854 fs/btrfs/super.c:1644 Read of size 8 at addr ffff88807a3fae58 by task syz-executor.1/8152 CPU: 0 PID: 8152 Comm: syz-executor.1 Not tainted 4.14.193-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 free_fs_info fs/btrfs/ctree.h:2931 [inline] btrfs_mount+0x2819/0x2854 fs/btrfs/super.c:1644 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount+0xe/0x20 fs/namespace.c:1032 mount_subvol fs/btrfs/super.c:1392 [inline] btrfs_mount+0x39a/0x2854 fs/btrfs/super.c:1563 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount fs/namespace.c:1036 [inline] do_new_mount fs/namespace.c:2549 [inline] do_mount+0x352/0x2af0 fs/namespace.c:2879 SYSC_mount fs/namespace.c:3095 [inline] SyS_mount+0xb1/0xd0 fs/namespace.c:3072 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45f5fa RSP: 002b:00007f598bfdba68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 000000000050a2a0 RCX: 000000000045f5fa RDX: 00007f598bfdbae0 RSI: 00000000200001c0 RDI: 00007f598bfdbb00 RBP: 000000000078bf00 R08: 00007f598bfdbb40 R09: 00007f598bfdbae0 R10: 0000000000000005 R11: 0000000000000246 R12: 0000000000000003 R13: 0000000000000c2b R14: 00000000004ce7e0 R15: 00007f598bfdc6d4 Allocated by task 8152: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x46/0x80 mm/util.c:397 kvmalloc include/linux/mm.h:531 [inline] kvzalloc include/linux/mm.h:539 [inline] btrfs_mount+0xaa3/0x2854 fs/btrfs/super.c:1584 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount+0xe/0x20 fs/namespace.c:1032 mount_subvol fs/btrfs/super.c:1392 [inline] btrfs_mount+0x39a/0x2854 fs/btrfs/super.c:1563 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount fs/namespace.c:1036 [inline] do_new_mount fs/namespace.c:2549 [inline] do_mount+0x352/0x2af0 fs/namespace.c:2879 SYSC_mount fs/namespace.c:3095 [inline] SyS_mount+0xb1/0xd0 fs/namespace.c:3072 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 8152: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 kvfree+0x2c/0x30 mm/util.c:416 free_fs_info fs/btrfs/ctree.h:2944 [inline] btrfs_kill_super+0x3fd/0x530 fs/btrfs/super.c:2150 deactivate_locked_super+0x62/0xb0 fs/super.c:319 sget_userns+0x8eb/0xb40 fs/super.c:537 sget+0xbe/0x100 fs/super.c:572 btrfs_mount+0xd42/0x2854 fs/btrfs/super.c:1610 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount+0xe/0x20 fs/namespace.c:1032 mount_subvol fs/btrfs/super.c:1392 [inline] btrfs_mount+0x39a/0x2854 fs/btrfs/super.c:1563 mount_fs+0x7f/0x269 fs/super.c:1237 vfs_kern_mount.part.9+0x58/0x3c0 fs/namespace.c:1046 vfs_kern_mount fs/namespace.c:1036 [inline] do_new_mount fs/namespace.c:2549 [inline] do_mount+0x352/0x2af0 fs/namespace.c:2879 SYSC_mount fs/namespace.c:3095 [inline] SyS_mount+0xb1/0xd0 fs/namespace.c:3072 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff88807a3f95c0 which belongs to the cache kmalloc-16384 of size 16384 The buggy address is located 6296 bytes inside of 16384-byte region [ffff88807a3f95c0, ffff88807a3fd5c0) The buggy address belongs to the page: page:ffffea0001e8fe00 count:1 mapcount:0 mapping:ffff88807a3f95c0 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff88807a3f95c0 0000000000000000 0000000100000001 raw: ffffea0001e8be20 ffffea0001e8f020 ffff8880aa802200 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88807a3fad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a3fad80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807a3fae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a3fae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a3faf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================