task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x278/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f ------------[ cut here ]------------ kernel BUG at mm/filemap.c:1507! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 2 PID: 12838 Comm: syz-executor.2 Not tainted 6.10.0-rc4-syzkaller-00283-g563a50672d8a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:folio_unlock mm/filemap.c:1507 [inline] RIP: 0010:folio_unlock+0xb3/0xd0 mm/filemap.c:1502 Code: 93 f5 ce ff 48 89 ef 31 f6 e8 99 eb ff ff 5b 5d e9 82 f5 ce ff e8 7d f5 ce ff 48 c7 c6 20 93 37 8b 48 89 ef e8 3e 41 11 00 90 <0f> 0b 48 89 df e8 53 bd 2a 00 e9 7b ff ff ff 66 66 2e 0f 1f 84 00 RSP: 0018:ffffc90003a57268 EFLAGS: 00010246 RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc90005b71000 RDX: 0000000000040000 RSI: ffffffff81bef002 RDI: ffff888026fd0444 RBP: ffffea0000ba5540 R08: 0000000000000001 R09: fffffbfff284e287 R10: ffffffff9427143f R11: 0000000000000000 R12: ffff8880329f4458 R13: ffffea0000ba5540 R14: 00000000fffffffb R15: 00000000fffffffb FS: 00007f90359186c0(0000) GS:ffff88806b200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b3085d000 CR3: 00000000517fc000 CR4: 0000000000350ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __extent_writepage fs/btrfs/extent_io.c:1519 [inline] extent_write_cache_pages+0x10fd/0x1ce0 fs/btrfs/extent_io.c:2173 btrfs_writepages+0x21b/0x4a0 fs/btrfs/extent_io.c:2294 do_writepages+0x1a3/0x7f0 mm/page-writeback.c:2634 filemap_fdatawrite_wbc mm/filemap.c:397 [inline] filemap_fdatawrite_wbc+0x148/0x1c0 mm/filemap.c:387 __filemap_fdatawrite_range+0xba/0x100 mm/filemap.c:430 btrfs_fdatawrite_range+0x4a/0x110 fs/btrfs/file.c:4066 start_ordered_ops.constprop.0+0x96/0xe0 fs/btrfs/file.c:1753 btrfs_sync_file+0x1fd/0xe10 fs/btrfs/file.c:1828 vfs_fsync_range+0x141/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2794 [inline] btrfs_do_write_iter+0x584/0x10c0 fs/btrfs/file.c:1705 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9034c7cee9 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:00007f90359180c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9034dabf80 RCX: 00007f9034c7cee9 RDX: 0000000000000009 RSI: 0000000020000100 RDI: 0000000000000007 RBP: 00007f9034cc949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f9034dabf80 R15: 00007fff4ce67718 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:folio_unlock mm/filemap.c:1507 [inline] RIP: 0010:folio_unlock+0xb3/0xd0 mm/filemap.c:1502 Code: 93 f5 ce ff 48 89 ef 31 f6 e8 99 eb ff ff 5b 5d e9 82 f5 ce ff e8 7d f5 ce ff 48 c7 c6 20 93 37 8b 48 89 ef e8 3e 41 11 00 90 <0f> 0b 48 89 df e8 53 bd 2a 00 e9 7b ff ff ff 66 66 2e 0f 1f 84 00 RSP: 0018:ffffc90003a57268 EFLAGS: 00010246 RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc90005b71000 RDX: 0000000000040000 RSI: ffffffff81bef002 RDI: ffff888026fd0444 RBP: ffffea0000ba5540 R08: 0000000000000001 R09: fffffbfff284e287 R10: ffffffff9427143f R11: 0000000000000000 R12: ffff8880329f4458 R13: ffffea0000ba5540 R14: 00000000fffffffb R15: 00000000fffffffb FS: 00007f90359186c0(0000) GS:ffff88806b200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff222779538 CR3: 00000000517fc000 CR4: 0000000000350ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400