================================================================== BUG: KASAN: slab-out-of-bounds in dsa_user_to_port net/dsa/user.h:58 [inline] BUG: KASAN: slab-out-of-bounds in dsa_user_changeupper+0x61a/0x6e0 net/dsa/user.c:2832 Read of size 8 at addr ffff88807bdd6c90 by task syz-executor.0/5146 CPU: 1 PID: 5146 Comm: syz-executor.0 Not tainted 6.7.0-rc3-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+0x8e/0xf0 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 dsa_user_to_port net/dsa/user.h:58 [inline] dsa_user_changeupper+0x61a/0x6e0 net/dsa/user.c:2832 dsa_user_netdevice_event+0xd04/0x3480 net/dsa/user.c:3368 notifier_call_chain+0xb6/0x330 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1966 [inline] call_netdevice_notifiers_info net/core/dev.c:1951 [inline] __netdev_upper_dev_link+0x562/0x8f0 net/core/dev.c:7753 netdev_upper_dev_link+0x92/0xc0 net/core/dev.c:7794 register_vlan_dev+0x246/0x590 net/8021q/vlan.c:183 register_vlan_device net/8021q/vlan.c:277 [inline] vlan_ioctl_handler+0x9e3/0xba0 net/8021q/vlan.c:621 sock_ioctl+0x496/0x690 net/socket.c:1303 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fdc11e7cce9 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:00007fdc12bc40c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdc11f9bf80 RCX: 00007fdc11e7cce9 RDX: 0000000020000380 RSI: 0000000000008982 RDI: 0000000000000003 RBP: 00007fdc11ec947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000006 R14: 00007fdc11f9bf80 R15: 00007ffd44e71b78 Allocated by task 4592: 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:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc_node+0x63/0x160 mm/slab_common.c:1014 kmalloc_node include/linux/slab.h:620 [inline] kvmalloc_node+0x99/0x170 mm/util.c:617 kvmalloc include/linux/slab.h:738 [inline] kvzalloc include/linux/slab.h:746 [inline] alloc_netdev_mqs+0xb3/0x1290 net/core/dev.c:10820 rtnl_create_link+0xbe0/0xf00 net/core/rtnetlink.c:3385 rtnl_newlink_create net/core/rtnetlink.c:3511 [inline] __rtnl_newlink+0x1111/0x19e0 net/core/rtnetlink.c:3741 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3754 rtnetlink_rcv_msg+0x461/0xba0 net/core/rtnetlink.c:6558 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2544 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x683/0x930 net/netlink/af_netlink.c:1367 netlink_sendmsg+0x8ad/0xd50 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88807bdd6000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 1 bytes to the right of allocated 3215-byte region [ffff88807bdd6000, ffff88807bdd6c8f) The buggy address belongs to the physical page: page:ffffea0001ef7400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7bdd0 head:ffffea0001ef7400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888019ea2701 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88800f84f500 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888019ea2701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated 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 4592, tgid 4592 (syz-executor.0), ts 86229689396, free_ts 86209738623 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x27f/0x2f0 mm/page_alloc.c:1544 prep_new_page mm/page_alloc.c:1551 [inline] get_page_from_freelist+0x10ca/0x36e0 mm/page_alloc.c:3319 __alloc_pages+0x1d0/0x470 mm/page_alloc.c:4575 alloc_pages_mpol+0x258/0x5e0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x24b/0x360 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8ce/0x10e0 mm/slub.c:3223 __slab_alloc.constprop.0+0x4d/0x90 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x150/0x350 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node_track_caller+0x50/0x160 mm/slab_common.c:1027 kmemdup+0x29/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:761 [inline] __devinet_sysctl_register+0xbc/0x2a0 net/ipv4/devinet.c:2595 devinet_sysctl_register net/ipv4/devinet.c:2647 [inline] devinet_sysctl_register+0x165/0x220 net/ipv4/devinet.c:2637 inetdev_init+0x26e/0x500 net/ipv4/devinet.c:286 inetdev_event+0x1068/0x14c0 net/ipv4/devinet.c:1555 notifier_call_chain+0xb6/0x330 kernel/notifier.c:93 call_netdevice_notifiers_info net/core/dev.c:1966 [inline] call_netdevice_notifiers_info net/core/dev.c:1951 [inline] call_netdevice_notifiers_extack net/core/dev.c:2004 [inline] call_netdevice_notifiers net/core/dev.c:2018 [inline] register_netdevice+0x15a5/0x1c30 net/core/dev.c:10288 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1144 [inline] free_unref_page_prepare+0x5b6/0xc60 mm/page_alloc.c:2354 free_unref_page+0x33/0x350 mm/page_alloc.c:2494 __unfreeze_partials+0x1f3/0x210 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x1b0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x1bd/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xb0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ref_tracker_alloc+0x129/0x510 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4141 [inline] netdev_hold include/linux/netdevice.h:4170 [inline] netdev_hold include/linux/netdevice.h:4165 [inline] rx_queue_add_kobject net/core/net-sysfs.c:1085 [inline] net_rx_queue_update_kobjects+0x27f/0x5e0 net/core/net-sysfs.c:1143 register_queue_kobjects net/core/net-sysfs.c:1803 [inline] netdev_register_kobject+0x269/0x3e0 net/core/net-sysfs.c:2048 register_netdevice+0x10eb/0x1c30 net/core/dev.c:10255 bond_newlink drivers/net/bonding/bond_netlink.c:565 [inline] bond_newlink+0x48/0x90 drivers/net/bonding/bond_netlink.c:555 rtnl_newlink_create net/core/rtnetlink.c:3521 [inline] __rtnl_newlink+0x11fa/0x19e0 net/core/rtnetlink.c:3741 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3754 rtnetlink_rcv_msg+0x461/0xba0 net/core/rtnetlink.c:6558 Memory state around the buggy address: ffff88807bdd6b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807bdd6c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807bdd6c80: 00 07 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807bdd6d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807bdd6d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================