syzbot


KASAN: use-after-free Write in iomap_write_end

Status: upstream: reported on 2026/01/30 05:14
Subsystems: iomap
[Documentation on labels]
Reported-by: syzbot+ea1cd4aa4d1e98458a55@syzkaller.appspotmail.com
First crash: 16d, last: 4h42m
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] gfs2: Fix use-after-free in iomap inline data write path 1 (1) 2026/01/30 09:21
[syzbot] [iomap?] KASAN: use-after-free Write in iomap_write_end 0 (1) 2026/01/30 05:14

Sample crash report:
loop0: detected capacity change from 0 to 32768
gfs2: fsid=syz:syz: Trying to join cluster "lock_nolock", "syz:syz"
gfs2: fsid=syz:syz: Now mounting FS (format 1801)...
gfs2: fsid=syz:syz.0: journal 0 mapped with 1 extents in 0ms
gfs2: fsid=syz:syz.0: first mount done, others may mount
==================================================================
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 ffff888012eb7902 by task syz.0.0/5322

CPU: 0 UID: 0 PID: 5322 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:0x7f224299aeb9
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:00007f2243773028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f2242c15fa0 RCX: 00007f224299aeb9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00007f2242a08c1f R08: 0000000000000000 R09: 0000000000000000
R10: 000000007ffff004 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2242c16038 R14: 00007f2242c15fa0 R15: 00007ffeffb7adf8
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x92c pfn:0x12eb7
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00004baa88 ffffea0000456408 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 5322, tgid 5321 (syz.0.0), ts 77207646290, free_ts 77246897233
 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_read+0x109/0x8d0 fs/gfs2/meta_io.c:271
 gfs2_meta_buffer+0x10f/0x2e0 fs/gfs2/meta_io.c:495
 gfs2_meta_inode_buffer fs/gfs2/meta_io.h:70 [inline]
 __gfs2_iomap_get+0x193/0x1840 fs/gfs2/bmap.c:861
 gfs2_iomap_begin+0x219/0x11e0 fs/gfs2/bmap.c:1109
 iomap_iter+0x600/0xf30 fs/iomap/iter.c:110
 __iomap_dio_rw+0xcc4/0x1e10 fs/iomap/direct-io.c:752
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:847
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:
 ffff888012eb7800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888012eb7880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888012eb7900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888012eb7980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888012eb7a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/30 05:16 upstream 4d310797262f bfa73b7b .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/30 05:13 upstream 4d310797262f bfa73b7b .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/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.