================================================================== BUG: KASAN: slab-out-of-bounds in hdr_find_e.isra.0+0x527/0x590 fs/ntfs3/index.c:689 Read of size 2 at addr ffff888024ab3820 by task syz-executor.3/6988 CPU: 2 PID: 6988 Comm: syz-executor.3 Not tainted 6.1.0-rc2-syzkaller-00107-g200204f56f3b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x461 mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 hdr_find_e.isra.0+0x527/0x590 fs/ntfs3/index.c:689 indx_find+0x4ff/0x980 fs/ntfs3/index.c:1085 dir_search_u+0x232/0x3f0 fs/ntfs3/dir.c:254 ntfs_lookup+0x174/0x1e0 fs/ntfs3/namei.c:83 lookup_open.isra.0+0x76a/0x12a0 fs/namei.c:3391 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x996/0x2860 fs/namei.c:3710 do_filp_open+0x1b6/0x400 fs/namei.c:3740 do_sys_openat2+0x16d/0x4c0 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+0x13f/0x1f0 fs/open.c:1337 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb2f148b5a9 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:00007fb2f2111168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fb2f15abf80 RCX: 00007fb2f148b5a9 RDX: 000000000000275a RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007fb2f14e67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd6479c9df R14: 00007fb2f2111300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea000092a800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24aa0 head:ffffea000092a800 order:5 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010000(head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 5, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 3706, tgid 3706 (syz-executor.0), ts 271008623760, free_ts 87632840316 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287 __alloc_pages_slowpath.constprop.0+0x36b/0x23d0 mm/page_alloc.c:5088 __alloc_pages+0x4a6/0x5a0 mm/page_alloc.c:5567 __alloc_pages_node include/linux/gfp.h:223 [inline] alloc_pages_node include/linux/gfp.h:246 [inline] __kmalloc_large_node+0x6a/0x130 mm/slab_common.c:1098 __do_kmalloc_node mm/slab_common.c:943 [inline] __kmalloc_node+0x88/0xc0 mm/slab_common.c:962 kmalloc_node include/linux/slab.h:602 [inline] kvmalloc_node+0xa6/0x1b0 mm/util.c:581 kvmalloc include/linux/slab.h:729 [inline] wg_index_hashtable_alloc+0x1f/0xb0 drivers/net/wireguard/peerlookup.c:85 wg_newlink+0x188/0x8f0 drivers/net/wireguard/device.c:329 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3581 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 __sys_sendto+0x236/0x340 net/socket.c:2117 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3360 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3423 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x5f/0x80 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/slab.c:3257 [inline] kmem_cache_alloc_node+0x287/0x580 mm/slab.c:3537 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:497 alloc_skb_fclone include/linux/skbuff.h:1317 [inline] tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:862 tcp_sendmsg_locked+0xc4b/0x2960 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1483 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:825 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2191 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:584 Memory state around the buggy address: ffff888024ab3700: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff888024ab3780: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe >ffff888024ab3800: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ^ ffff888024ab3880: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff888024ab3900: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ==================================================================