syzbot


KASAN: use-after-free Read in xfs_inode_item_push

Status: auto-obsoleted due to no activity on 2023/08/23 09:03
Reported-by: syzbot+64a8825197de5a98dd5b@syzkaller.appspotmail.com
First crash: 396d, last: 396d
Similar bugs (3)
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 248d 474d 0/26 auto-obsoleted due to no activity on 2024/01/02 00:00
linux-5.15 KASAN: use-after-free Read in xfs_inode_item_push 2 375d 378d 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 23 1d02h 49d 0/26 upstream: reported 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 ffff8880739322c0 by task xfsaild/loop3/5353

CPU: 1 PID: 5353 Comm: xfsaild/loop3 Not tainted 6.1.26-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
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+0xc69/0x2780 fs/xfs/xfs_trans_ail.c:669
 kthread+0x26e/0x300 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
 </TASK>

Allocated by task 5345:
 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+0x50/0x370 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:679 [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_create+0x948/0x1360 fs/xfs/xfs_inode.c:1023
 xfs_generic_create+0x48d/0xd70 fs/xfs/xfs_iops.c:199
 lookup_open fs/namei.c:3413 [inline]
 open_last_lookups fs/namei.c:3481 [inline]
 path_openat+0x12f1/0x2e60 fs/namei.c:3711
 do_filp_open+0x230/0x480 fs/namei.c:3741
 do_sys_openat2+0x13b/0x500 fs/open.c:1310
 do_sys_open fs/open.c:1326 [inline]
 __do_sys_openat fs/open.c:1342 [inline]
 __se_sys_openat fs/open.c:1337 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1337
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

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:2250 [inline]
 rcu_core+0xa9a/0x1790 kernel/rcu/tree.c:2510
 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571

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

The buggy address belongs to the physical page:
page:ffffea0001ce4c80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73932
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00021d3440 dead000000000006 ffff888140b6bc80
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 19237, tgid 19235 (syz-executor.2), ts 853973430659, free_ts 842611329911
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
 prep_new_page mm/page_alloc.c:2540 [inline]
 get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
 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+0xa71/0x1080 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:679 [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:945
 xfs_fs_fill_super+0xf90/0x11e0 fs/xfs/xfs_super.c:1666
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1460 [inline]
 free_pcp_prepare mm/page_alloc.c:1510 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
 free_unref_page+0x98/0x570 mm/page_alloc.c:3484
 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x162/0x180 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+0x50/0x370 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/0x4e0 fs/namei.c:139
 user_path_at_empty+0x2a/0x180 fs/namei.c:2875
 do_readlinkat+0x114/0x3a0 fs/stat.c:468
 __do_sys_readlink fs/stat.c:501 [inline]
 __se_sys_readlink fs/stat.c:498 [inline]
 __x64_sys_readlink+0x7b/0x90 fs/stat.c:498
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffff888073932180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888073932200: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
>ffff888073932280: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff888073932300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888073932380: fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/29 12:57 linux-6.1.y ca1c9012c941 62df2017 .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.