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 80 at addr ffff888070daffe0 by task syz-executor113/3656 CPU: 1 PID: 3656 Comm: syz-executor113 Not tainted 6.1.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 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:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 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:3753 __generic_file_write_iter+0x2ae/0x4d0 mm/filemap.c:3881 generic_file_write_iter+0xe3/0x350 mm/filemap.c:3913 __kernel_write_iter+0x262/0x730 fs/read_write.c:517 __kernel_write+0xcb/0x110 fs/read_write.c:537 __dump_emit fs/coredump.c:804 [inline] dump_emit+0x21d/0x340 fs/coredump.c:874 elf_core_dump+0x1d7c/0x3520 fs/binfmt_elf.c:2264 do_coredump+0x276d/0x3c70 fs/coredump.c:755 get_signal+0x1bf1/0x2440 kernel/signal.c:2844 arch_do_signal_or_restart+0x86/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/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 RIP: 0033:0x7f2d19351d09 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 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:00007ffc7057dbf8 EFLAGS: 00000216 ORIG_RAX: 000000000000004d RAX: ffffffffffffffe5 RBX: 0000000000000003 RCX: 00007f2d19351d09 RDX: 00007f2d19351d09 RSI: 000001fffffff000 RDI: 0000000000000006 RBP: 0000000000000000 R08: 00007ffc7057dc20 R09: 00007ffc7057dc20 R10: 00007ffc7057dc20 R11: 0000000000000216 R12: 00007ffc7057dc1c R13: 00007ffc7057dc50 R14: 00007ffc7057dc30 R15: 0000000000000009 The buggy address belongs to the physical page: page:ffffea0001c36bc0 refcount:2 mapcount:0 mapping:ffff888144cf5ff8 index:0x213 pfn:0x70daf memcg:ffff888140140000 aops:def_blk_aops ino:700000 flags: 0xfff00000002032(referenced|lru|active|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000002032 ffffea0001c36b88 ffffea0000811848 ffff888144cf5ff8 raw: 0000000000000213 ffff888071655910 00000002ffffffff 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 3656, tgid 3656 (syz-executor113), ts 51192805041, free_ts 49671715235 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 folio_alloc+0x20/0x70 mm/mempolicy.c:2295 filemap_alloc_folio+0x362/0x450 mm/filemap.c:971 __filemap_get_folio+0x32c/0xd90 mm/filemap.c:1965 pagecache_get_page+0x32/0x280 mm/folio-compat.c:110 find_or_create_page include/linux/pagemap.h:613 [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] search_by_key+0x3ac/0x3bf0 fs/reiserfs/stree.c:672 reiserfs_read_locked_inode+0x158/0x2160 fs/reiserfs/inode.c:1549 reiserfs_fill_super+0x1273/0x2e90 fs/reiserfs/super.c:2071 mount_bdev+0x351/0x410 fs/super.c:1401 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x2f0 fs/super.c:1531 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3370 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page_list+0x176/0xc40 mm/page_alloc.c:3529 release_pages+0xc8a/0x1360 mm/swap.c:1055 __pagevec_release+0x7b/0x110 mm/swap.c:1075 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x63a/0x1360 mm/shmem.c:946 shmem_truncate_range mm/shmem.c:1045 [inline] shmem_evict_inode+0x3ca/0xc30 mm/shmem.c:1154 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:420 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:482 [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: ffff888070daff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888070daff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888070db0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888070db0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888070db0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================