REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ================================================================== BUG: KASAN: use-after-free in leaf_paste_in_buffer+0xa2d/0xc30 fs/reiserfs/lbalance.c:1043 Read of size 176 at addr ffff888074deef90 by task syz-executor177/5101 CPU: 1 PID: 5101 Comm: syz-executor177 Not tainted 6.2.0-rc7-syzkaller-00199-g420b2d431d18 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 memcpy+0x24/0x60 mm/kasan/shadow.c:65 leaf_paste_in_buffer+0xa2d/0xc30 fs/reiserfs/lbalance.c:1043 leaf_copy_dir_entries.isra.0+0x7f3/0x980 fs/reiserfs/lbalance.c:108 leaf_copy_boundary_item fs/reiserfs/lbalance.c:168 [inline] leaf_copy_items fs/reiserfs/lbalance.c:551 [inline] leaf_move_items+0x16d2/0x3ad0 fs/reiserfs/lbalance.c:726 leaf_shift_left+0xa4/0x380 fs/reiserfs/lbalance.c:750 balance_leaf_left fs/reiserfs/do_balan.c:616 [inline] balance_leaf+0x3337/0xde40 fs/reiserfs/do_balan.c:1409 do_balance+0x319/0x810 fs/reiserfs/do_balan.c:1888 reiserfs_insert_item+0xdb2/0x11b0 fs/reiserfs/stree.c:2261 reiserfs_get_block+0x1b23/0x4150 fs/reiserfs/inode.c:868 __block_write_begin_int+0x3bd/0x14b0 fs/buffer.c:1991 reiserfs_write_begin+0x36e/0xa60 fs/reiserfs/inode.c:2775 generic_perform_write+0x256/0x570 mm/filemap.c:3772 __generic_file_write_iter+0x2ae/0x500 mm/filemap.c:3900 generic_file_write_iter+0xe3/0x350 mm/filemap.c:3932 call_write_iter include/linux/fs.h:2189 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xdd0 fs/read_write.c:584 ksys_write+0x12b/0x250 fs/read_write.c:637 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:0x7f3678686ae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc9dfa2828 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000000a16e RCX: 00007f3678686ae9 RDX: 000000000000fea7 RSI: 0000000020000280 RDI: 0000000000000007 RBP: 0000000000000000 R08: 0000000000000014 R09: 00007ffc9dfa2850 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc9dfa284c R13: 00007ffc9dfa2880 R14: 00007ffc9dfa2860 R15: 0000000000000011 The buggy address belongs to the physical page: page:ffffea0001d37b80 refcount:4 mapcount:0 mapping:ffff8880128e49f8 index:0x214 pfn:0x74dee memcg:ffff888140140000 aops:def_blk_aops ino:700000 flags: 0xfff00000002012(referenced|lru|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000002012 ffffea0001d37b08 ffff8880124c4020 ffff8880128e49f8 raw: 0000000000000214 ffff88807446f2b8 00000004ffffffff ffff888140140000 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 5101, tgid 5101 (syz-executor177), ts 41708765700, free_ts 41535316353 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2287 folio_alloc+0x20/0x70 mm/mempolicy.c:2297 filemap_alloc_folio+0x362/0x450 mm/filemap.c:972 __filemap_get_folio+0x32c/0xd80 mm/filemap.c:1966 pagecache_get_page+0x2e/0x280 mm/folio-compat.c:98 find_or_create_page include/linux/pagemap.h:612 [inline] grow_dev_page fs/buffer.c:946 [inline] grow_buffers fs/buffer.c:1011 [inline] __getblk_slow+0x1f4/0x1030 fs/buffer.c:1038 __getblk_gfp+0x72/0x80 fs/buffer.c:1333 sb_getblk include/linux/buffer_head.h:356 [inline] get_empty_nodes+0x519/0x7d0 fs/reiserfs/fix_node.c:890 fix_nodes+0x1c21/0x8660 fs/reiserfs/fix_node.c:2662 reiserfs_insert_item+0x7fc/0x11b0 fs/reiserfs/stree.c:2240 reiserfs_new_inode+0xe55/0x2190 fs/reiserfs/inode.c:2054 reiserfs_create+0x351/0x730 fs/reiserfs/namei.c:668 lookup_open.isra.0+0xee7/0x1270 fs/namei.c:3413 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x975/0x2a50 fs/namei.c:3711 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page_list+0x176/0xcd0 mm/page_alloc.c:3510 release_pages+0xcb1/0x1330 mm/swap.c:1076 __pagevec_release+0x77/0xe0 mm/swap.c:1096 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x595/0x1340 mm/shmem.c:947 shmem_truncate_range mm/shmem.c:1042 [inline] shmem_evict_inode+0x32f/0xb60 mm/shmem.c:1151 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1747 [inline] iput.part.0+0x59b/0x880 fs/inode.c:1773 iput+0x5c/0x80 fs/inode.c:1763 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x80a/0xdb0 fs/dcache.c:913 __fput+0x3cc/0xa90 fs/file_table.c:328 task_work_run+0x16f/0x270 kernel/task_work.c:179 ptrace_notify+0x118/0x140 kernel/signal.c:2354 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:251 [inline] syscall_exit_to_user_mode_prepare+0x129/0x280 kernel/entry/common.c:278 Memory state around the buggy address: ffff888074deef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888074deef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888074def000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888074def080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888074def100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================