================================================================== BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:581 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x144/0xe80 kernel/locking/mutex.c:747 Read of size 8 at addr ffff88807eeaf0b0 by task kworker/u8:5/144 CPU: 1 UID: 0 PID: 144 Comm: kworker/u8:5 Not tainted 6.16.0-rc2-syzkaller-00592-g0289c51f889e #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 __mutex_lock_common kernel/locking/mutex.c:581 [inline] __mutex_lock+0x144/0xe80 kernel/locking/mutex.c:747 udp_tunnel_nic_device_sync_work+0x39/0xa50 net/ipv4/udp_tunnel_nic.c:737 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 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 9001: 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:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4328 [inline] __kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4340 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:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11184 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:956 [inline] nsim_create+0xabc/0xee0 drivers/net/netdevsim/netdev.c:1023 __nsim_dev_port_add+0x70a/0xb20 drivers/net/netdevsim/dev.c:1393 nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1449 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:988 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+0x212/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+0x205/0x470 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 ____sys_sendmsg+0x505/0x830 net/socket.c:2612 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2666 __sys_sendmsg net/socket.c:2698 [inline] __do_sys_sendmsg net/socket.c:2703 [inline] __se_sys_sendmsg net/socket.c:2701 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2701 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 9001: 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:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x18e/0x440 mm/slub.c:4842 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:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] unregister_netdevice_many_notify+0x15d8/0x2320 net/core/dev.c:12118 unregister_netdevice_many net/core/dev.c:12181 [inline] unregister_netdevice_queue+0x33c/0x380 net/core/dev.c:12025 unregister_netdevice include/linux/netdevice.h:3389 [inline] nsim_destroy+0x217/0x6a0 drivers/net/netdevsim/netdev.c:1059 __nsim_dev_port_del+0x14d/0x1b0 drivers/net/netdevsim/dev.c:1428 nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1440 [inline] nsim_dev_port_add_all+0xac/0xe0 drivers/net/netdevsim/dev.c:1456 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:988 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+0x212/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+0x205/0x470 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 ____sys_sendmsg+0x505/0x830 net/socket.c:2612 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2666 __sys_sendmsg net/socket.c:2698 [inline] __do_sys_sendmsg net/socket.c:2703 [inline] __se_sys_sendmsg net/socket.c:2701 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2701 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:2183 __queue_work+0xbd9/0xfe0 kernel/workqueue.c:2345 queue_work_on+0x181/0x270 kernel/workqueue.c:2392 queue_work include/linux/workqueue.h:662 [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:372 [inline] udp_tunnel_push_rx_port+0x17d/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:2268 [inline] call_netdevice_notifiers+0x88/0xc0 net/core/dev.c:2282 udp_tunnel_get_rx_info include/net/udp_tunnel.h:439 [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:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11184 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:956 [inline] nsim_create+0xabc/0xee0 drivers/net/netdevsim/netdev.c:1023 __nsim_dev_port_add+0x70a/0xb20 drivers/net/netdevsim/dev.c:1393 nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1449 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:988 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+0x212/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+0x205/0x470 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 ____sys_sendmsg+0x505/0x830 net/socket.c:2612 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2666 __sys_sendmsg net/socket.c:2698 [inline] __do_sys_sendmsg net/socket.c:2703 [inline] __se_sys_sendmsg net/socket.c:2701 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2701 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:2183 __queue_work+0xcfc/0xfe0 kernel/workqueue.c:2341 queue_work_on+0x181/0x270 kernel/workqueue.c:2392 queue_work include/linux/workqueue.h:662 [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:372 [inline] udp_tunnel_push_rx_port+0x17d/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:2268 [inline] call_netdevice_notifiers+0x88/0xc0 net/core/dev.c:2282 udp_tunnel_get_rx_info include/net/udp_tunnel.h:439 [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:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x1608/0x1ae0 net/core/dev.c:11184 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:956 [inline] nsim_create+0xabc/0xee0 drivers/net/netdevsim/netdev.c:1023 __nsim_dev_port_add+0x70a/0xb20 drivers/net/netdevsim/dev.c:1393 nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1449 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1501 [inline] nsim_dev_reload_up+0x451/0x780 drivers/net/netdevsim/dev.c:988 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+0x212/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+0x205/0x470 net/netlink/af_netlink.c:2534 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline] netlink_unicast+0x758/0x8d0 net/netlink/af_netlink.c:1339 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:712 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:727 ____sys_sendmsg+0x505/0x830 net/socket.c:2612 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2666 __sys_sendmsg net/socket.c:2698 [inline] __do_sys_sendmsg net/socket.c:2703 [inline] __se_sys_sendmsg net/socket.c:2701 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2701 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 ffff88807eeaf000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 176 bytes inside of freed 256-byte region [ffff88807eeaf000, ffff88807eeaf100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7eeae head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a441b40 ffffea0000d08a80 dead000000000004 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a441b40 ffffea0000d08a80 dead000000000004 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001fbab81 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 6830, tgid 6822 (syz.3.213), ts 126649839586, free_ts 116997151103 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2451 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2619 new_slab mm/slub.c:2673 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3859 __slab_alloc mm/slub.c:3949 [inline] __slab_alloc_node mm/slub.c:4024 [inline] slab_alloc_node mm/slub.c:4185 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_noprof+0x305/0x4f0 mm/slub.c:4340 kmalloc_noprof include/linux/slab.h:909 [inline] kmalloc_array_noprof include/linux/slab.h:948 [inline] iter_file_splice_write+0x1cb/0x1000 fs/splice.c:679 do_splice_from fs/splice.c:935 [inline] direct_splice_actor+0xfe/0x160 fs/splice.c:1158 splice_direct_to_actor+0x5a8/0xcc0 fs/splice.c:1102 do_splice_direct_actor fs/splice.c:1201 [inline] do_splice_direct+0x181/0x270 fs/splice.c:1227 do_sendfile+0x4da/0x7e0 fs/read_write.c:1370 __do_sys_sendfile64 fs/read_write.c:1431 [inline] __se_sys_sendfile64+0x13e/0x190 fs/read_write.c:1417 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 page last free pid 5828 tgid 5828 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706 vfree+0x25a/0x400 mm/vmalloc.c:3426 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3345 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88807eeaef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807eeaf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807eeaf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807eeaf100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807eeaf180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================