loop1: detected capacity change from 0 to 4096 ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0xb88/0xce0 fs/ntfs/attrib.c:597 Read of size 2 at addr ffff8880a218a84a by task syz-executor.1/9486 CPU: 0 PID: 9486 Comm: syz-executor.1 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 ntfs_attr_find+0xb88/0xce0 fs/ntfs/attrib.c:597 ntfs_attr_lookup+0x1056/0x2070 fs/ntfs/attrib.c:1193 ntfs_read_locked_inode+0x5b4/0x5ae0 fs/ntfs/inode.c:616 ntfs_iget+0x12d/0x180 fs/ntfs/inode.c:177 load_and_init_mft_mirror fs/ntfs/super.c:1027 [inline] load_system_files fs/ntfs/super.c:1772 [inline] ntfs_fill_super+0x1983/0x92d0 fs/ntfs/super.c:2892 mount_bdev+0x34d/0x410 fs/super.c:1400 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6545e8cada Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6547069f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007f6545e8cada RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f6547069fe0 RBP: 00007f654706a020 R08: 00007f654706a020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f6547069fe0 R15: 0000000020077ea0 The buggy address belongs to the physical page: page:ffffea0002886280 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0xa218a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0002733048 ffffea00027a5248 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 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9301, tgid 9296 (syz-executor.1), ts 522619182862, free_ts 522733417392 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 __folio_alloc+0x12/0x40 mm/page_alloc.c:5580 vma_alloc_folio+0xf9/0x780 mm/mempolicy.c:2231 shmem_alloc_folio+0x117/0x1e0 mm/shmem.c:1557 shmem_alloc_and_acct_folio+0x15e/0x5d0 mm/shmem.c:1587 shmem_getpage_gfp+0x6fe/0x1f30 mm/shmem.c:1921 shmem_getpage mm/shmem.c:150 [inline] shmem_write_begin+0xff/0x1e0 mm/shmem.c:2512 generic_perform_write+0x246/0x560 mm/filemap.c:3745 __generic_file_write_iter+0x2aa/0x4d0 mm/filemap.c:3873 generic_file_write_iter+0xdf/0x350 mm/filemap.c:3905 call_write_iter include/linux/fs.h:2190 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x1f7/0x250 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/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:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page_list+0x16f/0xb90 mm/page_alloc.c:3522 release_pages+0xbd3/0x1400 mm/swap.c:1012 __pagevec_release+0x77/0x100 mm/swap.c:1032 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x88f/0x1500 mm/shmem.c:956 shmem_truncate_range mm/shmem.c:1044 [inline] shmem_evict_inode+0x3c6/0xc20 mm/shmem.c:1142 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1747 [inline] iput.part.0+0x55d/0x810 fs/inode.c:1773 iput+0x58/0x70 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+0x806/0xdb0 fs/dcache.c:913 __fput+0x3cc/0xa90 fs/file_table.c:328 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 Memory state around the buggy address: ffff8880a218a700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880a218a780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880a218a800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880a218a880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880a218a900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================