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

Status: upstream: reported C repro on 2025/08/21 12:20
Subsystems: xfs
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+4e6ee73c0ae4b6e8753f@syzkaller.appspotmail.com
First crash: 359d, last: 89d
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
  
Fix bisection: failed (error log, bisect log)
  
✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
a4a679f2 assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ✅ NetworkTrigger: ❌ PeripheralTrigger: ✅ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ✅ KASAN: slab-use-after-free Write in xlog_cil_committed 2026/05/30 09:34 2026/05/30 09:34 2026/05/30 10:35 6b4a8443
07c262ac assessment-security 💥 KASAN: slab-use-after-free Write in xlog_cil_committed 2026/05/14 09:22 2026/05/14 09:22 2026/05/14 09:25 6ccb967e
Discussions (5)
Title Replies (including bot) Last reply
[PATCH] xfs: add guard before freeing buffer log item 4 (4) 2026/08/05 01:44
[syzbot] [xfs?] KASAN: slab-use-after-free Write in xlog_cil_committed 1 (3) 2026/07/31 05:18
[syzbot] Monthly xfs report (May 2026) 0 (1) 2026/05/11 04:32
[syzbot] Monthly xfs report (Jan 2026) 0 (1) 2026/01/30 10:09
[syzbot] Monthly xfs report (Nov 2025) 0 (1) 2025/11/28 21:21
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 1140d 1239d 0/3 auto-obsoleted due to no activity on 2023/09/12 13:46
Last patch testing requests (11)
Created Duration User Patch Repo Result
2026/08/02 14:10 29m retest repro upstream no crash log
2026/07/31 05:18 28m marcelomspessoto@gmail.com patch https://github.com/torvalds/linux.git master OK log
2026/05/05 15:11 20m retest repro upstream report log
2026/02/02 13:25 25m retest repro linux-next no crash log
2026/02/01 12:17 31m retest repro linux-next no crash log
2026/02/01 12:06 30m retest repro linux-next no crash log
2026/01/17 22:36 15m retest repro upstream report log
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:
==================================================================
BUG: KASA[  132.592877][ T1379] BUG: KASAN: slab-use-after-free in instrument_atomic_write include/linux/instrumented.h:97 [inline]
BUG: KASA[  132.592877][ T1379] BUG: KASAN: slab-use-after-free in set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
BUG: KASA[  132.592877][ T1379] BUG: KASAN: slab-use-after-free in xlog_cil_ail_insert fs/xfs/xfs_log_cil.c:889 [inline]
BUG: KASA[  132.592877][ T1379] BUG: KASAN: slab-use-after-free in xlog_cil_committed+0x4d5/0x1150 fs/xfs/xfs_log_cil.c:995
Write of size 8 at addr ffff88802c216580 by task kworker/u8:10/1379

CPU: 1 UID: 0 PID: 1379 Comm: kworker/u8:10 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Workqueue: xfs-cil/loop4 xlog_cil_push_work
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description+0x55/0x1e0 mm/kasan/report.c:378
 print_report+0x58/0x70 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
 instrument_atomic_write include/linux/instrumented.h:97 [inline]
 set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
 xlog_cil_ail_insert fs/xfs/xfs_log_cil.c:889 [inline]
 xlog_cil_committed+0x4d5/0x1150 fs/xfs/xfs_log_cil.c:995
 xlog_cil_push_work+0x256b/0x2b10 fs/xfs/xfs_log_cil.c:1607
 process_one_work kernel/workqueue.c:3314 [inline]
 process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3397
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3478
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Allocated by task 6145:
 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:4569 [inline]
 slab_alloc_node mm/slub.c:4898 [inline]
 kmem_cache_alloc_noprof+0x33b/0x680 mm/slub.c:4905
 xfs_buf_item_init+0x6a/0x6d0 fs/xfs/xfs_buf_item.c:873
 _xfs_trans_bjoin+0x46/0x110 fs/xfs/xfs_trans_buf.c:75
 xfs_trans_read_buf_map+0x294/0x8f0 fs/xfs/xfs_trans_buf.c:325
 xfs_trans_read_buf fs/xfs/xfs_trans.h:212 [inline]
 xfs_btree_read_buf_block+0x2b0/0x490 fs/xfs/libxfs/xfs_btree.c:1402
 xfs_btree_lookup_get_block+0x297/0x510 fs/xfs/libxfs/xfs_btree.c:1907
 xfs_btree_lookup+0x45a/0x1350 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+0x219/0xd30 fs/xfs/libxfs/xfs_alloc.c:626
 xfs_alloc_cur_finish+0xd5/0x4a0 fs/xfs/libxfs/xfs_alloc.c:1117
 xfs_alloc_ag_vextent_near+0xd70/0x1280 fs/xfs/libxfs/xfs_alloc.c:1776
 xfs_alloc_vextent_iterate_ags+0x640/0x950 fs/xfs/libxfs/xfs_alloc.c:3764
 xfs_alloc_vextent_start_ag+0x378/0x850 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+0x17c1/0x2da0 fs/xfs/libxfs/xfs_bmap.c:3938
 xfs_bmapi_write+0x843/0x1330 fs/xfs/libxfs/xfs_bmap.c:4267
 xfs_iomap_write_direct+0x3ba/0x6b0 fs/xfs/xfs_iomap.c:338
 xfs_direct_write_iomap_begin+0xfbf/0x1410 fs/xfs/xfs_iomap.c:1012
 iomap_iter+0x600/0xf90 fs/iomap/iter.c:110
 __iomap_dio_rw+0xcda/0x1e40 fs/iomap/direct-io.c:806
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:901
 xfs_file_dio_write_aligned+0x3bc/0x4a0 fs/xfs/xfs_file.c:780
 xfs_file_dio_write fs/xfs/xfs_file.c:989 [inline]
 xfs_file_write_iter+0x7ea/0x920 fs/xfs/xfs_file.c:1201
 iter_file_splice_write+0x9a6/0x10f0 fs/splice.c:736
 do_splice_from fs/splice.c:936 [inline]
 direct_splice_actor+0x104/0x160 fs/splice.c:1159
 splice_direct_to_actor+0x545/0xc80 fs/splice.c:1103
 do_splice_direct_actor fs/splice.c:1202 [inline]
 do_splice_direct+0x19b/0x2a0 fs/splice.c:1228
 do_sendfile+0x547/0x7e0 fs/read_write.c:1372
 __do_sys_sendfile64 fs/read_write.c:1433 [inline]
 __se_sys_sendfile64+0x144/0x1a0 fs/read_write.c:1419
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6145:
 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:2689 [inline]
 slab_free mm/slub.c:6250 [inline]
 kmem_cache_free+0x187/0x6c0 mm/slub.c:6377
 __xfs_buf_ioend+0x292/0x6f0 fs/xfs/xfs_buf.c:1109
 xfs_buf_iowait+0x156/0x480 fs/xfs/xfs_buf.c:1293
 _xfs_buf_read fs/xfs/xfs_buf.c:597 [inline]
 xfs_buf_read_map+0x32d/0xa20 fs/xfs/xfs_buf.c:663
 xfs_trans_read_buf_map+0x1db/0x8f0 fs/xfs/xfs_trans_buf.c:304
 xfs_trans_read_buf fs/xfs/xfs_trans.h:212 [inline]
 xfs_btree_read_buf_block+0x2b0/0x490 fs/xfs/libxfs/xfs_btree.c:1402
 xfs_btree_lookup_get_block+0x297/0x510 fs/xfs/libxfs/xfs_btree.c:1907
 xfs_btree_lookup+0x45a/0x1350 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+0x219/0xd30 fs/xfs/libxfs/xfs_alloc.c:626
 xfs_alloc_cur_finish+0xd5/0x4a0 fs/xfs/libxfs/xfs_alloc.c:1117
 xfs_alloc_ag_vextent_near+0xd70/0x1280 fs/xfs/libxfs/xfs_alloc.c:1776
 xfs_alloc_vextent_iterate_ags+0x640/0x950 fs/xfs/libxfs/xfs_alloc.c:3764
 xfs_alloc_vextent_start_ag+0x378/0x850 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+0x17c1/0x2da0 fs/xfs/libxfs/xfs_bmap.c:3938
 xfs_bmapi_write+0x843/0x1330 fs/xfs/libxfs/xfs_bmap.c:4267
 xfs_iomap_write_direct+0x3ba/0x6b0 fs/xfs/xfs_iomap.c:338
 xfs_direct_write_iomap_begin+0xfbf/0x1410 fs/xfs/xfs_iomap.c:1012
 iomap_iter+0x600/0xf90 fs/iomap/iter.c:110
 __iomap_dio_rw+0xcda/0x1e40 fs/iomap/direct-io.c:806
 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:901
 xfs_file_dio_write_aligned+0x3bc/0x4a0 fs/xfs/xfs_file.c:780
 xfs_file_dio_write fs/xfs/xfs_file.c:989 [inline]
 xfs_file_write_iter+0x7ea/0x920 fs/xfs/xfs_file.c:1201
 iter_file_splice_write+0x9a6/0x10f0 fs/splice.c:736
 do_splice_from fs/splice.c:936 [inline]
 direct_splice_actor+0x104/0x160 fs/splice.c:1159
 splice_direct_to_actor+0x545/0xc80 fs/splice.c:1103
 do_splice_direct_actor fs/splice.c:1202 [inline]
 do_splice_direct+0x19b/0x2a0 fs/splice.c:1228
 do_sendfile+0x547/0x7e0 fs/read_write.c:1372
 __do_sys_sendfile64 fs/read_write.c:1433 [inline]
 __se_sys_sendfile64+0x144/0x1a0 fs/read_write.c:1419
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802c216e70 pfn:0x2c216
flags: 0x80000000000200(workingset|node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000200 ffff888140af6780 ffff88801f730088 ffffea0000e14750
raw: ffff88802c216e70 00000008000c000b 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 0xd2c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5903, tgid 5902 (syz.1.23), ts 106987867624, free_ts 106874706579
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x231/0x280 mm/page_alloc.c:1858
 prep_new_page mm/page_alloc.c:1866 [inline]
 get_page_from_freelist+0x27c8/0x2840 mm/page_alloc.c:3946
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5226
 alloc_slab_page mm/slub.c:3278 [inline]
 allocate_slab+0x77/0x660 mm/slub.c:3467
 new_slab mm/slub.c:3525 [inline]
 refill_objects+0x33c/0x3d0 mm/slub.c:7255
 refill_sheaf mm/slub.c:2816 [inline]
 __pcs_replace_empty_main+0x373/0x720 mm/slub.c:4651
 alloc_from_pcs mm/slub.c:4749 [inline]
 slab_alloc_node mm/slub.c:4883 [inline]
 kmem_cache_alloc_noprof+0x433/0x680 mm/slub.c:4905
 xfs_buf_item_init+0x6a/0x6d0 fs/xfs/xfs_buf_item.c:873
 _xfs_trans_bjoin+0x46/0x110 fs/xfs/xfs_trans_buf.c:75
 xfs_trans_read_buf_map+0x294/0x8f0 fs/xfs/xfs_trans_buf.c:325
 xfs_trans_read_buf fs/xfs/xfs_trans.h:212 [inline]
 xfs_imap_to_bp+0x12a/0x2d0 fs/xfs/libxfs/xfs_inode_buf.c:139
 xfs_inode_item_precommit+0x737/0xb70 fs/xfs/xfs_inode_item.c:170
 xfs_trans_run_precommits fs/xfs/xfs_trans.c:798 [inline]
 __xfs_trans_commit+0x2ec/0xbf0 fs/xfs/xfs_trans.c:841
 xfs_trans_commit+0x13e/0x1c0 fs/xfs/xfs_trans.c:926
 xfs_vn_update_time+0x393/0x570 fs/xfs/xfs_iops.c:1210
 touch_atime+0x2f8/0x6b0 fs/inode.c:2265
page last free pid 5599 tgid 5599 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1402 [inline]
 __free_frozen_pages+0xfa6/0x10f0 mm/page_alloc.c:2943
 __slab_free+0x252/0x2a0 mm/slub.c:5612
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4569 [inline]
 slab_alloc_node mm/slub.c:4898 [inline]
 kmem_cache_alloc_noprof+0x33b/0x680 mm/slub.c:4905
 alloc_filename fs/namei.c:142 [inline]
 do_getname+0x2e/0x250 fs/namei.c:182
 getname_flags fs/namei.c:225 [inline]
 getname include/linux/fs.h:2526 [inline]
 class_filename_constructor include/linux/fs.h:2553 [inline]
 __do_sys_unlink fs/namei.c:5602 [inline]
 __se_sys_unlink+0x1e/0x140 fs/namei.c:5600
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88802c216480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802c216500: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff88802c216580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88802c216600: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
 ffff88802c216680: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/05/15 02:20 upstream 66182ca873a4 6ccb967e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/05/11 04:16 upstream aa54b1d27fe0 29233ece .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/05/11 04:06 upstream aa54b1d27fe0 29233ece .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/05/11 04:04 upstream aa54b1d27fe0 29233ece .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-use-after-free Write in xlog_cil_committed
2026/05/11 03:59 upstream aa54b1d27fe0 29233ece .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 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
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 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
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.