loop3: detected capacity change from 0 to 4096 ntfs3: loop3: Different NTFS' sector size (1024) and media sector size (512) ntfs3: loop3: Mark volume as dirty due to NTFS errors ================================================================== BUG: KASAN: use-after-free in hdr_find_e+0x255/0x580 fs/ntfs3/index.c:689 Read of size 2 at addr ffff888072f7d820 by task syz-executor.3/3344 CPU: 0 PID: 3344 Comm: syz-executor.3 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 hdr_find_e+0x255/0x580 fs/ntfs3/index.c:689 indx_find+0x4ff/0xb20 fs/ntfs3/index.c:1085 dir_search_u+0x161/0x320 fs/ntfs3/dir.c:254 ntfs_lookup+0x112/0x1b0 fs/ntfs3/namei.c:83 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1396 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff3b708b5a9 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff3b7e7e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007ff3b71abf80 RCX: 00007ff3b708b5a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180 RBP: 00007ff3b70e67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe3dfbcbef R14: 00007ff3b7e7e300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0001cbdf40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x72f7d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001dd1888 ffffea0000851c08 0000000000000000 raw: 0000000000000000 ffff888077cc6b40 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 3639, tgid 3639 (syz-executor.2), ts 1017012569396, free_ts 1017098100125 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4287 __alloc_pages+0x259/0x560 mm/page_alloc.c:5554 __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x7f/0x320 arch/x86/mm/pgtable.c:33 __pte_alloc+0x75/0x220 mm/memory.c:468 copy_pte_range mm/memory.c:1036 [inline] copy_pmd_range mm/memory.c:1171 [inline] copy_pud_range mm/memory.c:1208 [inline] copy_p4d_range+0x1efd/0x22c0 mm/memory.c:1232 copy_page_range+0x521/0x7c0 mm/memory.c:1330 dup_mmap+0xb94/0xfc0 kernel/fork.c:691 dup_mm+0x8c/0x310 kernel/fork.c:1526 copy_mm+0xcb/0x160 kernel/fork.c:1575 copy_process+0x1998/0x4000 kernel/fork.c:2253 kernel_clone+0x21b/0x620 kernel/fork.c:2671 __do_sys_clone kernel/fork.c:2812 [inline] __se_sys_clone kernel/fork.c:2796 [inline] __x64_sys_clone+0x228/0x290 kernel/fork.c:2796 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page_list+0xb4/0x7b0 mm/page_alloc.c:3528 release_pages+0x232a/0x25c0 mm/swap.c:1055 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:256 [inline] tlb_flush_mmu+0x850/0xa70 mm/mmu_gather.c:263 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:363 exit_mmap+0x275/0x630 mm/mmap.c:3098 __mmput+0x114/0x3b0 kernel/fork.c:1185 exit_mm+0x1f5/0x2d0 kernel/exit.c:516 do_exit+0x5e7/0x2070 kernel/exit.c:807 do_group_exit+0x1fd/0x2b0 kernel/exit.c:950 get_signal+0x16ec/0x17b0 kernel/signal.c:2858 arch_do_signal_or_restart+0x7b/0x730 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x150 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff888072f7d700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888072f7d780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888072f7d800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888072f7d880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888072f7d900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================