loop0: rw=0, sector=2053, nr_sectors = 1 limit=165 syz-executor.0: attempt to access beyond end of device loop0: rw=0, sector=1082, nr_sectors = 1 limit=165 syz-executor.0: attempt to access beyond end of device loop0: rw=0, sector=1083, nr_sectors = 1 limit=165 ================================================================== BUG: KASAN: use-after-free in ntfs_attr_find+0xc02/0xce0 fs/ntfs/attrib.c:597 Read of size 2 at addr ffff88803a9fe142 by task syz-executor.0/9722 CPU: 0 PID: 9722 Comm: syz-executor.0 Not tainted 6.0.0-rc3-next-20220831-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/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+0xc02/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_attrdef fs/ntfs/super.c:1589 [inline] load_system_files fs/ntfs/super.c:1817 [inline] ntfs_fill_super+0x2e46/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:0x7fa8eae8a7aa 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:00007fa8ec005f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fa8eae8a7aa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa8ec005fe0 RBP: 00007fa8ec006020 R08: 00007fa8ec006020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fa8ec005fe0 R15: 000000002007dd00 The buggy address belongs to the physical page: page:ffffea0000ea7f80 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x3a9fe flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000ec2e08 ffffea0000eebf88 0000000000000000 raw: 0000000000000001 0000000000000001 00000000ffffff7f 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 9622, tgid 9620 (syz-executor.2), ts 370985868077, free_ts 371044613090 prep_new_page mm/page_alloc.c:2534 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4284 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5542 __folio_alloc+0x12/0x40 mm/page_alloc.c:5573 vma_alloc_folio+0xf9/0x780 mm/mempolicy.c:2241 shmem_alloc_folio+0x9e/0x160 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:2188 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 ksys_pwrite64 fs/read_write.c:693 [inline] __do_sys_pwrite64 fs/read_write.c:703 [inline] __se_sys_pwrite64 fs/read_write.c:700 [inline] __x64_sys_pwrite64+0x1f7/0x250 fs/read_write.c:700 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:1451 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1501 free_unref_page_prepare mm/page_alloc.c:3382 [inline] free_unref_page_list+0x16f/0xb90 mm/page_alloc.c:3524 release_pages+0xc66/0x1590 mm/swap.c:1056 __pagevec_release+0x77/0x100 mm/swap.c:1076 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:666 iput_final fs/inode.c:1749 [inline] iput.part.0+0x55d/0x810 fs/inode.c:1775 iput+0x58/0x70 fs/inode.c:1765 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+0x16b/0x270 kernel/task_work.c:179 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: ffff88803a9fe000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803a9fe080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88803a9fe100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88803a9fe180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803a9fe200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================