==================================================================
BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x70/0x80 net/8021q/vlan_dev.c:789
Read of size 4 at addr ffff88810ce820d0 by task kworker/u4:7/4135

CPU: 0 PID: 4135 Comm: kworker/u4:7 Not tainted 5.15.178-syzkaller-00013-g7d1f9b5c2ff5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: netns cleanup_net
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106
 print_address_description+0x87/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0x179/0x1c0 mm/kasan/report.c:444
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
 vlan_dev_get_iflink+0x70/0x80 net/8021q/vlan_dev.c:789
 dev_get_iflink+0x6f/0xc0 net/core/dev.c:711
 default_operstate net/core/link_watch.c:41 [inline]
 rfc2863_policy+0x127/0x2b0 net/core/link_watch.c:53
 linkwatch_do_dev+0x3c/0x160 net/core/link_watch.c:160
 linkwatch_forget_dev+0x170/0x180 net/core/link_watch.c:238
 netdev_run_todo+0x2ec/0x9f0 net/core/dev.c:10655
 rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
 default_device_exit_batch+0x38f/0x3f0 net/core/dev.c:11652
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599
 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
 kthread+0x421/0x510 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Allocated by task 290:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:433 [inline]
 ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 __kmalloc+0x13f/0x2c0 mm/slub.c:4431
 __kmalloc_node include/linux/slab.h:469 [inline]
 kmalloc_node include/linux/slab.h:626 [inline]
 kvmalloc_node+0x1f0/0x4d0 mm/util.c:628
 kvmalloc include/linux/mm.h:851 [inline]
 kvzalloc include/linux/mm.h:859 [inline]
 alloc_netdev_mqs+0x8c/0xc90 net/core/dev.c:10868
 rtnl_create_link+0x2e1/0x9d0 net/core/rtnetlink.c:3229
 __rtnl_newlink net/core/rtnetlink.c:3511 [inline]
 rtnl_newlink+0x13dc/0x2050 net/core/rtnetlink.c:3569
 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5647
 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2493
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5665
 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline]
 netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1341
 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x564/0x720 net/socket.c:2063
 __do_sys_sendto net/socket.c:2075 [inline]
 __se_sys_sendto net/socket.c:2071 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2071
 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4135:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
 kasan_slab_free include/linux/kasan.h:193 [inline]
 slab_free_hook mm/slub.c:1723 [inline]
 slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
 slab_free mm/slub.c:3521 [inline]
 kfree+0xcc/0x270 mm/slub.c:4583
 kvfree+0x35/0x40 mm/util.c:664
 netdev_freemem+0x3f/0x60 net/core/dev.c:10822
 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1903
 device_release+0x95/0x1c0
 kobject_cleanup lib/kobject.c:713 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x178/0x260 lib/kobject.c:761
 netdev_run_todo+0x869/0x9f0 net/core/dev.c:10678
 rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
 default_device_exit_batch+0x38f/0x3f0 net/core/dev.c:11652
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599
 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
 kthread+0x421/0x510 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88810ce82000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 208 bytes inside of
 4096-byte region [ffff88810ce82000, ffff88810ce83000)
The buggy address belongs to the page:
page:ffffea000433a000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10ce80
head:ffffea000433a000 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 0000000200000001 ffff888100043380
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 290, ts 23731711342, free_ts 23719221983
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780
 allocate_slab mm/slub.c:1932 [inline]
 new_slab+0x9a/0x4e0 mm/slub.c:1995
 ___slab_alloc+0x39e/0x830 mm/slub.c:3028
 __slab_alloc+0x4a/0x90 mm/slub.c:3115
 slab_alloc_node mm/slub.c:3206 [inline]
 slab_alloc mm/slub.c:3250 [inline]
 __kmalloc+0x172/0x2c0 mm/slub.c:4427
 __kmalloc_node include/linux/slab.h:469 [inline]
 kmalloc_node include/linux/slab.h:626 [inline]
 kvmalloc_node+0x1f0/0x4d0 mm/util.c:628
 kvmalloc include/linux/mm.h:851 [inline]
 kvzalloc include/linux/mm.h:859 [inline]
 alloc_netdev_mqs+0x8c/0xc90 net/core/dev.c:10868
 rtnl_create_link+0x2e1/0x9d0 net/core/rtnetlink.c:3229
 __rtnl_newlink net/core/rtnetlink.c:3511 [inline]
 rtnl_newlink+0x13dc/0x2050 net/core/rtnetlink.c:3569
 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5647
 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2493
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5665
 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline]
 netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1341
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1472 [inline]
 free_pcp_prepare mm/page_alloc.c:1544 [inline]
 free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534
 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616
 free_the_page mm/page_alloc.c:805 [inline]
 __free_pages+0x61/0xf0 mm/page_alloc.c:5856
 __free_slab+0xec/0x1d0 mm/slub.c:2020
 free_slab mm/slub.c:2035 [inline]
 discard_slab mm/slub.c:2041 [inline]
 __unfreeze_partials+0x165/0x1a0 mm/slub.c:2527
 put_cpu_partial+0xc4/0x120 mm/slub.c:2607
 __slab_free+0x1c8/0x290 mm/slub.c:3390
 do_slab_free mm/slub.c:3509 [inline]
 ___cache_free+0x109/0x120 mm/slub.c:3530
 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443
 kasan_slab_alloc include/linux/kasan.h:217 [inline]
 slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550
 slab_alloc_node mm/slub.c:3240 [inline]
 slab_alloc mm/slub.c:3250 [inline]
 __kmalloc_track_caller+0x11d/0x2c0 mm/slub.c:4949
 kvasprintf+0xd6/0x180 lib/kasprintf.c:25
 kvasprintf_const+0x5e/0x190 lib/kasprintf.c:49

Memory state around the buggy address:
 ffff88810ce81f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88810ce82000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810ce82080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88810ce82100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810ce82180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================