ntfs: (device loop0): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0xa as bad. Run chkdsk. ntfs: (device loop0): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default. ================================================================== BUG: KASAN: use-after-free in ntfs_read_folio+0x9b0/0x29d0 fs/ntfs/aops.c:489 Read of size 1 at addr ffff88807106917f by task syz-executor182/3544 CPU: 0 PID: 3544 Comm: syz-executor182 Not tainted 6.1.27-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 ntfs_read_folio+0x9b0/0x29d0 fs/ntfs/aops.c:489 filemap_read_folio+0x199/0x780 mm/filemap.c:2407 do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3535 do_read_cache_page+0x32/0x220 mm/filemap.c:3577 read_mapping_page include/linux/pagemap.h:756 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] load_and_init_attrdef fs/ntfs/super.c:1609 [inline] load_system_files+0x1c07/0x4830 fs/ntfs/super.c:1817 ntfs_fill_super+0x19b0/0x2bd0 fs/ntfs/super.c:2892 mount_bdev+0x26d/0x3a0 fs/super.c:1423 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1553 do_new_mount+0x28b/0xad0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568 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:0x7f125d65546a Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 f8 03 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007ffde99dd3d8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f125d65546a RDX: 0000000020000040 RSI: 000000002001f200 RDI: 00007ffde99dd3f0 RBP: 00007ffde99dd3f0 R08: 00007ffde99dd430 R09: 0000000000000978 R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000004 R13: 00005555558b7380 R14: 0000000000000000 R15: 00007ffde99dd430 The buggy address belongs to the physical page: page:ffffea0001c41a40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x71069 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001c41b08 ffffea0001c41b48 0000000000000000 raw: 0000000000000001 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 3534, tgid 3534 (sshd), ts 54230160063, free_ts 54249942889 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533 prep_new_page mm/page_alloc.c:2540 [inline] get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559 __folio_alloc+0xf/0x30 mm/page_alloc.c:5591 vma_alloc_folio+0x486/0x990 mm/mempolicy.c:2239 alloc_page_vma include/linux/gfp.h:284 [inline] do_anonymous_page mm/memory.c:4123 [inline] handle_pte_fault mm/memory.c:4962 [inline] __handle_mm_fault mm/memory.c:5106 [inline] handle_mm_fault+0x2e85/0x5330 mm/memory.c:5227 do_user_addr_fault arch/x86/mm/fault.c:1428 [inline] handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x58d/0x790 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1460 [inline] free_pcp_prepare mm/page_alloc.c:1510 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388 free_unref_page_list+0x107/0x810 mm/page_alloc.c:3530 release_pages+0x2836/0x2b40 mm/swap.c:1055 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261 tlb_finish_mmu+0xce/0x1f0 mm/mmu_gather.c:361 unmap_region+0x29f/0x2f0 mm/mmap.c:2229 do_mas_align_munmap+0xe98/0x15e0 mm/mmap.c:2482 do_mas_munmap+0x246/0x2b0 mm/mmap.c:2540 __vm_munmap+0x268/0x370 mm/mmap.c:2817 __do_sys_munmap mm/mmap.c:2842 [inline] __se_sys_munmap mm/mmap.c:2839 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2839 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 Memory state around the buggy address: ffff888071069000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888071069080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888071069100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888071069180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888071069200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================