================================================================== BUG: KASAN: slab-use-after-free in __ext4_iget+0x2f8/0x3eb0 fs/ext4/inode.c:4708 Read of size 8 at addr ffff888034d7e930 by task syz-executor.0/15778 CPU: 1 PID: 15778 Comm: syz-executor.0 Not tainted 6.6.0-rc4-syzkaller-00229-g82714078aee4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 __ext4_iget+0x2f8/0x3eb0 fs/ext4/inode.c:4708 __ext4_fill_super fs/ext4/super.c:5473 [inline] ext4_fill_super+0x552c/0x6d10 fs/ext4/super.c:5703 get_tree_bdev+0x416/0x5b0 fs/super.c:1577 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f598687e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f59875d6ee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f59875d6f80 RCX: 00007f598687e1ea RDX: 0000000020000000 RSI: 0000000020000500 RDI: 00007f59875d6f40 RBP: 0000000020000000 R08: 00007f59875d6f80 R09: 000000000000c989 R10: 000000000000c989 R11: 0000000000000202 R12: 0000000020000500 R13: 00007f59875d6f40 R14: 00000000000004ca R15: 0000000020000100 Allocated by task 15551: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x67/0x3d0 mm/slab.h:762 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x122/0x300 mm/slub.c:3509 alloc_inode_sb include/linux/fs.h:2868 [inline] reiserfs_alloc_inode+0x2a/0xc0 fs/reiserfs/super.c:642 alloc_inode fs/inode.c:259 [inline] new_inode_pseudo+0x65/0x1d0 fs/inode.c:1004 new_inode+0x22/0x1d0 fs/inode.c:1030 reiserfs_create+0x182/0x6e0 fs/reiserfs/namei.c:641 lookup_open fs/namei.c:3495 [inline] open_last_lookups fs/namei.c:3563 [inline] path_openat+0x13e7/0x3180 fs/namei.c:3793 do_filp_open+0x234/0x490 fs/namei.c:3823 do_sys_openat2+0x13e/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5056: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x292/0x500 mm/slub.c:3831 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0xacf/0x1790 kernel/rcu/tree.c:2403 __do_softirq+0x2ab/0x908 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 __call_rcu_common kernel/rcu/tree.c:2653 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2767 reiserfs_new_inode+0x7c1/0x1d10 fs/reiserfs/inode.c:2152 reiserfs_create+0x3e7/0x6e0 fs/reiserfs/namei.c:666 lookup_open fs/namei.c:3495 [inline] open_last_lookups fs/namei.c:3563 [inline] path_openat+0x13e7/0x3180 fs/namei.c:3793 do_filp_open+0x234/0x490 fs/namei.c:3823 do_sys_openat2+0x13e/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 __call_rcu_common kernel/rcu/tree.c:2653 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2767 reiserfs_new_inode+0x7c1/0x1d10 fs/reiserfs/inode.c:2152 reiserfs_mkdir+0x5b0/0x8f0 fs/reiserfs/namei.c:843 xattr_mkdir fs/reiserfs/xattr.c:77 [inline] create_privroot fs/reiserfs/xattr.c:891 [inline] reiserfs_xattr_init+0x323/0x670 fs/reiserfs/xattr.c:1007 reiserfs_fill_super+0x2207/0x2620 fs/reiserfs/super.c:2175 mount_bdev+0x237/0x300 fs/super.c:1629 legacy_get_tree+0xef/0x190 fs/fs_context.c:638 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888034d7e360 which belongs to the cache reiser_inode_cache of size 1568 The buggy address is located 1488 bytes inside of freed 1568-byte region [ffff888034d7e360, ffff888034d7e980) The buggy address belongs to the physical page: page:ffffea0000d35e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888034d793e0 pfn:0x34d78 head:ffffea0000d35e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88802735e101 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88801435fb40 dead000000000122 0000000000000000 raw: ffff888034d793e0 000000008013000a 00000001ffffffff ffff88802735e101 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 12055, tgid 12036 (syz-executor.3), ts 426733130941, free_ts 392228663569 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x1bf/0x300 mm/slub.c:3509 alloc_inode_sb include/linux/fs.h:2868 [inline] reiserfs_alloc_inode+0x2a/0xc0 fs/reiserfs/super.c:642 alloc_inode fs/inode.c:259 [inline] new_inode_pseudo+0x65/0x1d0 fs/inode.c:1004 new_inode+0x22/0x1d0 fs/inode.c:1030 reiserfs_mkdir+0x1c0/0x8f0 fs/reiserfs/namei.c:813 xattr_mkdir fs/reiserfs/xattr.c:77 [inline] create_privroot fs/reiserfs/xattr.c:891 [inline] reiserfs_xattr_init+0x323/0x670 fs/reiserfs/xattr.c:1007 reiserfs_remount+0x9a5/0x18f0 fs/reiserfs/super.c:1544 reconfigure_super+0x440/0x870 fs/super.c:1140 do_remount fs/namespace.c:2882 [inline] path_mount+0xc24/0xfa0 fs/namespace.c:3654 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 __slab_free+0x2f6/0x390 mm/slub.c:3715 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x67/0x3d0 mm/slab.h:762 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x123/0x300 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] jbd2_alloc_handle include/linux/jbd2.h:1592 [inline] new_handle fs/jbd2/transaction.c:476 [inline] jbd2__journal_start+0x148/0x5d0 fs/jbd2/transaction.c:503 __ext4_journal_start_sb+0x215/0x5a0 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_evict_inode+0x651/0xf20 fs/ext4/inode.c:223 evict+0x2a4/0x620 fs/inode.c:664 do_unlinkat+0x50c/0x950 fs/namei.c:4405 __do_sys_unlink fs/namei.c:4446 [inline] __se_sys_unlink fs/namei.c:4444 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4444 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888034d7e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034d7e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888034d7e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888034d7e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888034d7ea00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================