================================================================== BUG: KASAN: use-after-free in bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline] BUG: KASAN: use-after-free in search_by_entry_key+0x597/0x1370 fs/reiserfs/namei.c:165 Read of size 4 at addr ffff88804bc4f104 by task syz.0.1632/11151 CPU: 1 PID: 11151 Comm: syz.0.1632 Not tainted 5.15.180-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline] search_by_entry_key+0x597/0x1370 fs/reiserfs/namei.c:165 reiserfs_find_entry+0x2ff/0x18e0 fs/reiserfs/namei.c:322 reiserfs_lookup+0x1a7/0x420 fs/reiserfs/namei.c:368 lookup_one_qstr_excl+0x10e/0x240 fs/namei.c:1563 filename_create+0x21e/0x450 fs/namei.c:3836 do_mkdirat+0x9d/0x5a0 fs/namei.c:4080 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f0b1596e969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0b137d6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f0b15b95fa0 RCX: 00007f0b1596e969 RDX: 0000000000000000 RSI: 0000200000000200 RDI: 0000000000000007 RBP: 00007f0b159f0ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0b15b95fa0 R15: 00007fffb3ff6688 The buggy address belongs to the page: page:ffffea00012f13c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x4bc4f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000100 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x13d24ca(GFP_TRANSHUGE|__GFP_NORETRY|__GFP_THISNODE), pid 8099, ts 289812702629, free_ts 290646682667 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 alloc_pages_vma+0x665/0x7c0 mm/mempolicy.c:2128 do_huge_pmd_anonymous_page+0x65b/0x1d10 mm/huge_memory.c:777 create_huge_pmd mm/memory.c:4520 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x2034/0x43c0 mm/memory.c:4883 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x93e/0x11c0 mm/gup.c:1197 populate_vma_page_range+0x213/0x290 mm/gup.c:1529 __mm_populate+0x26f/0x3a0 mm/gup.c:1638 do_mlock+0x47a/0x530 mm/mlock.c:688 __do_sys_mlock mm/mlock.c:696 [inline] __se_sys_mlock mm/mlock.c:694 [inline] __x64_sys_mlock+0x5c/0x70 mm/mlock.c:694 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page_list+0x122/0x7e0 mm/page_alloc.c:3433 release_pages+0x184b/0x1bb0 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu+0xc5/0x170 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1456 [inline] zap_pmd_range mm/memory.c:1505 [inline] zap_pud_range mm/memory.c:1534 [inline] zap_p4d_range mm/memory.c:1555 [inline] unmap_page_range+0x2096/0x2520 mm/memory.c:1576 unmap_vmas+0x11b/0x230 mm/memory.c:1653 exit_mmap+0x38f/0x5f0 mm/mmap.c:3204 __mmput+0x115/0x3b0 kernel/fork.c:1127 exit_mm+0x567/0x6c0 kernel/exit.c:550 do_exit+0x599/0x20a0 kernel/exit.c:861 do_group_exit+0x12e/0x300 kernel/exit.c:996 get_signal+0x6ca/0x12c0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 Memory state around the buggy address: ffff88804bc4f000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804bc4f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804bc4f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804bc4f180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804bc4f200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================