==================================================================
BUG: KASAN: slab-use-after-free in __mutex_lock+0x157/0x1300
Read of size 8 at addr ffff8881b65a1ab0 by task kworker/u8:4/6329

CPU: 0 UID: 0 PID: 6329 Comm: kworker/u8:4 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Workqueue: udp_tunnel_nic udp_tunnel_nic_device_sync_work
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_report+0xba/0x230
 kasan_report+0x117/0x150
 __mutex_lock+0x157/0x1300
 udp_tunnel_nic_device_sync_work+0x39/0xa10
 process_scheduled_works+0xb02/0x1830
 worker_thread+0xa50/0xfc0
 kthread+0x388/0x470
 ret_from_fork+0x51e/0xb90
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Allocated by task 5807:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_noprof+0x35c/0x760
 udp_tunnel_nic_netdevice_event+0x4c3/0x17d0
 notifier_call_chain+0x1be/0x400
 register_netdevice+0x173a/0x1cf0
 nsim_create+0xb92/0x1100
 __nsim_dev_port_add+0x72a/0xb50
 nsim_dev_port_add_all+0x37/0xf0
 nsim_drv_probe+0x905/0xc20
 really_probe+0x267/0xaf0
 __driver_probe_device+0x18c/0x320
 driver_probe_device+0x4f/0x240
 __device_attach_driver+0x2d4/0x4c0
 bus_for_each_drv+0x258/0x2f0
 __device_attach+0x2c5/0x450
 device_initial_probe+0xa1/0xd0
 bus_probe_device+0x12a/0x220
 device_add+0x7b6/0xb70
 new_device_store+0x37b/0x710
 kernfs_fop_write_iter+0x3af/0x540
 vfs_write+0x61d/0xb90
 ksys_write+0x150/0x270
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 7533:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c1/0x630
 udp_tunnel_nic_netdevice_event+0x11ed/0x17d0
 notifier_call_chain+0x1be/0x400
 unregister_netdevice_many_notify+0x186a/0x2370
 unregister_netdevice_queue+0x31f/0x360
 nsim_destroy+0x1e5/0x680
 __nsim_dev_port_del+0x14d/0x1b0
 nsim_dev_reload_destroy+0x288/0x490
 nsim_dev_reload_down+0x8a/0xc0
 devlink_reload+0x1d1/0x8d0
 devlink_nl_reload_doit+0xaaa/0xc80
 genl_family_rcv_msg_doit+0x22a/0x330
 genl_rcv_msg+0x61c/0x7a0
 netlink_rcv_skb+0x232/0x4b0
 genl_rcv+0x28/0x40
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 insert_work+0x3d/0x330
 __queue_work+0xbe1/0x1020
 queue_work_on+0x106/0x1d0
 __udp_tunnel_nic_add_port+0xb71/0xd60
 udp_tunnel_notify_add_rx_port+0x2c0/0x3c0
 geneve_sock_add+0x591/0xa40
 geneve_open+0xd2/0x140
 __dev_open+0x44d/0x830
 __dev_change_flags+0x1f7/0x690
 rtnl_newlink_create+0x587/0xb70
 rtnl_newlink+0x1666/0x1be0
 rtnetlink_rcv_msg+0x7d5/0xbe0
 netlink_rcv_skb+0x232/0x4b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Second to last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 insert_work+0x3d/0x330
 __queue_work+0xbe1/0x1020
 queue_work_on+0x106/0x1d0
 __udp_tunnel_nic_add_port+0xb71/0xd60
 udp_tunnel_notify_add_rx_port+0x2c0/0x3c0
 __vxlan_sock_add+0xdd3/0x1350
 vxlan_open+0x11c/0x220
 __dev_open+0x44d/0x830
 __dev_change_flags+0x1f7/0x690
 rtnl_newlink_create+0x587/0xb70
 rtnl_newlink+0x1666/0x1be0
 rtnetlink_rcv_msg+0x7d5/0xbe0
 netlink_rcv_skb+0x232/0x4b0
 netlink_unicast+0x80f/0x9b0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __sys_sendmmsg+0x27c/0x4e0
 __x64_sys_sendmmsg+0xa0/0xc0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff8881b65a1a00
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 176 bytes inside of
 freed 256-byte region [ffff8881b65a1a00, ffff8881b65a1b00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1b65a0
head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000040 ffff888100041b40 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000040 ffff888100041b40 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000001 ffffea0006d96801 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 5812, tgid 5812 (syz-executor), ts 63432785015, free_ts 37202274163
 post_alloc_hook+0x231/0x280
 get_page_from_freelist+0x24dc/0x2580
 __alloc_frozen_pages_noprof+0x18d/0x380
 allocate_slab+0x77/0x660
 refill_objects+0x331/0x3c0
 __pcs_replace_empty_main+0x2b9/0x620
 __kmalloc_noprof+0x474/0x760
 fib_create_info+0x1723/0x31f0
 fib_table_insert+0xc8/0x1b50
 fib_magic+0x434/0x510
 fib_add_ifaddr+0x3fb/0x5f0
 fib_netdev_event+0x382/0x490
 notifier_call_chain+0x1be/0x400
 __dev_notify_flags+0x1a9/0x310
 netif_change_flags+0xe8/0x1a0
 do_setlink+0xf82/0x4590
page last free pid 5552 tgid 5552 stack trace:
 __free_frozen_pages+0xc2b/0xdb0
 __slab_free+0x263/0x2b0
 qlist_free_all+0x97/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 kmem_cache_alloc_node_noprof+0x384/0x690
 __alloc_skb+0x1d0/0x7d0
 alloc_skb_with_frags+0xca/0x890
 sock_alloc_send_pskb+0x878/0x990
 unix_dgram_sendmsg+0x460/0x18e0
 sock_write_iter+0x49b/0x4f0
 do_iter_readv_writev+0x619/0x8c0
 vfs_writev+0x33c/0x990
 do_writev+0x154/0x2e0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff8881b65a1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881b65a1a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881b65a1a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8881b65a1b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881b65a1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
