================================================================== BUG: KASAN: slab-use-after-free in v9fs_stat2inode_dotl+0xb3f/0xce0 fs/9p/vfs_inode_dotl.c:569 Read of size 8 at addr ffff88803d12f800 by task syz-executor.1/25449 CPU: 1 PID: 25449 Comm: syz-executor.1 Not tainted 6.9.0-rc1-syzkaller-00009-g7033999ecd7b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 v9fs_stat2inode_dotl+0xb3f/0xce0 fs/9p/vfs_inode_dotl.c:569 v9fs_fid_iget_dotl+0x1cb/0x260 fs/9p/vfs_inode_dotl.c:85 v9fs_get_inode_from_fid fs/9p/v9fs.h:230 [inline] v9fs_mount+0x515/0xa90 fs/9p/vfs_super.c:142 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f527687dda9 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:00007f52775950c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f52769abf80 RCX: 00007f527687dda9 RDX: 0000000020000100 RSI: 00000000200000c0 RDI: 0000000020000080 RBP: 00007f52768ca47a R08: 0000000020000180 R09: 0000000000000000 R10: 0000000000000801 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f52769abf80 R15: 00007fff285eae78 Allocated by task 25449: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc include/linux/slab.h:628 [inline] p9_client_getattr_dotl+0x4c/0x1e0 net/9p/client.c:1726 v9fs_fid_iget_dotl+0xe7/0x260 fs/9p/vfs_inode_dotl.c:73 v9fs_get_inode_from_fid fs/9p/v9fs.h:230 [inline] v9fs_mount+0x515/0xa90 fs/9p/vfs_super.c:142 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Freed by task 25449: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 v9fs_fid_iget_dotl+0x195/0x260 fs/9p/vfs_inode_dotl.c:81 v9fs_get_inode_from_fid fs/9p/v9fs.h:230 [inline] v9fs_mount+0x515/0xa90 fs/9p/vfs_super.c:142 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1797 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88803d12f800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of freed 192-byte region [ffff88803d12f800, ffff88803d12f8c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3d12f flags: 0xfff80000000800(slab|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000800 ffff888015442a00 ffffea00006be5c0 dead000000000002 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 9150, tgid 9150 (syz-executor.3), ts 109054090932, free_ts 109051243184 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node_track_caller+0x367/0x470 mm/slub.c:3986 kmemdup+0x29/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:738 [inline] neigh_parms_alloc+0x82/0x5d0 net/core/neighbour.c:1716 ipv6_add_dev+0x2fc/0x1400 net/ipv6/addrconf.c:398 addrconf_notify+0x546/0x19e0 net/ipv6/addrconf.c:3650 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x15f5/0x1ca0 net/core/dev.c:10310 cfg80211_register_netdevice+0x149/0x340 net/wireless/core.c:1437 ieee80211_if_add+0xe0c/0x1b40 net/mac80211/iface.c:2211 page last free pid 9150 tgid 9150 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 selinux_genfs_get_sid security/selinux/hooks.c:1343 [inline] inode_doinit_with_dentry+0xac4/0x12c0 security/selinux/hooks.c:1541 selinux_d_instantiate+0x26/0x30 security/selinux/hooks.c:6345 security_d_instantiate+0x57/0xf0 security/security.c:3915 d_instantiate+0x5c/0x90 fs/dcache.c:1878 __debugfs_create_file+0x240/0x620 fs/debugfs/inode.c:452 add_link_files+0xef/0x110 net/mac80211/debugfs_netdev.c:993 ieee80211_debugfs_add_netdev net/mac80211/debugfs_netdev.c:1014 [inline] ieee80211_debugfs_recreate_netdev+0xebb/0x1700 net/mac80211/debugfs_netdev.c:1045 ieee80211_if_add+0xb50/0x1b40 net/mac80211/iface.c:2185 ieee80211_register_hw+0x3dc9/0x43b0 net/mac80211/main.c:1575 mac80211_hwsim_new_radio+0x22ba/0x4e10 drivers/net/wireless/virtual/mac80211_hwsim.c:5454 hwsim_new_radio_nl+0xaf9/0x1240 drivers/net/wireless/virtual/mac80211_hwsim.c:6135 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1113 genl_family_rcv_msg net/netlink/genetlink.c:1193 [inline] genl_rcv_msg+0x56c/0x810 net/netlink/genetlink.c:1208 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2559 Memory state around the buggy address: ffff88803d12f700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803d12f780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88803d12f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803d12f880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88803d12f900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================