================================================================== BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:577 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x147/0x1350 kernel/locking/mutex.c:760 Read of size 8 at addr ffff88807b28e8b0 by task kworker/u8:9/3015 CPU: 1 UID: 0 PID: 3015 Comm: kworker/u8:9 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: udp_tunnel_nic udp_tunnel_nic_device_sync_work Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __mutex_lock_common kernel/locking/mutex.c:577 [inline] __mutex_lock+0x147/0x1350 kernel/locking/mutex.c:760 udp_tunnel_nic_device_sync_work+0x39/0xa50 net/ipv4/udp_tunnel_nic.c:737 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 13: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5627 [inline] __kmalloc_noprof+0x411/0x7f0 mm/slub.c:5639 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] udp_tunnel_nic_alloc net/ipv4/udp_tunnel_nic.c:756 [inline] udp_tunnel_nic_register net/ipv4/udp_tunnel_nic.c:833 [inline] udp_tunnel_nic_netdevice_event+0x4c3/0x1810 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11332 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1059 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1141 __nsim_dev_port_add+0x6b6/0xb10 drivers/net/netdevsim/dev.c:1438 nsim_dev_port_add_all+0x37/0xf0 drivers/net/netdevsim/dev.c:1494 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1546 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:1003 devlink_reload+0x4ec/0x8d0 net/devlink/dev.c:474 devlink_pernet_pre_exit+0x1d9/0x3d0 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0x990 net/core/net_namespace.c:234 cleanup_net+0x4d8/0x820 net/core/net_namespace.c:695 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 16778: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2523 [inline] slab_free mm/slub.c:6611 [inline] kfree+0x19a/0x6d0 mm/slub.c:6818 udp_tunnel_nic_free net/ipv4/udp_tunnel_nic.c:785 [inline] udp_tunnel_nic_unregister net/ipv4/udp_tunnel_nic.c:910 [inline] udp_tunnel_nic_netdevice_event+0x11ab/0x1810 net/ipv4/udp_tunnel_nic.c:942 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] unregister_netdevice_many_notify+0x1860/0x2390 net/core/dev.c:12284 unregister_netdevice_many net/core/dev.c:12347 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12161 unregister_netdevice include/linux/netdevice.h:3389 [inline] nsim_destroy+0x1dd/0x670 drivers/net/netdevsim/netdev.c:1178 __nsim_dev_port_del+0x14d/0x1b0 drivers/net/netdevsim/dev.c:1473 nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1485 [inline] nsim_dev_reload_destroy+0x288/0x490 drivers/net/netdevsim/dev.c:1707 nsim_drv_remove+0x58/0x160 drivers/net/netdevsim/dev.c:1722 device_remove drivers/base/dd.c:569 [inline] __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x46f/0x800 drivers/base/dd.c:1297 bus_remove_device+0x34d/0x410 drivers/base/bus.c:579 device_del+0x511/0x8e0 drivers/base/core.c:3878 device_unregister+0x20/0xc0 drivers/base/core.c:3919 nsim_bus_dev_del drivers/net/netdevsim/bus.c:483 [inline] del_device_store+0x2aa/0x360 drivers/net/netdevsim/bus.c:244 kernfs_fop_write_iter+0x3af/0x540 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5c9/0xb30 fs/read_write.c:686 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:559 insert_work+0x3d/0x330 kernel/workqueue.c:2186 __queue_work+0xbaf/0xfb0 kernel/workqueue.c:2345 queue_work_on+0x181/0x270 kernel/workqueue.c:2392 queue_work include/linux/workqueue.h:669 [inline] udp_tunnel_nic_device_sync net/ipv4/udp_tunnel_nic.c:307 [inline] __udp_tunnel_nic_add_port+0xb71/0xd60 net/ipv4/udp_tunnel_nic.c:523 udp_tunnel_nic_add_port include/net/udp_tunnel.h:371 [inline] udp_tunnel_push_rx_port+0x180/0x200 net/ipv4/udp_tunnel_core.c:112 geneve_offload_rx_ports+0xd7/0x160 drivers/net/geneve.c:1190 geneve_netdevice_event+0x6a/0x80 drivers/net/geneve.c:-1 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers+0x88/0xc0 net/core/dev.c:2281 udp_tunnel_get_rx_info include/net/udp_tunnel.h:438 [inline] udp_tunnel_nic_register net/ipv4/udp_tunnel_nic.c:855 [inline] udp_tunnel_nic_netdevice_event+0xdff/0x1810 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11332 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1059 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1141 __nsim_dev_port_add+0x6b6/0xb10 drivers/net/netdevsim/dev.c:1438 nsim_dev_port_add_all+0x37/0xf0 drivers/net/netdevsim/dev.c:1494 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1546 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:1003 devlink_reload+0x4ec/0x8d0 net/devlink/dev.c:474 devlink_pernet_pre_exit+0x1d9/0x3d0 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0x990 net/core/net_namespace.c:234 cleanup_net+0x4d8/0x820 net/core/net_namespace.c:695 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:559 insert_work+0x3d/0x330 kernel/workqueue.c:2186 __queue_work+0xcd2/0xfb0 kernel/workqueue.c:2341 queue_work_on+0x181/0x270 kernel/workqueue.c:2392 queue_work include/linux/workqueue.h:669 [inline] udp_tunnel_nic_device_sync net/ipv4/udp_tunnel_nic.c:307 [inline] __udp_tunnel_nic_add_port+0xb71/0xd60 net/ipv4/udp_tunnel_nic.c:523 udp_tunnel_nic_add_port include/net/udp_tunnel.h:371 [inline] udp_tunnel_push_rx_port+0x180/0x200 net/ipv4/udp_tunnel_core.c:112 vxlan_offload_rx_ports+0x139/0x200 drivers/net/vxlan/vxlan_core.c:3317 vxlan_netdevice_event+0x111/0x470 drivers/net/vxlan/vxlan_core.c:-1 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers+0x88/0xc0 net/core/dev.c:2281 udp_tunnel_get_rx_info include/net/udp_tunnel.h:438 [inline] udp_tunnel_nic_register net/ipv4/udp_tunnel_nic.c:855 [inline] udp_tunnel_nic_netdevice_event+0xdff/0x1810 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11332 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1059 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1141 __nsim_dev_port_add+0x6b6/0xb10 drivers/net/netdevsim/dev.c:1438 nsim_dev_port_add_all+0x37/0xf0 drivers/net/netdevsim/dev.c:1494 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1546 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:1003 devlink_reload+0x4ec/0x8d0 net/devlink/dev.c:474 devlink_pernet_pre_exit+0x1d9/0x3d0 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0x990 net/core/net_namespace.c:234 cleanup_net+0x4d8/0x820 net/core/net_namespace.c:695 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88807b28e800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 176 bytes inside of freed 256-byte region [ffff88807b28e800, ffff88807b28e900) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b28e head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88813ffa6b40 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88813ffa6b40 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001eca381 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5843, tgid 5843 (syz-executor), ts 92494753977, free_ts 92372834301 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3039 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3212 new_slab mm/slub.c:3266 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4636 __slab_alloc+0x65/0x100 mm/slub.c:4755 __slab_alloc_node mm/slub.c:4831 [inline] slab_alloc_node mm/slub.c:5253 [inline] __kmalloc_cache_noprof+0x411/0x6f0 mm/slub.c:5743 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] ____ip_mc_inc_group+0x528/0xde0 net/ipv4/igmp.c:1535 __ip_mc_inc_group net/ipv4/igmp.c:1573 [inline] ip_mc_inc_group net/ipv4/igmp.c:1579 [inline] ip_mc_up+0x125/0x300 net/ipv4/igmp.c:1880 inetdev_event+0xfb3/0x15b0 net/ipv4/devinet.c:1630 notifier_call_chain+0x1b6/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] __dev_notify_flags+0x18d/0x2e0 net/core/dev.c:-1 netif_change_flags+0xe8/0x1a0 net/core/dev.c:9705 do_setlink+0xc55/0x41c0 net/core/rtnetlink.c:3151 rtnl_changelink net/core/rtnetlink.c:3769 [inline] __rtnl_newlink net/core/rtnetlink.c:3928 [inline] rtnl_newlink+0x1619/0x1c80 net/core/rtnetlink.c:4065 page last free pid 5826 tgid 5826 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __slab_free+0x2e7/0x390 mm/slub.c:5947 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4955 [inline] slab_alloc_node mm/slub.c:5265 [inline] kmem_cache_alloc_node_noprof+0x433/0x710 mm/slub.c:5317 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:660 netlink_sendmsg+0x5c6/0xb30 net/netlink/af_netlink.c:1871 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 __sys_sendto+0x3bd/0x520 net/socket.c:2244 __do_sys_sendto net/socket.c:2251 [inline] __se_sys_sendto net/socket.c:2247 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2247 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807b28e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b28e800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807b28e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807b28e900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b28e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================