8021q: adding VLAN 0 to HW filter on device bond1 ================================================================== BUG: KASAN: slab-use-after-free in team_device_event+0xa3b/0xad0 drivers/net/team/team.c:3021 Read of size 8 at addr ffff8881451f1e68 by task syz-executor.0/12055 CPU: 0 PID: 12055 Comm: syz-executor.0 Not tainted 6.5.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 team_device_event+0xa3b/0xad0 drivers/net/team/team.c:3021 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] netdev_features_change net/core/dev.c:1333 [inline] netdev_update_features net/core/dev.c:9874 [inline] netdev_update_features net/core/dev.c:9871 [inline] dev_disable_lro+0x224/0x3e0 net/core/dev.c:1606 team_port_add drivers/net/team/team.c:1248 [inline] team_add_slave+0x1a4d/0x2310 drivers/net/team/team.c:1977 do_set_master+0x1bc/0x220 net/core/rtnetlink.c:2674 do_setlink+0xa07/0x3fa0 net/core/rtnetlink.c:2873 __rtnl_newlink+0xc1d/0x1940 net/core/rtnetlink.c:3671 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3718 rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:728 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:751 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2539 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2593 __sys_sendmsg+0x117/0x1e0 net/socket.c:2622 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f714b47cae9 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:00007f714c1fa0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f714b59bf80 RCX: 00007f714b47cae9 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000007 RBP: 00007f714b4c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f714b59bf80 R15: 00007ffd8633d628 Allocated by task 9696: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc_node_track_caller+0x5e/0x100 mm/slab_common.c:1005 kstrdup+0x3c/0x70 mm/util.c:62 kstrdup_const+0x5f/0x70 mm/util.c:85 __kernfs_new_node+0x9c/0x8a0 fs/kernfs/dir.c:607 kernfs_new_node fs/kernfs/dir.c:675 [inline] kernfs_create_dir_ns+0x9a/0x210 fs/kernfs/dir.c:1036 sysfs_create_dir_ns+0x13b/0x2a0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:65 [inline] kobject_add_internal+0x2c8/0x990 lib/kobject.c:233 kobject_add_varg lib/kobject.c:367 [inline] kobject_add+0x16f/0x240 lib/kobject.c:419 device_add+0x2b3/0x1b40 drivers/base/core.c:3563 netdev_register_kobject+0x17f/0x3a0 net/core/net-sysfs.c:2044 register_netdevice+0xbcb/0x1490 net/core/dev.c:10136 macsec_newlink+0x4ca/0x1a30 drivers/net/macsec.c:4079 rtnl_newlink_create net/core/rtnetlink.c:3485 [inline] __rtnl_newlink+0x1177/0x1940 net/core/rtnetlink.c:3705 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3718 rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6444 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:728 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:751 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2539 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2593 __sys_sendmsg+0x117/0x1e0 net/socket.c:2622 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8881451f1e60 which belongs to the cache kmalloc-16 of size 16 The buggy address is located 8 bytes inside of freed 16-byte region [ffff8881451f1e60, ffff8881451f1e70) The buggy address belongs to the physical page: page:ffffea0005147c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1451f1 flags: 0x100000000000200(slab|node=0|zone=2) page_type: 0xffffffff() raw: 0100000000000200 ffff8881000413c0 ffffea00048cf4c0 dead000000000002 raw: 0000000000000000 0000000080800080 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 9678, tgid 9677 (syz-executor.0), ts 171965912820, free_ts 171941103315 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node_track_caller+0x4d/0x100 mm/slab_common.c:1005 kstrdup+0x3c/0x70 mm/util.c:62 kstrdup_const+0x5f/0x70 mm/util.c:85 __kernfs_new_node+0x9c/0x8a0 fs/kernfs/dir.c:607 kernfs_new_node fs/kernfs/dir.c:675 [inline] kernfs_create_dir_ns+0x9a/0x210 fs/kernfs/dir.c:1036 sysfs_create_dir_ns+0x13b/0x2a0 fs/sysfs/dir.c:59 create_dir lib/kobject.c:65 [inline] kobject_add_internal+0x2c8/0x990 lib/kobject.c:233 kobject_add_varg lib/kobject.c:367 [inline] kobject_add+0x16f/0x240 lib/kobject.c:419 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x4f7/0xb80 mm/page_alloc.c:2348 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2489 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x2db/0x960 mm/mmap.c:3215 __mmput+0x12a/0x4d0 kernel/fork.c:1356 mmput+0x62/0x70 kernel/fork.c:1378 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1033 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8881451f1d00: fb fb fc fc fb fb fc fc fb fb fc fc fa fb fc fc ffff8881451f1d80: 00 01 fc fc 00 04 fc fc fb fb fc fc fb fb fc fc >ffff8881451f1e00: fb fb fc fc fb fb fc fc 00 00 fc fc fb fb fc fc ^ ffff8881451f1e80: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ffff8881451f1f00: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ==================================================================