REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names ================================================================== BUG: KASAN: slab-use-after-free in reiserfs_find_actor+0x158/0x160 fs/reiserfs/inode.c:1625 Read of size 4 at addr ffff88808d0caaf8 by task syz-executor.0/12829 CPU: 0 PID: 12829 Comm: syz-executor.0 Not tainted 6.2.0-next-20230303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/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:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 reiserfs_find_actor+0x158/0x160 fs/reiserfs/inode.c:1625 find_inode+0xe4/0x220 fs/inode.c:916 inode_insert5+0x101/0x600 fs/inode.c:1171 insert_inode_locked4+0x5b/0xa0 fs/inode.c:1681 reiserfs_new_inode+0x608/0x2190 fs/reiserfs/inode.c:1960 reiserfs_mkdir+0x4b8/0x990 fs/reiserfs/namei.c:845 xattr_mkdir fs/reiserfs/xattr.c:76 [inline] create_privroot fs/reiserfs/xattr.c:882 [inline] reiserfs_xattr_init+0x57e/0xc30 fs/reiserfs/xattr.c:1005 reiserfs_fill_super+0x2127/0x2ea0 fs/reiserfs/super.c:2175 mount_bdev+0x351/0x410 fs/super.c:1371 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1501 do_new_mount fs/namespace.c:3042 [inline] path_mount+0x1342/0x1e40 fs/namespace.c:3372 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount fs/namespace.c:3571 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3571 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:0x7fd8b9e8d62a 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:00007fd8bac24f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000010fe RCX: 00007fd8b9e8d62a RDX: 0000000020001100 RSI: 0000000020001140 RDI: 00007fd8bac24fe0 RBP: 00007fd8bac25020 R08: 00007fd8bac25020 R09: 0000000000800008 R10: 0000000000800008 R11: 0000000000000202 R12: 0000000020001100 R13: 0000000020001140 R14: 00007fd8bac24fe0 R15: 0000000020000400 Allocated by task 12370: 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:769 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x209/0x580 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2686 [inline] f2fs_alloc_inode+0x103/0x5c0 fs/f2fs/super.c:1371 alloc_inode+0x61/0x230 fs/inode.c:260 iget_locked+0x1bb/0x660 fs/inode.c:1287 f2fs_iget+0x63/0x5600 fs/f2fs/inode.c:504 f2fs_fill_super+0x3b9e/0x8bb0 fs/f2fs/super.c:4356 mount_bdev+0x351/0x410 fs/super.c:1371 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1501 do_new_mount fs/namespace.c:3042 [inline] path_mount+0x1342/0x1e40 fs/namespace.c:3372 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount fs/namespace.c:3571 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3571 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+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7d0 kernel/rcu/tree.c:2622 destroy_inode+0x129/0x1b0 fs/inode.c:315 iput_final fs/inode.c:1748 [inline] iput fs/inode.c:1774 [inline] iput+0x52b/0x8e0 fs/inode.c:1760 f2fs_put_super+0x4a3/0xc50 fs/f2fs/super.c:1597 generic_shutdown_super+0x158/0x480 fs/super.c:491 kill_block_super+0x9b/0xf0 fs/super.c:1398 kill_f2fs_super+0x2af/0x3c0 fs/f2fs/super.c:4635 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+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 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+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7d0 kernel/rcu/tree.c:2622 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+0x9b/0xf0 fs/super.c:1398 kill_f2fs_super+0x2af/0x3c0 fs/f2fs/super.c:4635 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+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 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 ffff88808d0ca3a0 which belongs to the cache f2fs_inode_cache of size 2152 The buggy address is located 1880 bytes inside of freed 2152-byte region [ffff88808d0ca3a0, ffff88808d0cac08) The buggy address belongs to the physical page: page:ffffea0002343200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88808d0cbe58 pfn:0x8d0c8 head:ffffea0002343200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807c22fb01 anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff88801c4c7b40 0000000000000000 dead000000000001 raw: ffff88808d0cbe58 00000000800e0002 00000001ffffffff ffff88807c22fb01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 9205, tgid 9171 (syz-executor.2), ts 639028578673, free_ts 638571291863 prep_new_page mm/page_alloc.c:2492 [inline] get_page_from_freelist+0xf75/0x2ad0 mm/page_alloc.c:4256 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5522 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x28e/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc_lru+0x42d/0x580 mm/slub.c:3483 alloc_inode_sb include/linux/fs.h:2686 [inline] f2fs_alloc_inode+0x103/0x5c0 fs/f2fs/super.c:1371 alloc_inode+0x61/0x230 fs/inode.c:260 new_inode_pseudo fs/inode.c:1019 [inline] new_inode+0x2b/0x280 fs/inode.c:1047 f2fs_new_inode+0xe1/0x2750 fs/f2fs/namei.c:217 __f2fs_tmpfile+0xba/0x440 fs/f2fs/namei.c:852 f2fs_tmpfile+0x182/0x250 fs/f2fs/namei.c:921 vfs_tmpfile+0x393/0x5d0 fs/namei.c:3611 do_tmpfile fs/namei.c:3672 [inline] path_openat+0x16ed/0x2750 fs/namei.c:3706 do_filp_open+0x1ba/0x410 fs/namei.c:3742 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_unref_page_prepare+0x4d1/0xb60 mm/page_alloc.c:3318 free_unref_page+0x33/0x370 mm/page_alloc.c:3413 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __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:769 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x17c/0x320 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:980 kmalloc include/linux/slab.h:584 [inline] tomoyo_realpath_from_path+0xc3/0x600 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x297/0x3a0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:332 [inline] tomoyo_file_open+0xa1/0xc0 security/tomoyo/tomoyo.c:327 security_file_open+0x49/0xb0 security/security.c:1719 do_dentry_open+0x575/0x13f0 fs/open.c:907 do_open fs/namei.c:3560 [inline] path_openat+0x1baa/0x2750 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_openat fs/open.c:1380 [inline] __se_sys_openat fs/open.c:1375 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1375 Memory state around the buggy address: ffff88808d0ca980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d0caa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808d0caa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d0cab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d0cab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================