================================================================== BUG: KASAN: use-after-free in mi_enum_attr+0x365/0x480 fs/ntfs3/record.c:227 Read of size 4 at addr ffff88800c7d9b45 by task syz-executor.2/3809 CPU: 1 PID: 3809 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller #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+0xf4/0x251 lib/dump_stack.c:106 print_address_description+0x62/0x350 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:450 mi_enum_attr+0x365/0x480 fs/ntfs3/record.c:227 mi_find_attr+0x54/0x200 fs/ntfs3/record.c:296 ni_find_attr+0x46c/0x680 fs/ntfs3/frecord.c:217 ntfs_readlink_hlp+0xa2/0x960 fs/ntfs3/inode.c:1782 ntfs_get_link+0x68/0xe0 fs/ntfs3/inode.c:1923 pick_link+0x4f2/0xb70 step_into+0x918/0xc20 fs/namei.c:1826 open_last_lookups fs/namei.c:3373 [inline] path_openat+0x14ed/0x2700 fs/namei.c:3556 do_filp_open+0x208/0x400 fs/namei.c:3586 do_sys_openat2+0x10b/0x430 fs/open.c:1212 do_sys_open fs/open.c:1228 [inline] __do_sys_open fs/open.c:1236 [inline] __se_sys_open fs/open.c:1232 [inline] __x64_sys_open+0x1eb/0x240 fs/open.c:1232 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x45/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7ff7fe900da9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff7fe4620c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ff7fea30050 RCX: 00007ff7fe900da9 RDX: 0000000000000065 RSI: 0000000000000080 RDI: 0000000020000440 RBP: 00007ff7fe94d47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000006 R14: 00007ff7fea30050 R15: 00007fff5b205b78 Allocated by task 3767: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0xb1/0xf0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook+0x54/0x2f0 mm/slab.h:519 slab_alloc_node mm/slub.c:3234 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc+0x107/0x2a0 mm/slub.c:3247 getname_flags+0x9c/0x430 fs/namei.c:138 getname fs/namei.c:217 [inline] __do_sys_renameat fs/namei.c:4817 [inline] __se_sys_renameat fs/namei.c:4814 [inline] __x64_sys_renameat+0x9f/0xc0 fs/namei.c:4814 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x45/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3767: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x102/0x140 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x12c/0x1a0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kmem_cache_free+0xc8/0x1f0 mm/slub.c:3530 putname fs/namei.c:270 [inline] do_renameat2+0xfe3/0x1140 fs/namei.c:4803 __do_sys_renameat fs/namei.c:4817 [inline] __se_sys_renameat fs/namei.c:4814 [inline] __x64_sys_renameat+0xb3/0xc0 fs/namei.c:4814 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x45/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88800c7d9100 which belongs to the cache names_cache of size 4096 The buggy address is located 2629 bytes inside of 4096-byte region [ffff88800c7d9100, ffff88800c7da100) The buggy address belongs to the page: page:ffffea000031f600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc7d8 head:ffffea000031f600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8881400073c0 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1088, ts 48990608652, free_ts 48976482592 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x3191/0x3340 mm/page_alloc.c:4149 __alloc_pages+0x277/0x700 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x9c/0x440 mm/slub.c:1993 ___slab_alloc+0x5c1/0xac0 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc+0x19e/0x2a0 mm/slub.c:3247 getname_flags+0x9c/0x430 fs/namei.c:138 user_path_at_empty+0x1e/0x140 fs/namei.c:2800 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0xe3/0x320 fs/stat.c:221 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat fs/stat.c:412 [inline] __se_sys_newfstatat+0xc4/0x730 fs/stat.c:406 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x45/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare mm/page_alloc.c:1389 [inline] free_unref_page_prepare+0xb5f/0xc10 mm/page_alloc.c:3309 free_unref_page+0x95/0x280 mm/page_alloc.c:3388 free_slab mm/slub.c:2033 [inline] discard_slab mm/slub.c:2039 [inline] __unfreeze_partials+0x1af/0x210 mm/slub.c:2527 put_cpu_partial+0xdc/0x120 mm/slub.c:2603 do_slab_free mm/slub.c:3501 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3520 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x162/0x190 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook+0x54/0x2f0 mm/slab.h:519 slab_alloc_node mm/slub.c:3234 [inline] slab_alloc mm/slub.c:3242 [inline] __kmalloc+0x130/0x320 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] load_elf_phdrs fs/binfmt_elf.c:480 [inline] load_elf_binary+0x23a/0x2240 fs/binfmt_elf.c:860 search_binary_handler fs/exec.c:1723 [inline] exec_binprm fs/exec.c:1764 [inline] bprm_execve+0x785/0x1230 fs/exec.c:1833 kernel_execve+0x657/0x720 fs/exec.c:1976 call_usermodehelper_exec_async+0x1fc/0x310 kernel/umh.c:112 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff88800c7d9a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800c7d9a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88800c7d9b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88800c7d9b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800c7d9c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================