free_unref_folios+0x1f2/0xc10 mm/page_alloc.c:2536 folios_put_refs+0x93a/0xa60 mm/swap.c:1034 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x6d9/0x1df0 mm/shmem.c:1005 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x29b/0xa60 mm/shmem.c:1242 evict+0x2a8/0x630 fs/inode.c:667 __dentry_kill+0x20d/0x630 fs/dcache.c:603 dput+0x19f/0x2b0 fs/dcache.c:845 __fput+0x678/0x8a0 fs/file_table.c:430 task_work_run+0x24f/0x310 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+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x102/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f ------------[ cut here ]------------ kernel BUG at mm/filemap.c:162! invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 1 PID: 6054 Comm: syz-executor.1 Not tainted 6.9.0-rc6-syzkaller-00046-g18daea77cca6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:filemap_unaccount_folio+0x70d/0xc60 mm/filemap.c:162 Code: 25 ff 0f 00 00 0f 84 f0 00 00 00 e8 9d fc ca ff e9 6c f9 ff ff e8 93 fc ca ff 4c 89 ef 48 c7 c6 a0 84 d3 8b e8 04 55 11 00 90 <0f> 0b e8 7c fc ca ff 4c 89 ef 48 c7 c6 40 85 d3 8b e8 ed 54 11 00 RSP: 0018:ffffc9000324f658 EFLAGS: 00010046 RAX: 18b8051d802ae500 RBX: 0000000000000000 RCX: ffffc9000324f203 RDX: 0000000000000002 RSI: ffffffff8bcaca20 RDI: ffffffff8c1eaaa0 RBP: 0000000000000000 R08: ffffffff8fa7ccef R09: 1ffffffff1f4f99d R10: dffffc0000000000 R11: fffffbfff1f4f99e R12: 1ffffd40002a54f8 R13: ffffea000152a7c0 R14: 1ffffd40002a54f9 R15: ffffea000152a7c8 FS: 0000555571b60480(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b31222000 CR3: 000000002a9d4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __filemap_remove_folio+0xc4/0x9e0 mm/filemap.c:231 filemap_remove_folio+0x109/0x2e0 mm/filemap.c:264 truncate_inode_folio+0x5d/0x70 mm/truncate.c:195 shmem_undo_range+0x45d/0x1df0 mm/shmem.c:1001 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x29b/0xa60 mm/shmem.c:1242 evict+0x2a8/0x630 fs/inode.c:667 __dentry_kill+0x20d/0x630 fs/dcache.c:603 dput+0x19f/0x2b0 fs/dcache.c:845 __fput+0x678/0x8a0 fs/file_table.c:430 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1541 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9a1467cd9a Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffea2a7cb30 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007f9a1467cd9a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f9a147ad980 R08: 00007f9a14600000 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000293 R12: 0000000000021cde R13: 0000000000021cac R14: 00007ffea2a7ccf0 R15: 00007f9a14634cb0 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:filemap_unaccount_folio+0x70d/0xc60 mm/filemap.c:162 Code: 25 ff 0f 00 00 0f 84 f0 00 00 00 e8 9d fc ca ff e9 6c f9 ff ff e8 93 fc ca ff 4c 89 ef 48 c7 c6 a0 84 d3 8b e8 04 55 11 00 90 <0f> 0b e8 7c fc ca ff 4c 89 ef 48 c7 c6 40 85 d3 8b e8 ed 54 11 00 RSP: 0018:ffffc9000324f658 EFLAGS: 00010046 RAX: 18b8051d802ae500 RBX: 0000000000000000 RCX: ffffc9000324f203 RDX: 0000000000000002 RSI: ffffffff8bcaca20 RDI: ffffffff8c1eaaa0 RBP: 0000000000000000 R08: ffffffff8fa7ccef R09: 1ffffffff1f4f99d R10: dffffc0000000000 R11: fffffbfff1f4f99e R12: 1ffffd40002a54f8 R13: ffffea000152a7c0 R14: 1ffffd40002a54f9 R15: ffffea000152a7c8 FS: 0000555571b60480(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b31222000 CR3: 000000002a9d4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400