loop0: detected capacity change from 0 to 264192 ntfs3: loop0: Failed to load $Extend. ================================================================== BUG: KASAN: slab-out-of-bounds in hdr_find_e.isra.0+0x5d2/0x670 fs/ntfs3/index.c:780 Read of size 2 at addr ffff888031e47820 by task syz-executor.0/5957 CPU: 0 PID: 5957 Comm: syz-executor.0 Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 hdr_find_e.isra.0+0x5d2/0x670 fs/ntfs3/index.c:780 indx_find+0x434/0x950 fs/ntfs3/index.c:1155 dir_search_u+0x1ac/0x2f0 fs/ntfs3/dir.c:255 ntfs_lookup+0x147/0x1c0 fs/ntfs3/namei.c:91 lookup_open.isra.0+0x5ee/0x15d0 fs/namei.c:3206 open_last_lookups fs/namei.c:3298 [inline] path_openat+0x7e6/0x22c0 fs/namei.c:3504 do_filp_open+0x199/0x3d0 fs/namei.c:3534 do_sys_openat2+0x11e/0x360 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_openat fs/open.c:1236 [inline] __se_sys_openat fs/open.c:1231 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1231 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fef8c95c669 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:00007fef8c0d0168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fef8ca7df80 RCX: 00007fef8c95c669 RDX: 000000000000275a RSI: 00000000200001c0 RDI: ffffffffffffff9c RBP: 00007fef8c9b7560 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdb942248f R14: 00007fef8c0d0300 R15: 0000000000022000 Allocated by task 5833: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xb0/0x6a0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x1fb/0x350 security/tomoyo/file.c:822 security_inode_getattr+0xab/0x100 security/security.c:1332 vfs_getattr fs/stat.c:139 [inline] vfs_statx+0xe8/0x2e0 fs/stat.c:207 vfs_fstatat fs/stat.c:225 [inline] __do_sys_newfstatat+0x7d/0xd0 fs/stat.c:394 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 5833: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1625 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1650 slab_free mm/slub.c:3210 [inline] kfree+0xe4/0x530 mm/slub.c:4264 tomoyo_realpath_from_path+0x14b/0x6a0 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x1fb/0x350 security/tomoyo/file.c:822 security_inode_getattr+0xab/0x100 security/security.c:1332 vfs_getattr fs/stat.c:139 [inline] vfs_statx+0xe8/0x2e0 fs/stat.c:207 vfs_fstatat fs/stat.c:225 [inline] __do_sys_newfstatat+0x7d/0xd0 fs/stat.c:394 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888031e46000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2080 bytes to the right of 4096-byte region [ffff888031e46000, ffff888031e47000) The buggy address belongs to the page: page:ffffea0000c79000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31e40 head:ffffea0000c79000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010442140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4817, ts 17840445206, free_ts 0 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa6f/0x2f50 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2800 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] __kmalloc+0x312/0x330 mm/slub.c:4108 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xb0/0x6a0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x1fb/0x350 security/tomoyo/file.c:822 security_inode_getattr+0xab/0x100 security/security.c:1332 vfs_getattr fs/stat.c:139 [inline] vfs_statx+0xe8/0x2e0 fs/stat.c:207 vfs_fstatat fs/stat.c:225 [inline] __do_sys_newfstatat+0x7d/0xd0 fs/stat.c:394 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page_owner free stack trace missing Memory state around the buggy address: ffff888031e47700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888031e47780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888031e47800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888031e47880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888031e47900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================