REISERFS (device loop3): using 3.5.x disk format REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage. ================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0x635/0xab0 Read of size 48 at addr ffff888045c98ff0 by task syz-executor.3/32587 CPU: 0 PID: 32587 Comm: syz-executor.3 Not tainted 6.7.0-rc6-syzkaller-00022-g55cb5f43689d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/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+0x142/0x170 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 leaf_paste_in_buffer+0x635/0xab0 leaf_copy_dir_entries+0x71e/0xc60 fs/reiserfs/lbalance.c:108 leaf_copy_boundary_item+0xbbe/0x21b0 fs/reiserfs/lbalance.c:168 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0xd1a/0x2960 fs/reiserfs/lbalance.c:726 leaf_shift_left+0xbe/0x430 fs/reiserfs/lbalance.c:750 balance_leaf+0x15d1/0x12510 fs/reiserfs/do_balan.c:1409 do_balance+0x30d/0x8f0 fs/reiserfs/do_balan.c:1888 reiserfs_insert_item+0xace/0xc30 fs/reiserfs/stree.c:2260 reiserfs_new_inode+0x1177/0x1cb0 fs/reiserfs/inode.c:2048 reiserfs_mkdir+0x5b0/0x8f0 fs/reiserfs/namei.c:843 vfs_mkdir+0x2f1/0x4b0 fs/namei.c:4106 do_mkdirat+0x264/0x3a0 fs/namei.c:4129 __do_sys_mkdir fs/namei.c:4149 [inline] __se_sys_mkdir fs/namei.c:4147 [inline] __x64_sys_mkdir+0x6e/0x80 fs/namei.c:4147 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fdd8e87cce9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fdd8f6360c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007fdd8e99bf80 RCX: 00007fdd8e87cce9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fdd8e8c947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fdd8e99bf80 R15: 00007fffcbb52f78 The buggy address belongs to the physical page: page:ffffea0001172600 refcount:3 mapcount:0 mapping:ffff88801b2a9f78 index:0x214 pfn:0x45c98 memcg:ffff88802548e000 aops:def_blk_aops ino:700003 flags: 0xfff00000008104(referenced|active|private|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000008104 0000000000000000 dead000000000122 ffff88801b2a9f78 raw: 0000000000000214 ffff88804c809828 00000003ffffffff ffff88802548e000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 32587, tgid 32582 (syz-executor.3), ts 1401958673056, free_ts 1401957465924 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_pages mm/mempolicy.c:2204 [inline] folio_alloc+0x12a/0x330 mm/mempolicy.c:2211 filemap_alloc_folio+0xde/0x500 mm/filemap.c:974 __filemap_get_folio+0x431/0xbb0 mm/filemap.c:1918 grow_dev_page fs/buffer.c:1041 [inline] grow_buffers fs/buffer.c:1106 [inline] __getblk_slow fs/buffer.c:1133 [inline] bdev_getblk+0x243/0x6d0 fs/buffer.c:1429 __getblk include/linux/buffer_head.h:358 [inline] sb_getblk include/linux/buffer_head.h:364 [inline] get_empty_nodes+0x716/0xd90 fs/reiserfs/fix_node.c:890 fix_nodes+0x261b/0x8ce0 fs/reiserfs/fix_node.c:2663 reiserfs_insert_item+0x9ea/0xc30 fs/reiserfs/stree.c:2239 reiserfs_new_directory+0x5c5/0x9a0 fs/reiserfs/inode.c:1840 reiserfs_new_inode+0x1238/0x1cb0 fs/reiserfs/inode.c:2062 reiserfs_mkdir+0x5b0/0x8f0 fs/reiserfs/namei.c:843 vfs_mkdir+0x2f1/0x4b0 fs/namei.c:4106 do_mkdirat+0x264/0x3a0 fs/namei.c:4129 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347 free_unref_page_list+0x5a0/0x840 mm/page_alloc.c:2533 release_pages+0x2117/0x2400 mm/swap.c:1042 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline] tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu+0x34c/0x4e0 mm/mmu_gather.c:300 tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:392 exit_mmap+0x4d3/0xc60 mm/mmap.c:3321 __mmput+0x115/0x3c0 kernel/fork.c:1349 exit_mm+0x21f/0x300 kernel/exit.c:567 do_exit+0x9af/0x2740 kernel/exit.c:856 do_group_exit+0x206/0x2c0 kernel/exit.c:1018 get_signal+0x1769/0x1840 kernel/signal.c:2904 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x150 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x69/0x2a0 kernel/entry/common.c:296 do_syscall_64+0x52/0x110 arch/x86/entry/common.c:89 Memory state around the buggy address: ffff888045c98f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888045c98f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888045c99000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888045c99080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888045c99100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================