================================================================== 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 ffff888075f508b0 by task kworker/u8:20/13359 CPU: 1 UID: 0 PID: 13359 Comm: kworker/u8:20 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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:3236 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 14057: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [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+0x854/0x19f0 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b3/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:11244 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1034 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1105 __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+0x4e9/0x8d0 net/devlink/dev.c:474 devlink_nl_reload_doit+0xb35/0xd50 net/devlink/dev.c:584 genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 14054: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x18e/0x440 mm/slub.c:4879 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+0x1332/0x19f0 net/ipv4/udp_tunnel_nic.c:942 notifier_call_chain+0x1b3/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+0x14d7/0x1ff0 net/core/dev.c:12166 unregister_netdevice_many net/core/dev.c:12229 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12073 unregister_netdevice include/linux/netdevice.h:3385 [inline] nsim_destroy+0x1dd/0x670 drivers/net/netdevsim/netdev.c:1140 __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_dev_reload_down+0x8a/0xc0 drivers/net/netdevsim/dev.c:983 devlink_reload+0x1b3/0x8d0 net/devlink/dev.c:461 devlink_nl_reload_doit+0xb35/0xd50 net/devlink/dev.c:584 genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 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:47 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:548 insert_work+0x3d/0x330 kernel/workqueue.c:2184 __queue_work+0xbaf/0xfb0 kernel/workqueue.c:2343 queue_work_on+0x181/0x270 kernel/workqueue.c:2390 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:111 geneve_offload_rx_ports+0xd7/0x160 drivers/net/geneve.c:1188 geneve_netdevice_event+0x6a/0x80 drivers/net/geneve.c:-1 notifier_call_chain+0x1b3/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+0x134d/0x19f0 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b3/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:11244 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1034 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1105 __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+0x4e9/0x8d0 net/devlink/dev.c:474 devlink_nl_reload_doit+0xb35/0xd50 net/devlink/dev.c:584 genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:548 insert_work+0x3d/0x330 kernel/workqueue.c:2184 __queue_work+0xcd2/0xfb0 kernel/workqueue.c:2339 queue_work_on+0x181/0x270 kernel/workqueue.c:2390 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:111 vxlan_offload_rx_ports+0x139/0x200 drivers/net/vxlan/vxlan_core.c:3310 vxlan_netdevice_event+0x111/0x470 drivers/net/vxlan/vxlan_core.c:-1 notifier_call_chain+0x1b3/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+0x134d/0x19f0 net/ipv4/udp_tunnel_nic.c:931 notifier_call_chain+0x1b3/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:11244 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1034 [inline] nsim_create+0xae8/0xf10 drivers/net/netdevsim/netdev.c:1105 __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+0x4e9/0x8d0 net/devlink/dev.c:474 devlink_nl_reload_doit+0xb35/0xd50 net/devlink/dev.c:584 genl_family_rcv_msg_doit+0x215/0x300 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x60e/0x790 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888075f50800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 176 bytes inside of freed 256-byte region [ffff888075f50800, ffff888075f50900) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x75f50 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a441b40 ffffea0001de1880 dead000000000003 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a441b40 ffffea0001de1880 dead000000000003 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001d7d401 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 5872, tgid 5872 (syz-executor), ts 76734524294, free_ts 76708576118 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] new_dir fs/proc/proc_sysctl.c:966 [inline] get_subdir fs/proc/proc_sysctl.c:1010 [inline] sysctl_mkdir_p fs/proc/proc_sysctl.c:1320 [inline] __register_sysctl_table+0xba1/0x1340 fs/proc/proc_sysctl.c:1395 neigh_sysctl_register+0x9a2/0xa80 net/core/neighbour.c:3887 addrconf_sysctl_register+0xb3/0x1c0 net/ipv6/addrconf.c:7365 addrconf_notify+0x82b/0x1010 net/ipv6/addrconf.c:3783 notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] netif_change_name+0x5e9/0x960 net/core/dev.c:1489 do_setlink+0x9f6/0x41c0 net/core/rtnetlink.c:3123 rtnl_changelink net/core/rtnetlink.c:3761 [inline] __rtnl_newlink net/core/rtnetlink.c:3920 [inline] rtnl_newlink+0x160b/0x1c70 net/core/rtnetlink.c:4057 rtnetlink_rcv_msg+0x7cc/0xb70 net/core/rtnetlink.c:6946 page last free pid 5862 tgid 5862 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 discard_slab mm/slub.c:2753 [inline] __put_partials+0x156/0x1a0 mm/slub.c:3218 put_cpu_partial+0x17c/0x250 mm/slub.c:3293 __slab_free+0x2d5/0x3c0 mm/slub.c:4550 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:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_lru_noprof+0x1c6/0x3d0 mm/slub.c:4248 alloc_inode+0x6a/0x1b0 fs/inode.c:346 new_inode+0x22/0x170 fs/inode.c:1145 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x14d/0x4f0 fs/debugfs/inode.c:432 debugfs_create_file_full+0x3f/0x60 fs/debugfs/inode.c:459 nsim_dev_health_init+0x1e6/0x2d0 drivers/net/netdevsim/health.c:206 nsim_drv_probe+0x7d6/0xba0 drivers/net/netdevsim/dev.c:1637 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26a/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 Memory state around the buggy address: ffff888075f50780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888075f50800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888075f50880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075f50900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888075f50980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================