syzbot


KASAN: slab-use-after-free Read in xfs_inode_item_push

Status: upstream: reported on 2024/04/10 12:45
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+1a28995e12fd13faa44e@syzkaller.appspotmail.com
First crash: 45d, last: 5h53m
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly xfs report (Apr 2024) 0 (1) 2024/04/29 12:34
[syzbot] [xfs?] KASAN: slab-use-after-free Read in xfs_inode_item_push 0 (1) 2024/04/10 12:45
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 241d 466d 0/26 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 388d 388d 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 367d 370d 0/3 auto-obsoleted due to no activity on 2023/08/28 08:02

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:743
Read of size 8 at addr ffff88806d3e3178 by task xfsaild/loop1/14021

CPU: 1 PID: 14021 Comm: xfsaild/loop1 Not tainted 6.9.0-syzkaller-10323-g8f6a15f095a6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:488
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:743
 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline]
 xfsaild_push fs/xfs/xfs_trans_ail.c:486 [inline]
 xfsaild+0xd9a/0x28b0 fs/xfs/xfs_trans_ail.c:671
 kthread+0x2f2/0x390 kernel/kthread.c:389
 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

Allocated by task 13988:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 unpoison_slab_object mm/kasan/common.c:312 [inline]
 __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3940 [inline]
 slab_alloc_node mm/slub.c:4000 [inline]
 kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4007
 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838
 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_setattr_size+0x5bc/0xc80 fs/xfs/xfs_iops.c:926
 xfs_vn_setattr+0x25d/0x320 fs/xfs/xfs_iops.c:1037
 notify_change+0xb9f/0xe70 fs/attr.c:497
 do_truncate+0x220/0x310 fs/open.c:65
 vfs_truncate+0x2e1/0x3b0 fs/open.c:111
 do_sys_truncate+0xde/0x190 fs/open.c:134
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 13982:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
 kasan_slab_free include/linux/kasan.h:184 [inline]
 slab_free_hook mm/slub.c:2195 [inline]
 slab_free mm/slub.c:4436 [inline]
 kmem_cache_free+0x145/0x350 mm/slub.c:4511
 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:146
 rcu_do_batch kernel/rcu/tree.c:2535 [inline]
 rcu_core+0xaff/0x1830 kernel/rcu/tree.c:2809
 handle_softirqs+0x2d8/0x990 kernel/softirq.c:554
 __do_softirq kernel/softirq.c:588 [inline]
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702

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

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6d3e3
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffefff(slab)
raw: 00fff00000000000 ffff88801aba4140 dead000000000122 0000000000000000
raw: 0000000000000000 00000000800c000c 00000001ffffefff 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 0x152c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 7254, tgid 7253 (syz-executor.5), ts 247039807661, free_ts 247035230356
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468
 prep_new_page mm/page_alloc.c:1476 [inline]
 get_page_from_freelist+0x2e2d/0x2ee0 mm/page_alloc.c:3402
 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4660
 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline]
 alloc_pages_node_noprof include/linux/gfp.h:271 [inline]
 alloc_slab_page+0x5f/0x120 mm/slub.c:2264
 allocate_slab+0x5a/0x2e0 mm/slub.c:2427
 new_slab mm/slub.c:2480 [inline]
 ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3666
 __slab_alloc+0x58/0xa0 mm/slub.c:3756
 __slab_alloc_node mm/slub.c:3809 [inline]
 slab_alloc_node mm/slub.c:3988 [inline]
 kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4007
 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838
 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36
 xfs_init_new_inode+0xc23/0xf00 fs/xfs/xfs_inode.c:881
 xfs_qm_qino_alloc+0x264/0x6b0 fs/xfs/xfs_qm.c:800
 xfs_qm_init_quotainos+0x658/0x8a0 fs/xfs/xfs_qm.c:1601
 xfs_qm_init_quotainfo+0x138/0x1120 fs/xfs/xfs_qm.c:643
 xfs_qm_mount_quotas+0x9b/0x630 fs/xfs/xfs_qm.c:1477
 xfs_mountfs+0x1993/0x2020 fs/xfs/xfs_mount.c:980
page last free pid 5112 tgid 5112 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1088 [inline]
 free_unref_page+0xd22/0xea0 mm/page_alloc.c:2565
 discard_slab mm/slub.c:2526 [inline]
 __put_partials+0xeb/0x130 mm/slub.c:2994
 put_cpu_partial+0x17c/0x250 mm/slub.c:3069
 __slab_free+0x2ea/0x3d0 mm/slub.c:4306
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3940 [inline]
 slab_alloc_node mm/slub.c:4000 [inline]
 kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4007
 getname_flags+0xbd/0x4f0 fs/namei.c:139
 getname fs/namei.c:218 [inline]
 __do_sys_unlink fs/namei.c:4455 [inline]
 __se_sys_unlink fs/namei.c:4453 [inline]
 __x64_sys_unlink+0x3c/0x60 fs/namei.c:4453
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88806d3e3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806d3e3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806d3e3100: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
                                                                ^
 ffff88806d3e3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806d3e3200: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
==================================================================

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/21 21:28 upstream 8f6a15f095a6 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/17 07:51 upstream ea5f6ad9ad96 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/17 01:03 upstream ea5f6ad9ad96 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/14 18:29 upstream a5131c3fdf26 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/14 14:12 upstream a5131c3fdf26 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/12 13:31 upstream cf87f46fd34d 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/08 05:41 upstream dccb07f2914c 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/07 03:50 upstream dd5a440a31fa c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/06 17:48 upstream dd5a440a31fa c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/06 13:26 upstream dd5a440a31fa 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/03 01:01 upstream 49a73b1652c5 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/30 22:04 upstream 98369dccd2f8 9e0e6af1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/23 10:31 upstream 4d2008430ce8 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/19 17:45 linux-next c75962170e49 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/05/09 09:27 linux-next 704ba27ac555 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/29 01:10 linux-next bb7a2467e6be 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/24 08:55 linux-next 7b4f2bc91c15 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/23 18:37 linux-next 7b4f2bc91c15 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/23 17:28 linux-next 7b4f2bc91c15 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in xfs_inode_item_push
2024/04/06 11:55 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 707081b61156 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: slab-use-after-free Read in xfs_inode_item_push
* Struck through repros no longer work on HEAD.