syzbot


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

Status: auto-obsoleted due to no activity on 2024/12/14 11:37
Reported-by: syzbot+79cfdbe7c96b6ce0a5f6@syzkaller.appspotmail.com
First crash: 108d, last: 108d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in xfs_inode_item_push xfs 16 455d 681d 0/28 auto-obsoleted due to no activity on 2024/01/02 00:00
linux-6.1 KASAN: use-after-free Read in xfs_inode_item_push 1 603d 603d 0/3 auto-obsoleted due to no activity on 2023/08/23 09:03
linux-5.15 KASAN: use-after-free Read in xfs_inode_item_push 2 582d 584d 0/3 auto-obsoleted due to no activity on 2023/08/28 08:02
upstream KASAN: slab-use-after-free Read in xfs_inode_item_push xfs C error 148 1d02h 256d 0/28 upstream: reported C repro on 2024/04/10 12:45

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in xfs_inode_item_push+0x28b/0x2e0 fs/xfs/xfs_inode_item.c:594
Read of size 8 at addr ffff888071503550 by task xfsaild/loop2/4103

CPU: 0 PID: 4103 Comm: xfsaild/loop2 Not tainted 6.1.108-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 xfs_inode_item_push+0x28b/0x2e0 fs/xfs/xfs_inode_item.c:594
 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline]
 xfsaild_push fs/xfs/xfs_trans_ail.c:484 [inline]
 xfsaild+0xdd2/0x2a70 fs/xfs/xfs_trans_ail.c:669
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 4063:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
 kmem_cache_zalloc include/linux/slab.h:683 [inline]
 xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:687
 xfs_trans_ijoin+0xb9/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_init_new_inode+0xd6a/0x10c0 fs/xfs/xfs_inode.c:902
 xfs_symlink+0xc14/0x1fa0 fs/xfs/xfs_symlink.c:234
 xfs_vn_symlink+0x1f1/0x730 fs/xfs/xfs_iops.c:420
 vfs_symlink+0x247/0x3d0 fs/namei.c:4473
 do_symlinkat+0x21e/0x390 fs/namei.c:4502
 __do_sys_symlinkat fs/namei.c:4519 [inline]
 __se_sys_symlinkat fs/namei.c:4516 [inline]
 __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4516
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 21:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 kmem_cache_free+0x292/0x510 mm/slub.c:3683
 xfs_inode_free_callback+0x14e/0x1c0 fs/xfs/xfs_icache.c:145
 rcu_do_batch kernel/rcu/tree.c:2297 [inline]
 rcu_core+0xade/0x1820 kernel/rcu/tree.c:2557
 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571
 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938
 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888071503520
 which belongs to the cache xfs_ili of size 264
The buggy address is located 48 bytes inside of
 264-byte region [ffff888071503520, ffff888071503628)

The buggy address belongs to the physical page:
page:ffffea0001c540c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x71503
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888148af1140
raw: 0000000000000000 00000000800c000c 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 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4049, tgid 4048 (syz.3.91), ts 78429692478, free_ts 69276675452
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517
 prep_new_page mm/page_alloc.c:2524 [inline]
 get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422
 kmem_cache_zalloc include/linux/slab.h:683 [inline]
 xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:687
 xfs_trans_ijoin+0xb9/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_init_new_inode+0xd6a/0x10c0 fs/xfs/xfs_inode.c:902
 xfs_qm_qino_alloc+0x4fb/0xa20 fs/xfs/xfs_qm.c:782
 xfs_qm_init_quotainos+0x654/0x8a0 fs/xfs/xfs_qm.c:1548
 xfs_qm_init_quotainfo+0x11a/0x12f0 fs/xfs/xfs_qm.c:635
 xfs_qm_mount_quotas+0x97/0x620 fs/xfs/xfs_qm.c:1424
 xfs_mountfs+0x185d/0x1f00 fs/xfs/xfs_mount.c:959
 xfs_fs_fill_super+0x1145/0x13a0 fs/xfs/xfs_super.c:1681
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1444 [inline]
 free_pcp_prepare mm/page_alloc.c:1494 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369
 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3464
 free_slab mm/slub.c:2031 [inline]
 discard_slab mm/slub.c:2037 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2586
 put_cpu_partial+0x17b/0x250 mm/slub.c:2662
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
 getname_flags+0xb8/0x4f0 fs/namei.c:139
 getname fs/namei.c:218 [inline]
 __do_sys_unlink fs/namei.c:4440 [inline]
 __se_sys_unlink fs/namei.c:4438 [inline]
 __x64_sys_unlink+0x38/0x50 fs/namei.c:4438
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff888071503400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888071503480: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff888071503500: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff888071503580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888071503600: fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/05 11:37 linux-6.1.y 699506173494 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in xfs_inode_item_push
* Struck through repros no longer work on HEAD.