================================================================== BUG: KASAN: use-after-free in hdr_find_e+0x255/0x580 fs/ntfs3/index.c:689 Read of size 2 at addr ffff8880806d3820 by task syz-executor.5/5059 CPU: 1 PID: 5059 Comm: syz-executor.5 Not tainted 6.0.0-syzkaller-09423-g493ffd6605b2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x1f0 mm/kasan/report.c:433 kasan_report+0xc3/0xf0 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:3688 do_filp_open+0x264/0x4f0 fs/namei.c:3718 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 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 RIP: 0033:0x7f89f4e8b5a9 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:00007f89f3dfe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f89f4fac050 RCX: 00007f89f4e8b5a9 RDX: 000000000000275a RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f89f4ee6580 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffef0dce70f R14: 00007f89f3dfe300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea000201b400 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x806d0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001fde808 ffff8880b9a40420 0000000000000000 raw: 0000000000000000 0000000000070000 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2971, tgid 2971 (udevd), ts 112173428092, free_ts 116062656300 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x3ee/0xc40 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] __kmalloc_node_track_caller+0x2c3/0x400 mm/slub.c:4964 kmalloc_reserve net/core/skbuff.c:437 [inline] __alloc_skb+0x112/0x2b0 net/core/skbuff.c:509 alloc_skb include/linux/skbuff.h:1265 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:742 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:799 [inline] nsim_dev_trap_report_work+0x267/0xad0 drivers/net/netdevsim/dev.c:844 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3476 free_slab mm/slub.c:2073 [inline] discard_slab mm/slub.c:2079 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2553 put_cpu_partial+0x106/0x170 mm/slub.c:2629 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3248 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc+0x1a6/0x310 mm/slub.c:3273 btrfs_get_root_ref+0x70f/0xe00 fs/btrfs/disk-io.c:1677 btrfs_get_fs_root fs/btrfs/disk-io.c:1725 [inline] open_ctree+0x288e/0x2ead fs/btrfs/disk-io.c:3781 btrfs_fill_super+0x1c6/0x2d0 fs/btrfs/super.c:1461 btrfs_mount_root+0x885/0x9a0 fs/btrfs/super.c:1829 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1530 fc_mount fs/namespace.c:1043 [inline] vfs_kern_mount+0xc9/0x160 fs/namespace.c:1073 btrfs_mount+0x3d3/0xbb0 fs/btrfs/super.c:1889 Memory state around the buggy address: ffff8880806d3700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880806d3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880806d3800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880806d3880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880806d3900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================