================================================================== BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x78/0x7c net/8021q/vlan_dev.c:789 Read of size 4 at addr ffff0000e7ebc0d0 by task kworker/u4:1/136 CPU: 1 PID: 136 Comm: kworker/u4:1 Not tainted 5.15.165-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: events_unbound linkwatch_event Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load4_noabort+0x44/0x50 mm/kasan/report_generic.c:308 vlan_dev_get_iflink+0x78/0x7c net/8021q/vlan_dev.c:789 dev_get_iflink+0x70/0xc4 net/core/dev.c:704 default_operstate net/core/link_watch.c:41 [inline] rfc2863_policy net/core/link_watch.c:53 [inline] linkwatch_do_dev+0x100/0x3c8 net/core/link_watch.c:160 __linkwatch_run_queue+0x424/0x730 net/core/link_watch.c:213 linkwatch_event+0x58/0x68 net/core/link_watch.c:252 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 5027: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node+0x2c0/0x5b8 mm/slub.c:4455 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x88/0x204 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] alloc_netdev_mqs+0x94/0x9d4 net/core/dev.c:10844 rtnl_create_link+0x2cc/0x8b4 net/core/rtnetlink.c:3200 __rtnl_newlink net/core/rtnetlink.c:3482 [inline] rtnl_newlink+0x1014/0x1acc net/core/rtnetlink.c:3540 rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5618 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5636 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline] netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1352 netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1920 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x388/0x4d0 net/socket.c:2058 __do_sys_sendto net/socket.c:2070 [inline] __se_sys_sendto net/socket.c:2066 [inline] __arm64_sys_sendto+0xd8/0xf8 net/socket.c:2066 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 4111: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x178/0x410 mm/slub.c:4559 kvfree+0x40/0x50 mm/util.c:654 netdev_freemem+0x4c/0x64 net/core/dev.c:10798 netdev_release+0x88/0xb0 net/core/net-sysfs.c:1903 device_release+0x8c/0x1ac kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2c4/0x438 lib/kobject.c:761 netdev_run_todo+0x968/0xae0 net/core/dev.c:10662 rtnl_unlock+0x14/0x20 net/core/rtnetlink.c:112 default_device_exit_batch+0x4c4/0x520 net/core/dev.c:11628 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x5e0/0x9bc net/core/net_namespace.c:599 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 The buggy address belongs to the object at ffff0000e7ebc000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 208 bytes inside of 4096-byte region [ffff0000e7ebc000, ffff0000e7ebd000) The buggy address belongs to the page: page:000000009017909f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x127eb8 head:000000009017909f order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000cc536201 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000100000001 ffff0000c0003500 raw: 0000000000000000 0000000000040004 00000001ffffffff ffff0000cc536201 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e7ebbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000e7ebc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000e7ebc080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000e7ebc100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e7ebc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_team: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_hsr: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_hsr: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready