================================================================== BUG: KASAN: slab-use-after-free in check_igot_inode+0x196/0x1c0 fs/ext4/inode.c:4648 Read of size 8 at addr ffff888085b19610 by task syz-executor.4/7980 CPU: 1 PID: 7980 Comm: syz-executor.4 Not tainted 6.4.0-rc7-syzkaller-00226-ga92b7d26c743 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 check_igot_inode+0x196/0x1c0 fs/ext4/inode.c:4648 __ext4_iget+0x1598/0x4460 fs/ext4/inode.c:4700 __ext4_fill_super fs/ext4/super.c:5446 [inline] ext4_fill_super+0x680f/0xafa0 fs/ext4/super.c:5672 get_tree_bdev+0x44a/0x770 fs/super.c:1303 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f9a8a28d8ba Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9a8af0bf88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000004a6 RCX: 00007f9a8a28d8ba RDX: 00000000200004c0 RSI: 0000000020000500 RDI: 00007f9a8af0bfe0 RBP: 00007f9a8af0c020 R08: 00007f9a8af0c020 R09: 0000000000800800 R10: 0000000000800800 R11: 0000000000000202 R12: 00000000200004c0 R13: 0000000020000500 R14: 00007f9a8af0bfe0 R15: 00000000200003c0 Allocated by task 7905: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slab.c:3256 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc_lru+0x1e3/0x640 mm/slab.c:3458 alloc_inode_sb include/linux/fs.h:2705 [inline] reiserfs_alloc_inode+0x28/0xc0 fs/reiserfs/super.c:642 alloc_inode+0x61/0x230 fs/inode.c:260 new_inode_pseudo fs/inode.c:1018 [inline] new_inode+0x2b/0x280 fs/inode.c:1046 reiserfs_mkdir+0x1f1/0x990 fs/reiserfs/namei.c:813 xattr_mkdir fs/reiserfs/xattr.c:77 [inline] create_privroot fs/reiserfs/xattr.c:890 [inline] reiserfs_xattr_init+0x57e/0xbc0 fs/reiserfs/xattr.c:1006 reiserfs_fill_super+0x2129/0x2eb0 fs/reiserfs/super.c:2175 mount_bdev+0x358/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 0: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3389 [inline] __do_kmem_cache_free mm/slab.c:3576 [inline] kmem_cache_free mm/slab.c:3601 [inline] kmem_cache_free+0x105/0x370 mm/slab.c:3594 i_callback+0x43/0x70 fs/inode.c:249 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x806/0x1ad0 kernel/rcu/tree.c:2377 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 destroy_inode+0x129/0x1b0 fs/inode.c:315 dispose_list+0x117/0x1e0 fs/inode.c:698 evict_inodes+0x345/0x440 fs/inode.c:748 generic_shutdown_super+0xaf/0x480 fs/super.c:479 kill_block_super+0xa1/0x100 fs/super.c:1407 deactivate_locked_super+0x98/0x160 fs/super.c:331 deactivate_super+0xb1/0xd0 fs/super.c:362 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 destroy_inode+0x129/0x1b0 fs/inode.c:315 iput_final fs/inode.c:1747 [inline] iput.part.0+0x50a/0x740 fs/inode.c:1773 iput+0x5c/0x80 fs/inode.c:1763 reiserfs_new_inode+0x402/0x2110 fs/reiserfs/inode.c:2154 reiserfs_mkdir+0x4b8/0x990 fs/reiserfs/namei.c:843 xattr_mkdir fs/reiserfs/xattr.c:77 [inline] create_privroot fs/reiserfs/xattr.c:890 [inline] reiserfs_xattr_init+0x57e/0xbc0 fs/reiserfs/xattr.c:1006 reiserfs_fill_super+0x2129/0x2eb0 fs/reiserfs/super.c:2175 mount_bdev+0x358/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888085b19040 which belongs to the cache reiser_inode_cache of size 1568 The buggy address is located 1488 bytes inside of freed 1568-byte region [ffff888085b19040, ffff888085b19660) The buggy address belongs to the physical page: page:ffffea000216c640 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888085b19ffe pfn:0x85b19 memcg:ffff888022e7a6c1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x2() raw: 00fff00000000200 ffff888141ae3200 ffff888019695a50 ffffea0002050190 raw: ffff888085b19ffe ffff888085b19040 0000000100000002 ffff888022e7a6c1 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x3420d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 5231, tgid 5230 (syz-executor.3), ts 244163062311, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3201 [inline] slab_alloc_node mm/slab.c:3249 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc_lru+0x540/0x640 mm/slab.c:3458 alloc_inode_sb include/linux/fs.h:2705 [inline] reiserfs_alloc_inode+0x28/0xc0 fs/reiserfs/super.c:642 alloc_inode+0x61/0x230 fs/inode.c:260 iget5_locked fs/inode.c:1241 [inline] iget5_locked+0x1cf/0x2c0 fs/inode.c:1234 reiserfs_fill_super+0xf8c/0x2eb0 fs/reiserfs/super.c:2053 mount_bdev+0x358/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page_owner free stack trace missing Memory state around the buggy address: ffff888085b19500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888085b19580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888085b19600: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888085b19680: fc fc fc fc fc fc fc fc fc fc fc fc 00 00 00 00 ffff888085b19700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================