ntfs: volume version 3.1. ================================================================== BUG: KASAN: use-after-free in ntfs_read_folio+0x9be/0x23e0 fs/ntfs/aops.c:483 Read of size 10 at addr ffff88807368b170 by task syz-executor350/5057 CPU: 0 PID: 5057 Comm: syz-executor350 Not tainted 6.7.0-rc8-syzkaller-00024-gac865f00af29 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x142/0x170 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 ntfs_read_folio+0x9be/0x23e0 fs/ntfs/aops.c:483 read_pages+0x5f0/0x830 mm/readahead.c:180 page_cache_ra_unbounded+0x68e/0x7c0 mm/readahead.c:269 page_cache_sync_readahead include/linux/pagemap.h:1283 [inline] filemap_get_pages+0x49c/0x2080 mm/filemap.c:2497 filemap_read+0x41b/0xec0 mm/filemap.c:2593 __kernel_read+0x425/0x8b0 fs/read_write.c:428 integrity_kernel_read+0xb0/0xf0 security/integrity/iint.c:221 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xad1/0x1b30 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x554/0xb30 security/integrity/ima/ima_api.c:290 process_measurement+0x1373/0x21c0 security/integrity/ima/ima_main.c:359 ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:557 do_open fs/namei.c:3624 [inline] path_openat+0x2897/0x3290 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1463 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f792d95e0e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 00 00 90 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:00007ffc4d4f3a48 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f792d95e0e9 RDX: 0000000000141842 RSI: 0000000020000100 RDI: 00000000ffffff9c RBP: 0000000000000004 R08: 000000000001ee7c R09: 0000000000004800 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc4d4f3a90 R13: 00007ffc4d4f3ad0 R14: 0000000000200000 R15: 0000000000000003 The buggy address belongs to the physical page: page:ffffea0001cda2c0 refcount:1 mapcount:0 mapping:ffff88807f0a1de8 index:0x0 pfn:0x7368b memcg:ffff888141252000 aops:shmem_aops ino:5c1 dentry name:"b7:0" flags: 0xfff0000008003c(referenced|uptodate|dirty|lru|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff0000008003c ffffea0001cda248 ffff888013645000 ffff88807f0a1de8 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888141252000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 5058, tgid 5058 (udevd), ts 72415633532, free_ts 65438571106 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 shmem_alloc_folio mm/shmem.c:1630 [inline] shmem_alloc_and_add_folio+0x24f/0xde0 mm/shmem.c:1670 shmem_get_folio_gfp+0x7c3/0x1ee0 mm/shmem.c:2054 shmem_get_folio mm/shmem.c:2136 [inline] shmem_write_begin+0x170/0x4c0 mm/shmem.c:2719 generic_perform_write+0x31b/0x630 mm/filemap.c:3927 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2895 call_write_iter include/linux/fs.h:2020 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x792/0xb20 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347 free_unref_page_list+0x5a0/0x840 mm/page_alloc.c:2533 release_pages+0x2117/0x2400 mm/swap.c:1042 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline] tlb_flush_mmu_free mm/mmu_gather.c:293 [inline] tlb_flush_mmu+0x34c/0x4e0 mm/mmu_gather.c:300 tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:392 unmap_region+0x300/0x350 mm/mmap.c:2341 do_vmi_align_munmap+0x1223/0x1860 mm/mmap.c:2657 do_vmi_munmap+0x24d/0x2d0 mm/mmap.c:2725 __vm_munmap+0x230/0x450 mm/mmap.c:3012 __do_sys_munmap mm/mmap.c:3029 [inline] __se_sys_munmap mm/mmap.c:3026 [inline] __x64_sys_munmap+0x69/0x80 mm/mmap.c:3026 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88807368b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807368b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807368b100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88807368b180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807368b200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================