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: 96d, last: 25d
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 535d 740d 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 527d 872d 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:0x55400
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 ffffea0001366948 ffffea0001550048 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_MOVABLE|__GFP_WRITE|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5326, tgid 5325 (syz.0.0), ts 69496729662, free_ts 69531919809
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1718
 prep_new_page mm/page_alloc.c:1726 [inline]
 get_page_from_freelist+0x360a/0x37a0 mm/page_alloc.c:3688
 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4970
 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301
 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline]
 alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2392
 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2402
 filemap_alloc_folio_noprof+0xe4/0x550 mm/filemap.c:1007
 __filemap_get_folio+0x423/0xb40 mm/filemap.c:1969
 iomap_get_folio fs/iomap/buffered-io.c:606 [inline]
 __iomap_get_folio fs/iomap/buffered-io.c:752 [inline]
 iomap_write_begin+0x4f1/0x1a40 fs/iomap/buffered-io.c:795
 iomap_write_iter fs/iomap/buffered-io.c:952 [inline]
 iomap_file_buffered_write+0x77a/0x13c0 fs/iomap/buffered-io.c:1033
 xfs_file_buffered_write+0x24d/0x930 fs/xfs/xfs_file.c:910
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x70f/0xd10 fs/read_write.c:684
 ksys_write+0x19d/0x2d0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5326 tgid 5325 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1262 [inline]
 free_unref_folios+0xe0e/0x17f0 mm/page_alloc.c:2782
 folios_put_refs+0x70a/0x800 mm/swap.c:992
 folio_batch_release include/linux/pagevec.h:101 [inline]
 truncate_inode_pages_range+0xe67/0x10e0 mm/truncate.c:436
 xfs_flush_unmap_range+0xde/0xf0 fs/xfs/xfs_bmap_util.c:836
 xfs_reflink_remap_prep+0x5fe/0x720 fs/xfs/xfs_inode.h:-1
 xfs_file_remap_range+0x28b/0x900 fs/xfs/xfs_file.c:1437
 vfs_copy_file_range+0xe9d/0x1480 fs/read_write.c:1589
 __do_sys_copy_file_range fs/read_write.c:1675 [inline]
 __se_sys_copy_file_range+0x3fe/0x600 fs/read_write.c:1642
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
------------[ cut here ]------------
kernel BUG at ./include/linux/mm.h:1258!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 1035 Comm: kworker/u4:5 Not tainted 6.15.0-rc3-syzkaller-00001-g9d7a0577c9db #0 PREEMPT(full) 
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:1258 [inline]
RIP: 0010:folio_put_testzero include/linux/mm.h:1264 [inline]
RIP: 0010:folio_put include/linux/mm.h:1579 [inline]
RIP: 0010:folio_end_writeback+0x603/0x650 mm/filemap.c:1654
Code: ae c5 ff 4c 89 ef 48 c7 c6 40 12 54 8c e8 b5 07 12 00 90 0f 0b e8 3d ae c5 ff 4c 89 ef 48 c7 c6 40 11 54 8c e8 9e 07 12 00 90 <0f> 0b e8 26 ae c5 ff 4c 89 ef 48 c7 c6 80 0e 54 8c e8 87 07 12 00
RSP: 0018:ffffc90002457450 EFLAGS: 00010246
RAX: d32ee7c8dd3c6f00 RBX: 0000000000000000 RCX: ffffffff93686020
RDX: dffffc0000000000 RSI: ffffffff8e6497f7 RDI: 0000000000000001
RBP: dffffc0000000000 R08: ffffffff905fe577 R09: 1ffffffff20bfcae
R10: dffffc0000000000 R11: fffffbfff20bfcaf R12: 0000000000000000
R13: ffffea0001550000 R14: 1ffffd40002aa000 R15: ffffea0001550034
FS:  0000000000000000(0000) GS:ffff88808c59a000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000000001 CR3: 0000000011d7c000 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:1531 [inline]
 iomap_finish_ioend_buffered+0x480/0x6f0 fs/iomap/buffered-io.c:1558
 blk_update_request+0x5e5/0x1160 block/blk-mq.c:983
 blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1145
 lo_rw_aio_do_completion drivers/block/loop.c:317 [inline]
 lo_rw_aio_complete drivers/block/loop.c:325 [inline]
 lo_rw_aio+0xdfd/0xf80 drivers/block/loop.c:398
 do_req_filebacked drivers/block/loop.c:-1 [inline]
 loop_handle_cmd drivers/block/loop.c:1866 [inline]
 loop_process_work+0x8e3/0x11f0 drivers/block/loop.c:1901
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319
 worker_thread+0x870/0xd50 kernel/workqueue.c:3400
 kthread+0x7b7/0x940 kernel/kthread.c:464
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:put_page_testzero include/linux/mm.h:1258 [inline]
RIP: 0010:folio_put_testzero include/linux/mm.h:1264 [inline]
RIP: 0010:folio_put include/linux/mm.h:1579 [inline]
RIP: 0010:folio_end_writeback+0x603/0x650 mm/filemap.c:1654
Code: ae c5 ff 4c 89 ef 48 c7 c6 40 12 54 8c e8 b5 07 12 00 90 0f 0b e8 3d ae c5 ff 4c 89 ef 48 c7 c6 40 11 54 8c e8 9e 07 12 00 90 <0f> 0b e8 26 ae c5 ff 4c 89 ef 48 c7 c6 80 0e 54 8c e8 87 07 12 00
RSP: 0018:ffffc90002457450 EFLAGS: 00010246
RAX: d32ee7c8dd3c6f00 RBX: 0000000000000000 RCX: ffffffff93686020
RDX: dffffc0000000000 RSI: ffffffff8e6497f7 RDI: 0000000000000001
RBP: dffffc0000000000 R08: ffffffff905fe577 R09: 1ffffffff20bfcae
R10: dffffc0000000000 R11: fffffbfff20bfcaf R12: 0000000000000000
R13: ffffea0001550000 R14: 1ffffd40002aa000 R15: ffffea0001550034
FS:  0000000000000000(0000) GS:ffff88808c59a000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000000001 CR3: 0000000011d7c000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/22 02:07 upstream 9d7a0577c9db 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in folio_end_writeback
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.