syzbot


KASAN: use-after-free Read in xfs_iflush_cluster

Status: upstream: reported C repro on 2023/03/13 14:32
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+e1bb205b7aebac1da91f@syzkaller.appspotmail.com
First crash: 597d, last: 23h08m
Fix commit to backport (bisect log) :
tree: upstream
commit 8027a9ad9b3568c5eb49c968ad6c97f279d76730
Author: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Date: Wed Jan 5 07:47:29 2022 +0000

  drm/imx: imx-ldb: Check for null pointer after calling kmemdup

[report pending]
  
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2023/07/06 linux-5.15.y (ToT) d54cfc420586 C [report] KASAN: use-after-free Read in xfs_iflush_cluster
2023/05/19 upstream (ToT) 2d1bcbc6cd70 C [report] WARNING: ODEBUG bug in netdev_run_todo
2023/07/06 upstream (ToT) a452483508d7 C Didn't crash
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/10/14 14:51 7h36m fix candidate upstream OK (1) job log
2023/09/18 21:36 0m bisect fix linux-5.15.y error job log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in xfs_iflush_cluster+0xad/0x12a0
Read of size 8 at addr ffff88806b238a50 by task xfsaild/loop0/4942

CPU: 0 PID: 4942 Comm: xfsaild/loop0 Not tainted 5.15.162-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 xfs_iflush_cluster+0xad/0x12a0
 xfs_inode_item_push+0x1cd/0x2c0 fs/xfs/xfs_inode_item.c:567
 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline]
 xfsaild_push fs/xfs/xfs_trans_ail.c:472 [inline]
 xfsaild+0xd6d/0x2970 fs/xfs/xfs_trans_ail.c:657
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
 </TASK>

Allocated by task 4900:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:675
 xfs_trans_ijoin+0xb6/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_init_new_inode+0xd8c/0x1100 fs/xfs/xfs_inode.c:918
 xfs_create+0x9b1/0x1370 fs/xfs/xfs_inode.c:1044
 xfs_generic_create+0x426/0xd00 fs/xfs/xfs_iops.c:197
 lookup_open fs/namei.c:3462 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0x130a/0x2f20 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x500 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4949:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kmem_cache_free+0x91/0x1f0 mm/slub.c:3515
 xfs_inode_free_callback+0x1bd/0x230 fs/xfs/xfs_icache.c:142
 rcu_do_batch kernel/rcu/tree.c:2523 [inline]
 rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763
 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
 __do_softirq kernel/softirq.c:592 [inline]
 invoke_softirq kernel/softirq.c:432 [inline]
 __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:653
 sysvec_apic_timer_interrupt+0x43/0xb0 arch/x86/kernel/apic/apic.c:1096
 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638

The buggy address belongs to the object at ffff88806b238a00
 which belongs to the cache xfs_ili of size 256
The buggy address is located 80 bytes inside of
 256-byte region [ffff88806b238a00, ffff88806b238b00)
The buggy address belongs to the page:
page:ffffea0001ac8e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6b238
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001ac0ac0 0000000700000007 ffff888018fa5640
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x12c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_RECLAIMABLE), pid 3739, ts 58224006894, free_ts 49500716000
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:675
 xfs_trans_ijoin+0xb6/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_init_new_inode+0xd8c/0x1100 fs/xfs/xfs_inode.c:918
 xfs_create+0x9b1/0x1370 fs/xfs/xfs_inode.c:1044
 xfs_generic_create+0x426/0xd00 fs/xfs/xfs_iops.c:197
 vfs_mkdir+0x3b6/0x590 fs/namei.c:4065
 do_mkdirat+0x260/0x520 fs/namei.c:4090
 __do_sys_mkdir fs/namei.c:4110 [inline]
 __se_sys_mkdir fs/namei.c:4108 [inline]
 __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4108
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 __free_pages_ok+0x9ef/0xaa0 mm/page_alloc.c:1643
 free_nonslab_page+0xe4/0x150 mm/slub.c:3535
 kfree+0x1cf/0x270 mm/slub.c:4556
 kmem_free fs/xfs/kmem.h:62 [inline]
 xlog_write_log_records+0x351/0x3c0 fs/xfs/xfs_log_recover.c:1593
 xlog_clear_stale_blocks+0x25c/0x430 fs/xfs/xfs_log_recover.c:1688
 xlog_find_tail+0xa0a/0xe30 fs/xfs/xfs_log_recover.c:1372
 xlog_recover+0xd9/0x530 fs/xfs/xfs_log_recover.c:3374
 xfs_log_mount+0x3d9/0x720 fs/xfs/xfs_log.c:716
 xfs_mountfs+0xba8/0x1ce0 fs/xfs/xfs_mount.c:764
 xfs_fs_fill_super+0x11b4/0x1400 fs/xfs/xfs_super.c:1676
 get_tree_bdev+0x3fe/0x620 fs/super.c:1312
 vfs_get_tree+0x88/0x270 fs/super.c:1517
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88806b238900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806b238980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88806b238a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88806b238a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806b238b00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
==================================================================

Crashes (238):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/12 03:31 linux-5.15.y f45bea23c39c eaeb5c15 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2023/05/19 11:48 linux-5.15.y 9d6bde853685 3bb7af1d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/21 01:39 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2023/05/17 08:11 linux-5.15.y b0ece631f84a 11c89444 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2023/03/31 17:04 linux-5.15.y c957cbb87315 f325deb0 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/29 19:25 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/28 21:01 linux-5.15.y 74cdd62cb470 9efb3cc7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/27 13:20 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/27 07:28 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/26 06:51 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/24 19:12 linux-5.15.y 74cdd62cb470 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/24 15:26 linux-5.15.y 74cdd62cb470 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/23 07:06 linux-5.15.y 74cdd62cb470 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/23 04:26 linux-5.15.y 74cdd62cb470 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/22 20:01 linux-5.15.y 74cdd62cb470 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/22 09:53 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/22 09:53 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/21 17:54 linux-5.15.y 584a40a22cb9 f1e4447c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/17 22:09 linux-5.15.y 584a40a22cb9 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/17 19:18 linux-5.15.y 584a40a22cb9 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/17 04:10 linux-5.15.y 3a5928702e71 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/16 23:32 linux-5.15.y 3a5928702e71 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/15 02:44 linux-5.15.y 3a5928702e71 b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/14 11:50 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/14 06:18 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/10 20:40 linux-5.15.y 3a5928702e71 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/10 08:20 linux-5.15.y 3a5928702e71 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/06 01:12 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/04 18:43 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/03 20:27 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/03 08:07 linux-5.15.y 3a5928702e71 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/02 16:41 linux-5.15.y 3a5928702e71 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/30 18:09 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/28 14:54 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/28 05:24 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/27 00:20 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/23 14:36 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/22 01:56 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/19 23:26 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/19 22:05 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/12 13:24 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/30 00:21 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/29 23:04 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/29 13:10 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/25 00:53 linux-5.15.y 74cdd62cb470 c79b8ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/20 23:32 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/19 00:05 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/16 22:15 linux-5.15.y 3a5928702e71 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/14 23:59 linux-5.15.y 3a5928702e71 b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/10/09 04:27 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/27 22:08 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/20 06:40 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2024/09/12 14:41 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in xfs_iflush_cluster
2023/03/13 14:32 linux-5.15.y 2ddbd0f967b3 026e2200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in xfs_iflush_cluster
* Struck through repros no longer work on HEAD.