syzbot


KASAN: use-after-free Write in iomap_write_end

Status: moderation: reported on 2026/01/18 00:32
Subsystems: iomap
[Documentation on labels]
Reported-by: syzbot+cc9aa8793ada0bccc25c@syzkaller.appspotmail.com
First crash: 15d, last: 1d07h

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in iomap_write_end_inline fs/iomap/buffered-io.c:1032 [inline]
BUG: KASAN: use-after-free in iomap_write_end+0x390/0x720 fs/iomap/buffered-io.c:1050
Write of size 1 at addr ffff888012f6e9d3 by task syz.0.0/5329

CPU: 0 UID: 0 PID: 5329 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xba/0x230 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200
 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106
 iomap_write_end_inline fs/iomap/buffered-io.c:1032 [inline]
 iomap_write_end+0x390/0x720 fs/iomap/buffered-io.c:1050
 iomap_write_iter fs/iomap/buffered-io.c:1123 [inline]
 iomap_file_buffered_write+0x52b/0xb30 fs/iomap/buffered-io.c:1189
 gfs2_file_buffered_write+0x4eb/0x870 fs/gfs2/file.c:1061
 gfs2_file_write_iter+0x976/0x1130 fs/gfs2/file.c:1166
 iter_file_splice_write+0x99b/0x1100 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x101/0x160 fs/splice.c:1161
 splice_direct_to_actor+0x53a/0xc70 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x195/0x290 fs/splice.c:1230
 do_sendfile+0x535/0x7d0 fs/read_write.c:1370
 __do_sys_sendfile64 fs/read_write.c:1431 [inline]
 __se_sys_sendfile64+0x144/0x1a0 fs/read_write.c:1417
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc4ced9aeb9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc4cfbdb028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fc4cf016090 RCX: 00007fc4ced9aeb9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00007fc4cee08c1f R08: 0000000000000000 R09: 0000000000000000
R10: 000000007ffff004 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc4cf016128 R14: 00007fc4cf016090 R15: 00007fffd5e0d898
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x92c pfn:0x12f6e
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffff88801fc40bb0 ffff88801fc40bb0 0000000000000000
raw: 000000000000092c 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x148c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_MOVABLE|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 5328, tgid 5327 (syz.0.0), ts 85639084534, free_ts 86753680493
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x228/0x280 mm/page_alloc.c:1884
 prep_new_page mm/page_alloc.c:1892 [inline]
 get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3945
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5240
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486
 alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline]
 alloc_pages_noprof+0xa8/0x190 mm/mempolicy.c:2577
 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2587
 filemap_alloc_folio_noprof+0x111/0x470 mm/filemap.c:1013
 __filemap_get_folio_mpol+0x3fc/0xb00 mm/filemap.c:2006
 __filemap_get_folio include/linux/pagemap.h:774 [inline]
 gfs2_getbuf+0x186/0x6d0 fs/gfs2/meta_io.c:144
 gfs2_meta_new+0x31/0x160 fs/gfs2/meta_io.c:196
 init_dinode+0x75/0xa70 fs/gfs2/inode.c:580
 gfs2_create_inode+0x115a/0x1630 fs/gfs2/inode.c:863
 gfs2_atomic_open+0x116/0x200 fs/gfs2/inode.c:1402
 atomic_open fs/namei.c:4304 [inline]
 lookup_open fs/namei.c:4415 [inline]
 open_last_lookups fs/namei.c:4549 [inline]
 path_openat+0x121a/0x3e20 fs/namei.c:4793
 do_filp_open+0x22d/0x490 fs/namei.c:4823
 do_sys_openat2+0x12f/0x220 fs/open.c:1430
page last free pid 74 tgid 74 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1433 [inline]
 free_unref_folios+0xdce/0x1510 mm/page_alloc.c:3030
 shrink_folio_list+0x4930/0x5160 mm/vmscan.c:1603
 evict_folios+0x4795/0x5880 mm/vmscan.c:4711
 try_to_shrink_lruvec+0x88b/0xb20 mm/vmscan.c:4874
 shrink_one+0x25c/0x710 mm/vmscan.c:4919
 shrink_many mm/vmscan.c:4982 [inline]
 lru_gen_shrink_node mm/vmscan.c:5060 [inline]
 shrink_node+0x2f8b/0x35f0 mm/vmscan.c:6047
 kswapd_shrink_node mm/vmscan.c:6901 [inline]
 balance_pgdat mm/vmscan.c:7084 [inline]
 kswapd+0x144c/0x2800 mm/vmscan.c:7354
 kthread+0x726/0x8b0 kernel/kthread.c:463
 ret_from_fork+0x51b/0xa40 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

Memory state around the buggy address:
 ffff888012f6e880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888012f6e900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888012f6e980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                 ^
 ffff888012f6ea00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888012f6ea80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/28 09:59 upstream 1f97d9dcf536 3029c699 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Write in iomap_write_end
2026/01/27 07:16 upstream fcb70a56f4d8 efb3e894 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Write in iomap_write_end
2026/01/27 00:08 upstream fcb70a56f4d8 efb3e894 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Write in iomap_write_end
2026/01/14 00:22 upstream 54e82e93ca93 d1b870e1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Write in iomap_write_end
* Struck through repros no longer work on HEAD.