RDX: 0000000000002031 RSI: 0000000020000200 RDI: 0000000000000008 RBP: 00007fddbb9dc120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 000000000000000b R14: 00007fddbad9bf80 R15: 00007fff8b72d5c8 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent-io-tree.c:379! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 6004 Comm: syz-executor.2 Not tainted 6.5.0-syzkaller-08894-gb97d64c72259 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 RIP: 0010:set_state_bits fs/btrfs/extent-io-tree.c:379 [inline] RIP: 0010:insert_state+0x38d/0x390 fs/btrfs/extent-io-tree.c:401 Code: 5b 32 fe e9 25 fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 42 fd ff ff 48 89 df e8 0d 5b 32 fe e9 35 fd ff ff e8 73 a1 d8 fd <0f> 0b 90 66 0f 1f 00 55 41 57 41 56 41 55 41 54 53 48 83 ec 48 44 RSP: 0018:ffffc90014a5ee98 EFLAGS: 00010246 RAX: ffffffff83b4a29d RBX: 00000000fffffff4 RCX: 0000000000040000 RDX: ffffc90004082000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffff8880636fe780 R08: ffffffff83b4a07b R09: 1ffffffff1a84c96 R10: dffffc0000000000 R11: fffffbfff1a84c97 R12: 0000000000000000 R13: 0000000000000800 R14: 0000000000000fff R15: dffffc0000000000 FS: 00007fddbb9dc6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000200 CR3: 0000000077497000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __set_extent_bit+0x1106/0x1b00 fs/btrfs/extent-io-tree.c:1151 set_record_extent_bits+0x51/0x90 fs/btrfs/extent-io-tree.c:1705 qgroup_reserve_data+0x260/0x8e0 fs/btrfs/qgroup.c:3803 btrfs_qgroup_reserve_data+0x2e/0xc0 fs/btrfs/qgroup.c:3846 btrfs_check_data_free_space+0x149/0x240 fs/btrfs/delalloc-space.c:154 btrfs_delalloc_reserve_space+0x37/0x200 fs/btrfs/delalloc-space.c:467 btrfs_page_mkwrite+0x334/0xd10 fs/btrfs/inode.c:8104 do_page_mkwrite+0x197/0x470 mm/memory.c:2930 wp_page_shared mm/memory.c:3290 [inline] do_wp_page+0xea8/0x3e10 mm/memory.c:3375 handle_pte_fault mm/memory.c:4993 [inline] __handle_mm_fault mm/memory.c:5118 [inline] handle_mm_fault+0x18a7/0x5ee0 mm/memory.c:5283 do_user_addr_fault arch/x86/mm/fault.c:1391 [inline] handle_page_fault arch/x86/mm/fault.c:1483 [inline] exc_page_fault+0x266/0x7d0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:71 Code: 75 f1 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 df 83 f9 08 73 e8 eb c9 a4 c3 48 89 c8 48 c1 e9 03 83 e0 07 f3 48 a5 89 c1 85 c9 75 b3 RSP: 0018:ffffc90014a5fa38 EFLAGS: 00050206 RAX: ffffffff8437a101 RBX: 0000000020000200 RCX: 0000000000000f2d RDX: 0000000000000000 RSI: ffff88806474e000 RDI: 0000000020000200 RBP: ffffc90014a5fb88 R08: ffff88806474ef2c R09: 1ffff1100c8e9de5 R10: dffffc0000000000 R11: ffffed100c8e9de6 R12: 1ffff9200294bfb3 R13: ffff88806474e000 R14: 0000000000000f2d R15: ffffc90014a5fd98 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline] copyout lib/iov_iter.c:168 [inline] _copy_to_iter+0x241/0x1000 lib/iov_iter.c:316 copy_to_iter include/linux/uio.h:201 [inline] seq_read_iter+0xb2c/0xd10 fs/seq_file.c:281 proc_reg_read_iter+0x1bc/0x290 fs/proc/inode.c:305 call_read_iter include/linux/fs.h:1979 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x795/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fddbac7cae9 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:00007fddbb9dc0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007fddbad9bf80 RCX: 00007fddbac7cae9 RDX: 0000000000002031 RSI: 0000000020000200 RDI: 0000000000000008 RBP: 00007fddbb9dc120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 000000000000000b R14: 00007fddbad9bf80 R15: 00007fff8b72d5c8 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:set_state_bits fs/btrfs/extent-io-tree.c:379 [inline] RIP: 0010:insert_state+0x38d/0x390 fs/btrfs/extent-io-tree.c:401 Code: 5b 32 fe e9 25 fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 42 fd ff ff 48 89 df e8 0d 5b 32 fe e9 35 fd ff ff e8 73 a1 d8 fd <0f> 0b 90 66 0f 1f 00 55 41 57 41 56 41 55 41 54 53 48 83 ec 48 44 RSP: 0018:ffffc90014a5ee98 EFLAGS: 00010246 RAX: ffffffff83b4a29d RBX: 00000000fffffff4 RCX: 0000000000040000 RDX: ffffc90004082000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffff8880636fe780 R08: ffffffff83b4a07b R09: 1ffffffff1a84c96 R10: dffffc0000000000 R11: fffffbfff1a84c97 R12: 0000000000000000 R13: 0000000000000800 R14: 0000000000000fff R15: dffffc0000000000 FS: 00007fddbb9dc6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000200 CR3: 0000000077497000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 75 f1 jne 0xfffffff3 2: c3 ret 3: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) a: 00 00 00 d: 0f 1f 00 nopl (%rax) 10: 48 8b 06 mov (%rsi),%rax 13: 48 89 07 mov %rax,(%rdi) 16: 48 83 c6 08 add $0x8,%rsi 1a: 48 83 c7 08 add $0x8,%rdi 1e: 83 e9 08 sub $0x8,%ecx 21: 74 df je 0x2 23: 83 f9 08 cmp $0x8,%ecx 26: 73 e8 jae 0x10 28: eb c9 jmp 0xfffffff3 * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: c3 ret 2d: 48 89 c8 mov %rcx,%rax 30: 48 c1 e9 03 shr $0x3,%rcx 34: 83 e0 07 and $0x7,%eax 37: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) 3a: 89 c1 mov %eax,%ecx 3c: 85 c9 test %ecx,%ecx 3e: 75 b3 jne 0xfffffff3