syzbot


KASAN: slab-use-after-free Write in xlog_cil_committed

Status: upstream: reported C repro on 2025/08/21 12:20
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+4e6ee73c0ae4b6e8753f@syzkaller.appspotmail.com
First crash: 148d, last: 11d
Cause bisection: introduced by (bisect log) :
commit d2fe5c4c8d25999862d615f616aea7befdd62799
Author: Dave Chinner <dchinner@redhat.com>
Date: Wed Jun 25 22:48:58 2025 +0000

  xfs: rearrange code in xfs_buf_item.c

Crash: KASAN: slab-use-after-free Write in xlog_cil_committed (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly xfs report (Nov 2025) 0 (1) 2025/11/28 21:21
[syzbot] [xfs?] KASAN: slab-use-after-free Write in xlog_cil_committed 1 (2) 2025/08/26 01:24
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in xlog_cil_committed 19 syz 19 929d 1028d 0/3 auto-obsoleted due to no activity on 2023/09/12 13:46
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/11/24 08:51 28m retest repro linux-next report log
2025/11/10 02:38 1h21m retest repro linux-next report log
2025/09/01 01:01 16m retest repro linux-next error
2025/09/01 01:01 59m retest repro linux-next error

Sample crash report:
XFS (loop0): Metadata corruption detected at xfs_btree_lo[  161.273624][ T7130] XFS (loop0): Metadata corruption detected at xfs_btree_lookup_get_block+0x3c5/0x500 fs/xfs/libxfs/xfs_btree.c:1927, xfs_bnobt block 0x8
XFS (loop0): Unmount and run xfs_repair
XFS (loop0): User initiated shutdown received.
==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_write include/linux/instrumented.h:82 [inline]
BUG: KASAN: slab-use-after-free in set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
BUG: KASAN: slab-use-after-free in xlog_cil_ail_insert fs/xfs/xfs_log_cil.c:791 [inline]
BUG: KASAN: slab-use-after-free in xlog_cil_committed+0x454/0x1020 fs/xfs/xfs_log_cil.c:897
Write of size 8 at addr ffff8880347c72e0 by task syz.0.108/7130

CPU: 0 UID: 0 PID: 7130 Comm: syz.0.108 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 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
 instrument_atomic_write include/linux/instrumented.h:82 [inline]
 set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
 xlog_cil_ail_insert fs/xfs/xfs_log_cil.c:791 [inline]
 xlog_cil_committed+0x454/0x1020 fs/xfs/xfs_log_cil.c:897
 xlog_cil_process_committed+0x15c/0x1b0 fs/xfs/xfs_log_cil.c:927
 xlog_state_shutdown_callbacks+0x269/0x360 fs/xfs/xfs_log.c:488
 xlog_force_shutdown+0x332/0x400 fs/xfs/xfs_log.c:3472
 xfs_do_force_shutdown+0x283/0x620 fs/xfs/xfs_fsops.c:517
 xfs_fs_goingdown+0x71/0x150 fs/xfs/xfs_fsops.c:-1
 xfs_file_ioctl+0x11a6/0x17f0 fs/xfs/xfs_ioctl.c:1371
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xff/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f216fcaf749
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:00007f216f2fd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f216ff06090 RCX: 00007f216fcaf749
RDX: 0000200000000080 RSI: 000000008004587d RDI: 0000000000000006
RBP: 00007f216fd33f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f216ff06128 R14: 00007f216ff06090 R15: 00007ffcdd384308
 </TASK>

Allocated by task 7121:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 unpoison_slab_object mm/kasan/common.c:340 [inline]
 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4953 [inline]
 slab_alloc_node mm/slub.c:5263 [inline]
 kmem_cache_alloc_noprof+0x18d/0x6c0 mm/slub.c:5270
 xfs_buf_item_init+0x6a/0x6d0 fs/xfs/xfs_buf_item.c:878
 _xfs_trans_bjoin+0x46/0x110 fs/xfs/xfs_trans_buf.c:75
 xfs_trans_read_buf_map+0x28f/0x8a0 fs/xfs/xfs_trans_buf.c:325
 xfs_trans_read_buf fs/xfs/xfs_trans.h:210 [inline]
 xfs_btree_read_buf_block+0x290/0x470 fs/xfs/libxfs/xfs_btree.c:1402
 xfs_btree_lookup_get_block+0x28d/0x500 fs/xfs/libxfs/xfs_btree.c:1907
 xfs_btree_lookup+0x4e1/0x1410 fs/xfs/libxfs/xfs_btree.c:2018
 xfs_alloc_lookup fs/xfs/libxfs/xfs_alloc.c:166 [inline]
 xfs_alloc_lookup_eq fs/xfs/libxfs/xfs_alloc.c:184 [inline]
 xfs_alloc_fixup_trees+0x21b/0xd20 fs/xfs/libxfs/xfs_alloc.c:626
 xfs_alloc_cur_finish+0xd5/0x480 fs/xfs/libxfs/xfs_alloc.c:1117
 xfs_alloc_ag_vextent_near+0xd0d/0x11d0 fs/xfs/libxfs/xfs_alloc.c:1776
 xfs_alloc_vextent_iterate_ags+0x620/0x910 fs/xfs/libxfs/xfs_alloc.c:3764
 xfs_alloc_vextent_start_ag+0x378/0x830 fs/xfs/libxfs/xfs_alloc.c:3839
 xfs_bmap_btalloc_best_length fs/xfs/libxfs/xfs_bmap.c:3619 [inline]
 xfs_bmap_btalloc fs/xfs/libxfs/xfs_bmap.c:3663 [inline]
 xfs_bmapi_allocate+0x1891/0x2e10 fs/xfs/libxfs/xfs_bmap.c:3938
 xfs_bmapi_write+0x7df/0x1260 fs/xfs/libxfs/xfs_bmap.c:4267
 xfs_iomap_write_direct+0x3b2/0x6b0 fs/xfs/xfs_iomap.c:335
 xfs_direct_write_iomap_begin+0xfa3/0x13e0 fs/xfs/xfs_iomap.c:1009
 iomap_iter+0x5ef/0xeb0 fs/iomap/iter.c:110
 __iomap_dio_rw+0x12d2/0x1d90 fs/iomap/direct-io.c:752
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:847
 xfs_file_dio_write_aligned+0x182/0x1e0 fs/xfs/xfs_file.c:707
 xfs_file_dio_write fs/xfs/xfs_file.c:910 [inline]
 xfs_file_write_iter+0x7ea/0x920 fs/xfs/xfs_file.c:1122
 iter_file_splice_write+0x977/0x10b0 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x104/0x160 fs/splice.c:1161
 splice_direct_to_actor+0x5b3/0xcd0 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x187/0x270 fs/splice.c:1230
 do_sendfile+0x4ec/0x7f0 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+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 7121:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2540 [inline]
 slab_free mm/slub.c:6670 [inline]
 kmem_cache_free+0x18f/0x8d0 mm/slub.c:6781
 __xfs_buf_ioend+0x28c/0x6d0 fs/xfs/xfs_buf.c:1199
 xfs_buf_iowait+0x143/0x440 fs/xfs/xfs_buf.c:1381
 _xfs_buf_read fs/xfs/xfs_buf.c:643 [inline]
 xfs_buf_read_map+0x325/0xa30 fs/xfs/xfs_buf.c:709
 xfs_trans_read_buf_map+0x1d7/0x8a0 fs/xfs/xfs_trans_buf.c:304
 xfs_trans_read_buf fs/xfs/xfs_trans.h:210 [inline]
 xfs_btree_read_buf_block+0x290/0x470 fs/xfs/libxfs/xfs_btree.c:1402
 xfs_btree_lookup_get_block+0x28d/0x500 fs/xfs/libxfs/xfs_btree.c:1907
 xfs_btree_lookup+0x4e1/0x1410 fs/xfs/libxfs/xfs_btree.c:2018
 xfs_alloc_lookup fs/xfs/libxfs/xfs_alloc.c:166 [inline]
 xfs_alloc_lookup_eq fs/xfs/libxfs/xfs_alloc.c:184 [inline]
 xfs_alloc_fixup_trees+0x21b/0xd20 fs/xfs/libxfs/xfs_alloc.c:626
 xfs_alloc_cur_finish+0xd5/0x480 fs/xfs/libxfs/xfs_alloc.c:1117
 xfs_alloc_ag_vextent_near+0xd0d/0x11d0 fs/xfs/libxfs/xfs_alloc.c:1776
 xfs_alloc_vextent_iterate_ags+0x620/0x910 fs/xfs/libxfs/xfs_alloc.c:3764
 xfs_alloc_vextent_start_ag+0x378/0x830 fs/xfs/libxfs/xfs_alloc.c:3839
 xfs_bmap_btalloc_best_length fs/xfs/libxfs/xfs_bmap.c:3619 [inline]
 xfs_bmap_btalloc fs/xfs/libxfs/xfs_bmap.c:3663 [inline]
 xfs_bmapi_allocate+0x1891/0x2e10 fs/xfs/libxfs/xfs_bmap.c:3938
 xfs_bmapi_write+0x7df/0x1260 fs/xfs/libxfs/xfs_bmap.c:4267
 xfs_iomap_write_direct+0x3b2/0x6b0 fs/xfs/xfs_iomap.c:335
 xfs_direct_write_iomap_begin+0xfa3/0x13e0 fs/xfs/xfs_iomap.c:1009
 iomap_iter+0x5ef/0xeb0 fs/iomap/iter.c:110
 __iomap_dio_rw+0xc3d/0x1d90 fs/iomap/direct-io.c:752
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:847
 xfs_file_dio_write_aligned+0x182/0x1e0 fs/xfs/xfs_file.c:707
 xfs_file_dio_write fs/xfs/xfs_file.c:910 [inline]
 xfs_file_write_iter+0x7ea/0x920 fs/xfs/xfs_file.c:1122
 iter_file_splice_write+0x977/0x10b0 fs/splice.c:738
 do_splice_from fs/splice.c:938 [inline]
 direct_splice_actor+0x104/0x160 fs/splice.c:1161
 splice_direct_to_actor+0x5b3/0xcd0 fs/splice.c:1105
 do_splice_direct_actor fs/splice.c:1204 [inline]
 do_splice_direct+0x187/0x270 fs/splice.c:1230
 do_sendfile+0x4ec/0x7f0 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+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff8880347c72a0
 which belongs to the cache xfs_buf_item of size 272
The buggy address is located 64 bytes inside of
 freed 272-byte region [ffff8880347c72a0, ffff8880347c73b0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x347c7
ksm flags: 0x80000000000000(node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000000 ffff8881452fda00 ffffea0000cf9f40 0000000000000003
raw: 0000000000000000 00000000000c000c 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6791, tgid 6790 (syz.0.78), ts 143418631889, free_ts 143416481191
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x234/0x290 mm/page_alloc.c:1857
 prep_new_page mm/page_alloc.c:1865 [inline]
 get_page_from_freelist+0x28c0/0x2960 mm/page_alloc.c:3915
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5210
 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2486
 alloc_slab_page mm/slub.c:3075 [inline]
 allocate_slab+0x86/0x3b0 mm/slub.c:3248
 new_slab mm/slub.c:3302 [inline]
 ___slab_alloc+0xb10/0x13e0 mm/slub.c:4656
 __slab_alloc+0xc6/0x1f0 mm/slub.c:4779
 __slab_alloc_node mm/slub.c:4855 [inline]
 slab_alloc_node mm/slub.c:5251 [inline]
 kmem_cache_alloc_noprof+0x101/0x6c0 mm/slub.c:5270
 xfs_buf_item_init+0x6a/0x6d0 fs/xfs/xfs_buf_item.c:878
 _xfs_trans_bjoin+0x46/0x110 fs/xfs/xfs_trans_buf.c:75
 xfs_trans_read_buf_map+0x28f/0x8a0 fs/xfs/xfs_trans_buf.c:325
 xfs_trans_read_buf fs/xfs/xfs_trans.h:210 [inline]
 xfs_alloc_read_agfl+0x202/0x410 fs/xfs/libxfs/xfs_alloc.c:885
 xfs_alloc_fix_freelist+0xb6f/0x12b0 fs/xfs/libxfs/xfs_alloc.c:2961
 xfs_alloc_vextent_prepare_ag+0xdb/0x600 fs/xfs/libxfs/xfs_alloc.c:3566
 xfs_alloc_vextent_iterate_ags+0x140/0x910 fs/xfs/libxfs/xfs_alloc.c:3750
 xfs_alloc_vextent_start_ag+0x378/0x830 fs/xfs/libxfs/xfs_alloc.c:3839
page last free pid 6790 tgid 6790 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1406 [inline]
 __free_frozen_pages+0xfe1/0x1170 mm/page_alloc.c:2943
 __kasan_populate_vmalloc_do mm/kasan/shadow.c:393 [inline]
 __kasan_populate_vmalloc+0x1b2/0x1d0 mm/kasan/shadow.c:424
 kasan_populate_vmalloc include/linux/kasan.h:580 [inline]
 alloc_vmap_area+0xdc4/0x14e0 mm/vmalloc.c:2124
 __get_vm_area_node+0x227/0x350 mm/vmalloc.c:3219
 __vmalloc_node_range_noprof+0x371/0x16a0 mm/vmalloc.c:4011
 __vmalloc_node_noprof+0xc2/0x110 mm/vmalloc.c:4111
 alloc_thread_stack_node kernel/fork.c:354 [inline]
 dup_task_struct+0x228/0x9a0 kernel/fork.c:923
 copy_process+0x4ea/0x3960 kernel/fork.c:2052
 kernel_clone+0x21d/0x7a0 kernel/fork.c:2651
 __do_sys_clone3 kernel/fork.c:2953 [inline]
 __se_sys_clone3+0x256/0x2d0 kernel/fork.c:2932
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff8880347c7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880347c7200: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff8880347c7280: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff8880347c7300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880347c7380: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/01 23:36 upstream b69053dd3ffb d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2025/08/17 16:06 linux-next 931e46dcbc7e 1804e95e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Write in xlog_cil_committed
2025/08/17 13:55 linux-next 931e46dcbc7e 1804e95e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Write in xlog_cil_committed
2026/01/01 22:03 upstream b69053dd3ffb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/01/01 22:02 upstream b69053dd3ffb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/01/01 21:56 upstream b69053dd3ffb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2025/08/17 12:10 linux-next 931e46dcbc7e 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Write in xlog_cil_committed
2025/08/17 12:09 linux-next 931e46dcbc7e 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Write in xlog_cil_committed
* Struck through repros no longer work on HEAD.