R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 000000000000000b R14: 00007f5e4a19bf80 R15: 00007ffcbb445158 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent-tree.c:3291! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 3 PID: 10243 Comm: syz-executor.3 Not tainted 6.6.0-rc1-syzkaller-00115-g9fdfb15a3dbf #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:btrfs_free_tree_block+0x788/0xb50 fs/btrfs/extent-tree.c:3291 Code: e8 5d df fe fd 31 ff 89 c5 89 c6 e8 02 4a 16 fe 40 84 ed 0f 85 e5 fb ff ff e8 c4 4e 16 fe 0f 0b e9 d9 fb ff ff e8 b8 4e 16 fe <0f> 0b e8 b1 4e 16 fe 49 8d 7d 20 48 b8 00 00 00 00 00 fc ff df 48 RSP: 0018:ffffc9000c306f70 EFLAGS: 00010246 RAX: 0000000000040000 RBX: ffff8880671ea608 RCX: ffffc90006263000 RDX: 0000000000040000 RSI: ffffffff83707e48 RDI: 0000000000000005 RBP: 0000000000000002 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 6637303030302052 R12: 1ffff92001860df3 R13: ffff8880671df2a0 R14: 0000000000000001 R15: ffff8880671ea610 FS: 00007f5e4ad886c0(0000) GS:ffff88806b900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffda7e9b948 CR3: 000000011515e000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __btrfs_cow_block+0xfbd/0x18f0 fs/btrfs/ctree.c:601 btrfs_cow_block+0x2f1/0x820 fs/btrfs/ctree.c:712 btrfs_search_slot+0x12a0/0x30e0 fs/btrfs/ctree.c:2194 lookup_inline_extent_backref+0x293/0x13d0 fs/btrfs/extent-tree.c:818 lookup_extent_backref+0x46/0x110 fs/btrfs/extent-tree.c:1047 __btrfs_free_extent+0x2a6/0x2c80 fs/btrfs/extent-tree.c:2985 run_delayed_tree_ref fs/btrfs/extent-tree.c:1716 [inline] run_one_delayed_ref fs/btrfs/extent-tree.c:1740 [inline] btrfs_run_delayed_refs_for_head fs/btrfs/extent-tree.c:1986 [inline] __btrfs_run_delayed_refs+0xd3a/0x3b50 fs/btrfs/extent-tree.c:2047 btrfs_run_delayed_refs+0x1a1/0x510 fs/btrfs/extent-tree.c:2159 btrfs_commit_transaction+0x85b/0x3fe0 fs/btrfs/transaction.c:2185 btrfs_sync_file+0xfa1/0x1310 fs/btrfs/file.c:1973 vfs_fsync_range+0x141/0x220 fs/sync.c:188 generic_write_sync include/linux/fs.h:2625 [inline] btrfs_do_write_iter+0x572/0x1060 fs/btrfs/file.c:1662 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5e4a07cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5e4ad880c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f5e4a19bf80 RCX: 00007f5e4a07cae9 RDX: 0000000000000050 RSI: 00000000200020c0 RDI: 0000000000000004 RBP: 00007f5e4ad88120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 000000000000000b R14: 00007f5e4a19bf80 R15: 00007ffcbb445158 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btrfs_free_tree_block+0x788/0xb50 fs/btrfs/extent-tree.c:3291 Code: e8 5d df fe fd 31 ff 89 c5 89 c6 e8 02 4a 16 fe 40 84 ed 0f 85 e5 fb ff ff e8 c4 4e 16 fe 0f 0b e9 d9 fb ff ff e8 b8 4e 16 fe <0f> 0b e8 b1 4e 16 fe 49 8d 7d 20 48 b8 00 00 00 00 00 fc ff df 48 RSP: 0018:ffffc9000c306f70 EFLAGS: 00010246 RAX: 0000000000040000 RBX: ffff8880671ea608 RCX: ffffc90006263000 RDX: 0000000000040000 RSI: ffffffff83707e48 RDI: 0000000000000005 RBP: 0000000000000002 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 6637303030302052 R12: 1ffff92001860df3 R13: ffff8880671df2a0 R14: 0000000000000001 R15: ffff8880671ea610 FS: 00007f5e4ad886c0(0000) GS:ffff88806b900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffda7e9b948 CR3: 000000011515e000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400