================================================================== BUG: KASAN: slab-use-after-free in check_igot_inode+0x196/0x1c0 fs/ext4/inode.c:4648 Read of size 8 at addr ffff88810a55a6d0 by task syz-executor.2/17890 CPU: 3 PID: 17890 Comm: syz-executor.2 Not tainted 6.4.0-rc7-syzkaller-00234-g547cc9be86f4 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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:0x7f3ee168d8ba 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:00007f3ee2396f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000005cc RCX: 00007f3ee168d8ba RDX: 0000000020000580 RSI: 00000000200005c0 RDI: 00007f3ee2396fe0 RBP: 00007f3ee2397020 R08: 00007f3ee2397020 R09: 0000000000200040 R10: 0000000000200040 R11: 0000000000000202 R12: 0000000020000580 R13: 00000000200005c0 R14: 00007f3ee2396fe0 R15: 0000000020000000 Allocated by task 6370: 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_create+0x1ba/0x730 fs/reiserfs/namei.c:641 lookup_open.isra.0+0x105a/0x1400 fs/namei.c:3492 open_last_lookups fs/namei.c:3560 [inline] path_openat+0x975/0x2750 fs/namei.c:3788 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1383 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 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 The buggy address belongs to the object at ffff88810a55a100 which belongs to the cache reiser_inode_cache of size 1568 The buggy address is located 1488 bytes inside of freed 1568-byte region [ffff88810a55a100, ffff88810a55a720) The buggy address belongs to the physical page: page:ffffea0004295680 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810a55affe pfn:0x10a55a memcg:ffff88810756fd41 flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff) page_type: 0x2() raw: 057ff00000000200 ffff888103b40e00 ffffea0004298450 ffffea00049c4f10 raw: ffff88810a55affe ffff88810a55a100 0000000100000002 ffff88810756fd41 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x140cd0(GFP_USER|__GFP_COMP|__GFP_RECLAIMABLE), pid 6370, tgid 6369 (syz-executor.0), ts 213164050733, free_ts 211938313668 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 fallback_alloc+0x1e2/0x2d0 mm/slab.c:3112 __do_cache_alloc mm/slab.c:3216 [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+0x339/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_create+0x1ba/0x730 fs/reiserfs/namei.c:641 lookup_open.isra.0+0x105a/0x1400 fs/namei.c:3492 open_last_lookups fs/namei.c:3560 [inline] path_openat+0x975/0x2750 fs/namei.c:3788 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 slab_destroy mm/slab.c:1612 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1632 __cache_free_alien mm/slab.c:773 [inline] cache_free_alien mm/slab.c:789 [inline] ___cache_free+0x204/0x3d0 mm/slab.c:3416 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 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] __kmem_cache_alloc_node+0x1fc/0x3f0 mm/slab.c:3540 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] tomoyo_realpath_from_path+0xc3/0x600 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x33e/0x6e0 security/tomoyo/file.c:923 tomoyo_path_rename+0x102/0x1b0 security/tomoyo/tomoyo.c:299 security_path_rename+0x121/0x230 security/security.c:1789 do_renameat2+0x47d/0xd40 fs/namei.c:4989 __do_sys_rename fs/namei.c:5048 [inline] __se_sys_rename fs/namei.c:5046 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5046 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88810a55a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810a55a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810a55a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810a55a700: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff88810a55a780: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================