ntfs3: loop4: Failed to load $Extend. ================================================================== BUG: KASAN: use-after-free in memcmp lib/string.c:765 [inline] BUG: KASAN: use-after-free in bcmp+0xbe/0x1e0 lib/string.c:797 Read of size 8 at addr ffff8880272d9e40 by task syz-executor.4/22316 CPU: 1 PID: 22316 Comm: syz-executor.4 Not tainted 6.1.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 memcmp lib/string.c:765 [inline] bcmp+0xbe/0x1e0 lib/string.c:797 _Z6memcmpPKvU17pass_object_size0S0_U17pass_object_size0m include/linux/fortify-string.h:549 [inline] ntfs_read_mft fs/ntfs3/inode.c:253 [inline] ntfs_iget5+0x1101/0x36f0 fs/ntfs3/inode.c:501 ntfs_fill_super+0x3eab/0x42a0 fs/ntfs3/super.c:1262 get_tree_bdev+0x400/0x620 fs/super.c:1324 vfs_get_tree+0x88/0x270 fs/super.c:1531 do_new_mount+0x289/0xad0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2d3/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:0x7f3bf488cb6a 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:00007f3bf5545f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000bc0 RCX: 00007f3bf488cb6a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f3bf5545fe0 RBP: 00007f3bf5546020 R08: 00007f3bf5546020 R09: 0000000020000000 R10: 0000000000000002 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f3bf5545fe0 R15: 0000000020003580 Allocated by task 3000: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1cc/0x300 mm/slub.c:3422 getname_flags+0xb8/0x4e0 fs/namei.c:139 do_sys_openat2+0xba/0x4e0 fs/open.c:1304 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1337 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 Freed by task 3000: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:511 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x94/0x1d0 mm/slub.c:3683 do_sys_openat2+0x417/0x4e0 fs/open.c:1319 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1337 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 The buggy address belongs to the object at ffff8880272d9100 which belongs to the cache names_cache of size 4096 The buggy address is located 3392 bytes inside of 4096-byte region [ffff8880272d9100, ffff8880272da100) The buggy address belongs to the physical page: page:ffffea00009cb600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x272d8 head:ffffea00009cb600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888140040640 raw: 0000000000000000 0000000000070007 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3000, tgid 3000 (udevd), ts 388453686087, free_ts 388424163009 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4288 __alloc_pages+0x259/0x560 mm/page_alloc.c:5555 alloc_slab_page+0x70/0xf0 mm/slub.c:1794 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x782/0xe20 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x24c/0x300 mm/slub.c:3422 getname_flags+0xb8/0x4e0 fs/namei.c:139 vfs_fstatat fs/stat.c:266 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat+0xcb/0x7d0 fs/stat.c:431 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3483 free_slab mm/slub.c:2031 [inline] discard_slab mm/slub.c:2037 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2586 put_cpu_partial+0x106/0x170 mm/slub.c:2662 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x180/0x2e0 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3117 [inline] shmem_alloc_inode+0x21/0x40 mm/shmem.c:3853 alloc_inode fs/inode.c:259 [inline] new_inode_pseudo+0x61/0x1d0 fs/inode.c:1018 new_inode+0x25/0x1d0 fs/inode.c:1046 shmem_get_inode+0x321/0xc30 mm/shmem.c:2329 shmem_mknod+0x54/0x1b0 mm/shmem.c:2910 lookup_open fs/namei.c:3413 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x12d0/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 Memory state around the buggy address: ffff8880272d9d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880272d9d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880272d9e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880272d9e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880272d9f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================