syzbot


kernel BUG in folio_end_writeback (2)

Status: upstream: reported on 2025/02/13 22:14
Subsystems: iomap
[Documentation on labels]
Reported-by: syzbot+29566bbfe6b64b944865@syzkaller.appspotmail.com
First crash: 11d, last: 6h43m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [iomap?] kernel BUG in folio_end_writeback (2) 0 (1) 2025/02/13 22:14
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 kernel BUG in folio_end_writeback origin:upstream C unreliable 1 450d 655d 0/3 auto-obsoleted due to no activity on 2024/03/07 11:15
upstream kernel BUG in folio_end_writeback nilfs C error done 41 441d 787d 0/28 auto-obsoleted due to no activity on 2024/03/16 05:37

Sample crash report:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56000
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 ffffea00014c5248 ffffea0001580048 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x153c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE|__GFP_WRITE), pid 5319, tgid 5318 (syz.0.0), ts 69565521276, free_ts 69624323461
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551
 prep_new_page mm/page_alloc.c:1559 [inline]
 get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477
 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739
 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270
 alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline]
 alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2361
 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2371
 filemap_alloc_folio_noprof+0xe1/0x540 mm/filemap.c:1019
 __filemap_get_folio+0x438/0xae0 mm/filemap.c:1970
 iomap_get_folio fs/iomap/buffered-io.c:608 [inline]
 __iomap_get_folio fs/iomap/buffered-io.c:754 [inline]
 iomap_write_begin+0x4d3/0x1990 fs/iomap/buffered-io.c:797
 iomap_write_iter fs/iomap/buffered-io.c:955 [inline]
 iomap_file_buffered_write+0x6ea/0x11c0 fs/iomap/buffered-io.c:1039
 xfs_file_buffered_write+0x2cd/0xb20 fs/xfs/xfs_file.c:792
 new_sync_write fs/read_write.c:586 [inline]
 vfs_write+0xacf/0xd10 fs/read_write.c:679
 ksys_write+0x18f/0x2b0 fs/read_write.c:731
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5319 tgid 5318 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1127 [inline]
 free_unref_folios+0xe40/0x18b0 mm/page_alloc.c:2707
 folios_put_refs+0x76c/0x860 mm/swap.c:994
 folio_batch_release include/linux/pagevec.h:101 [inline]
 truncate_inode_pages_range+0xe65/0x10e0 mm/truncate.c:387
 xfs_flush_unmap_range+0xb8/0xd0 fs/xfs/xfs_bmap_util.c:820
 xfs_reflink_remap_prep+0x5fe/0x720
 xfs_file_remap_range+0x287/0x910 fs/xfs/xfs_file.c:1210
 vfs_copy_file_range+0xc07/0x14f0 fs/read_write.c:1584
 __do_sys_copy_file_range fs/read_write.c:1670 [inline]
 __se_sys_copy_file_range+0x3fa/0x600 fs/read_write.c:1637
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
------------[ cut here ]------------
kernel BUG at ./include/linux/mm.h:1153!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 1129 Comm: kworker/u4:9 Not tainted 6.14.0-rc3-syzkaller-00096-ge9a8cac0bf89 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: loop0 loop_workfn
RIP: 0010:put_page_testzero include/linux/mm.h:1153 [inline]
RIP: 0010:folio_put_testzero include/linux/mm.h:1159 [inline]
RIP: 0010:folio_put include/linux/mm.h:1488 [inline]
RIP: 0010:folio_end_writeback+0x603/0x650 mm/filemap.c:1655
Code: 31 c7 ff 4c 89 ef 48 c7 c6 c0 da 33 8c e8 05 cf 11 00 90 0f 0b e8 7d 31 c7 ff 4c 89 ef 48 c7 c6 00 da 33 8c e8 ee ce 11 00 90 <0f> 0b e8 66 31 c7 ff 4c 89 ef 48 c7 c6 40 d7 33 8c e8 d7 ce 11 00
RSP: 0018:ffffc90002827430 EFLAGS: 00010246
RAX: 5e09aeff1c54c500 RBX: 0000000000000000 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffffff8c2aa440 RDI: 0000000000000001
RBP: dffffc0000000000 R08: ffffffff94546947 R09: 1ffffffff28a8d28
R10: dffffc0000000000 R11: fffffbfff28a8d29 R12: 0000000000000000
R13: ffffea0001580000 R14: 1ffffd40002b0000 R15: ffffea0001580034
FS:  0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000400000000180 CR3: 0000000051c74000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 iomap_finish_folio_write fs/iomap/buffered-io.c:1533 [inline]
 iomap_finish_ioend+0x462/0x6b0 fs/iomap/buffered-io.c:1561
 blk_update_request+0x5e5/0x1160 block/blk-mq.c:983
 blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1145
 loop_handle_cmd drivers/block/loop.c:1946 [inline]
 loop_process_work+0x1bc8/0x21c0 drivers/block/loop.c:1964
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3317
 worker_thread+0x870/0xd30 kernel/workqueue.c:3398
 kthread+0x7a9/0x920 kernel/kthread.c:464
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:put_page_testzero include/linux/mm.h:1153 [inline]
RIP: 0010:folio_put_testzero include/linux/mm.h:1159 [inline]
RIP: 0010:folio_put include/linux/mm.h:1488 [inline]
RIP: 0010:folio_end_writeback+0x603/0x650 mm/filemap.c:1655
Code: 31 c7 ff 4c 89 ef 48 c7 c6 c0 da 33 8c e8 05 cf 11 00 90 0f 0b e8 7d 31 c7 ff 4c 89 ef 48 c7 c6 00 da 33 8c e8 ee ce 11 00 90 <0f> 0b e8 66 31 c7 ff 4c 89 ef 48 c7 c6 40 d7 33 8c e8 d7 ce 11 00
RSP: 0018:ffffc90002827430 EFLAGS: 00010246
RAX: 5e09aeff1c54c500 RBX: 0000000000000000 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffffff8c2aa440 RDI: 0000000000000001
RBP: dffffc0000000000 R08: ffffffff94546947 R09: 1ffffffff28a8d28
R10: dffffc0000000000 R11: fffffbfff28a8d29 R12: 0000000000000000
R13: ffffea0001580000 R14: 1ffffd40002b0000 R15: ffffea0001580034
FS:  0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000400000000180 CR3: 0000000011ff8000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/20 22:15 upstream e9a8cac0bf89 0808a665 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in folio_end_writeback
2025/02/09 22:09 upstream 69b54314c975 ef44b750 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in folio_end_writeback
* Struck through repros no longer work on HEAD.