================================================================== BUG: KASAN: use-after-free in hdr_find_e+0x255/0x580 fs/ntfs3/index.c:689 Read of size 2 at addr ffff888080b11820 by task syz-executor.5/22133 CPU: 1 PID: 22133 Comm: syz-executor.5 Not tainted 6.1.0-rc5-syzkaller-00307-gfe24a97cf254 #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 hdr_find_e+0x255/0x580 fs/ntfs3/index.c:689 indx_find+0x4ff/0xb20 fs/ntfs3/index.c:1085 dir_search_u+0x161/0x320 fs/ntfs3/dir.c:254 ntfs_lookup+0x112/0x1b0 fs/ntfs3/namei.c:83 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_open fs/open.c:1334 [inline] __se_sys_open fs/open.c:1330 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1330 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:0x7f902228b639 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:00007f9022fe5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f90223ac1f0 RCX: 00007f902228b639 RDX: 0000000000000000 RSI: 0000000000000280 RDI: 0000000020000500 RBP: 00007f90222e6ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc995770bf R14: 00007f9022fe5300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea000202c440 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x80b11 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffffff02020301 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2999, tgid 2999 (udevd), ts 206504736846, free_ts 222737468800 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] __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x9e/0x1a0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] tomoyo_realpath_from_path+0xcd/0x5f0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x227/0x670 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1347 vfs_getattr fs/stat.c:158 [inline] vfs_statx+0x188/0x4a0 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat+0xed/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] kmem_cache_alloc_node+0x1ca/0x340 mm/slub.c:3443 __alloc_skb+0xcf/0x2b0 net/core/skbuff.c:497 alloc_skb_fclone include/linux/skbuff.h:1317 [inline] tcp_stream_alloc_skb+0x3c/0x300 net/ipv4/tcp.c:862 tcp_sendmsg_locked+0xd70/0x40d0 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1483 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] sock_write_iter+0x3d4/0x540 net/socket.c:1108 call_write_iter include/linux/fs.h:2191 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7dc/0xc50 fs/read_write.c:584 ksys_write+0x177/0x2a0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff888080b11700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888080b11780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888080b11800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888080b11880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888080b11900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================