syzbot


KASAN: use-after-free Read in iomap_read_inline_data (2)

Status: moderation: reported on 2025/11/12 18:44
Subsystems: gfs2
[Documentation on labels]
Reported-by: syzbot+2e05261efde0f86b80c8@syzkaller.appspotmail.com
First crash: 19d, last: 11d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in iomap_read_inline_data iomap 19 1 431d 426d 0/29 auto-obsoleted due to no activity on 2024/12/31 10:38

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in folio_fill_tail include/linux/highmem.h:598 [inline]
BUG: KASAN: use-after-free in iomap_read_inline_data+0x6dd/0xbb0 fs/iomap/buffered-io.c:318
Read of size 280 at addr ffff88800037d8e8 by task syz.0.0/5319

CPU: 0 UID: 0 PID: 5319 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~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200
 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105
 folio_fill_tail include/linux/highmem.h:598 [inline]
 iomap_read_inline_data+0x6dd/0xbb0 fs/iomap/buffered-io.c:318
 iomap_write_begin_inline fs/iomap/buffered-io.c:805 [inline]
 iomap_write_begin+0xa05/0x1c70 fs/iomap/buffered-io.c:858
 iomap_write_iter fs/iomap/buffered-io.c:990 [inline]
 iomap_file_buffered_write+0x441/0x9b0 fs/iomap/buffered-io.c:1071
 gfs2_file_buffered_write+0x4ed/0x880 fs/gfs2/file.c:1061
 gfs2_file_write_iter+0xbc6/0x1100 fs/gfs2/file.c:1141
 iter_file_splice_write+0x975/0x10e0 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+0x5a8/0xcc0 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x181/0x270 fs/splice.c:1230
 do_sendfile+0x4da/0x7e0 fs/read_write.c:1370
 __do_sys_sendfile64 fs/read_write.c:1431 [inline]
 __se_sys_sendfile64+0x13e/0x190 fs/read_write.c:1417
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f104538f6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1046146038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f10455e5fa0 RCX: 00007f104538f6c9
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000008
RBP: 00007f1045411f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0001000200201005 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f10455e6038 R14: 00007f10455e5fa0 R15: 00007fffbef86178
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x928 pfn:0x37d
flags: 0x7ff00000000000(node=0|zone=0|lastcpupid=0x7ff)
page_type: f0(buddy)
raw: 007ff00000000000 ffffea000000a988 ffff88802fffb580 0000000000000000
raw: 0000000000000928 0000000000000000 00000000f0000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x48c40(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP), pid 5319, tgid 5318 (syz.0.0), ts 70005046967, free_ts 70006937541
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline]
 alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507
 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2517
 filemap_alloc_folio_noprof+0xdf/0x470 mm/filemap.c:1020
 __filemap_get_folio+0x3f2/0xaf0 mm/filemap.c:2012
 gfs2_getbuf+0x17e/0x6d0 fs/gfs2/meta_io.c:144
 gfs2_meta_read+0x1df/0x980 fs/gfs2/meta_io.c:272
 gfs2_meta_buffer+0x10f/0x2e0 fs/gfs2/meta_io.c:498
 gfs2_meta_inode_buffer fs/gfs2/meta_io.h:70 [inline]
 __gfs2_iomap_get+0x197/0x13d0 fs/gfs2/bmap.c:861
 gfs2_iomap_begin+0x1fd/0x11c0 fs/gfs2/bmap.c:1109
 iomap_iter+0x534/0xde0 fs/iomap/iter.c:108
 __iomap_dio_rw+0xc57/0x1e50 fs/iomap/direct-io.c:731
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:821
page last free pid 75 tgid 75 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1394 [inline]
 free_unref_folios+0xdb3/0x14f0 mm/page_alloc.c:2963
 shrink_folio_list+0x44ab/0x4c70 mm/vmscan.c:1638
 evict_folios+0x471e/0x57c0 mm/vmscan.c:4745
 try_to_shrink_lruvec+0x8a3/0xb50 mm/vmscan.c:4908
 shrink_one+0x21b/0x7c0 mm/vmscan.c:4953
 shrink_many mm/vmscan.c:5016 [inline]
 lru_gen_shrink_node mm/vmscan.c:5094 [inline]
 shrink_node+0x315d/0x3780 mm/vmscan.c:6081
 kswapd_shrink_node mm/vmscan.c:6941 [inline]
 balance_pgdat mm/vmscan.c:7124 [inline]
 kswapd+0x147c/0x2800 mm/vmscan.c:7389
 kthread+0x711/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff88800037d780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88800037d800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88800037d880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                          ^
 ffff88800037d900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88800037d980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/16 08:51 upstream f824272b6e3f f7988ea4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in iomap_read_inline_data
2025/11/15 22:16 upstream f824272b6e3f f7988ea4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in iomap_read_inline_data
2025/11/08 18:36 upstream e811c33b1f13 4e1406b4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in iomap_read_inline_data
* Struck through repros no longer work on HEAD.