==================================================================
BUG: KASAN: slab-use-after-free in __mutex_lock+0x15a/0x1550
Read of size 8 at addr ffff88806dc1b2a8 by task kworker/u8:4/5739

CPU: 0 UID: 0 PID: 5739 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_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 __mutex_lock+0x15a/0x1550
 udp_tunnel_nic_device_sync_work+0x39/0xa10
 process_scheduled_works+0xb5d/0x1860
 worker_thread+0xa53/0xfc0
 kthread+0x388/0x470
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Allocated by task 14077:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_noprof+0x35c/0x760
 udp_tunnel_nic_netdevice_event+0x4c3/0x17d0
 notifier_call_chain+0x1ad/0x3d0
 register_netdevice+0x18c9/0x1ec0
 nsim_create+0xbed/0x1160
 __nsim_dev_port_add+0x857/0xd30
 nsim_dev_port_add_all+0x37/0xf0
 nsim_dev_reload_up+0x45f/0x7c0
 devlink_reload+0x4f8/0x8c0
 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+0x75c/0x8e0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x15f/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 14076:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x46/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c5/0x640
 udp_tunnel_nic_netdevice_event+0x11ed/0x17d0
 notifier_call_chain+0x1ad/0x3d0
 unregister_netdevice_many_notify+0x17a5/0x22c0
 unregister_netdevice_queue+0x31f/0x360
 nsim_destroy+0x277/0x7f0
 __nsim_dev_port_del+0x14f/0x200
 nsim_dev_reload_destroy+0x288/0x490
 nsim_dev_reload_down+0x8a/0xc0
 devlink_reload+0x1eb/0x8c0
 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+0x75c/0x8e0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x15f/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+0xbad/0xfc0
 queue_work_on+0x106/0x1d0
 __udp_tunnel_nic_add_port+0xb71/0xd60
 udp_tunnel_push_rx_port+0x186/0x210
 geneve_offload_rx_ports+0xc7/0x150
 geneve_netdevice_event+0x6a/0x80
 notifier_call_chain+0x1ad/0x3d0
 call_netdevice_notifiers+0x90/0xd0
 udp_tunnel_nic_netdevice_event+0xdef/0x17d0
 notifier_call_chain+0x1ad/0x3d0
 register_netdevice+0x18c9/0x1ec0
 nsim_create+0xbed/0x1160
 __nsim_dev_port_add+0x857/0xd30
 nsim_dev_port_add_all+0x37/0xf0
 nsim_dev_reload_up+0x45f/0x7c0
 devlink_reload+0x4f8/0x8c0
 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+0x75c/0x8e0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x15f/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+0xccf/0xfc0
 queue_work_on+0x106/0x1d0
 __udp_tunnel_nic_add_port+0xb71/0xd60
 udp_tunnel_push_rx_port+0x186/0x210
 vxlan_offload_rx_ports+0x129/0x1f0
 vxlan_netdevice_event+0x111/0x480
 notifier_call_chain+0x1ad/0x3d0
 call_netdevice_notifiers+0x90/0xd0
 udp_tunnel_nic_netdevice_event+0xdef/0x17d0
 notifier_call_chain+0x1ad/0x3d0
 register_netdevice+0x18c9/0x1ec0
 nsim_create+0xbed/0x1160
 __nsim_dev_port_add+0x857/0xd30
 nsim_dev_port_add_all+0x37/0xf0
 nsim_dev_reload_up+0x45f/0x7c0
 devlink_reload+0x4f8/0x8c0
 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+0x75c/0x8e0
 netlink_sendmsg+0x813/0xb40
 ____sys_sendmsg+0x972/0x9f0
 ___sys_sendmsg+0x2a5/0x360
 __x64_sys_sendmsg+0x1bd/0x2a0
 do_syscall_64+0x15f/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6dc1a
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 ffff888100041b40 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff888100041b40 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000001 ffffffffffffff81 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 7887, tgid 7881 (syz.0.16674), ts 1668062454966, free_ts 1660953169403
 post_alloc_hook+0x231/0x280
 get_page_from_freelist+0x24ba/0x2540
 __alloc_frozen_pages_noprof+0x18d/0x380
 allocate_slab+0x77/0x660
 refill_objects+0x339/0x3d0
 __pcs_replace_empty_main+0x321/0x720
 __kmalloc_noprof+0x474/0x760
 __register_sysctl_table+0xba1/0x1340
 neigh_sysctl_register+0x9b1/0xa90
 devinet_sysctl_register+0xad/0x200
 inetdev_init+0x2a4/0x4e0
 inetdev_event+0x30d/0x1610
 notifier_call_chain+0x1ad/0x3d0
 register_netdevice+0x18c9/0x1ec0
 rtnl_newlink_create+0x329/0xb70
 rtnl_newlink+0x166a/0x1bb0
page last free pid 7494 tgid 7494 stack trace:
 __free_frozen_pages+0xbc7/0xd30
 __slab_free+0x274/0x2c0
 qlist_free_all+0x99/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_noprof+0x316/0x760
 tomoyo_realpath_from_path+0xe3/0x5d0
 tomoyo_path_perm+0x283/0x560
 security_inode_getattr+0x12b/0x310
 vfs_fstatat+0xb4/0x170
 __x64_sys_newfstatat+0x151/0x200
 do_syscall_64+0x15f/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88806dc1b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88806dc1b200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806dc1b280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88806dc1b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88806dc1b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
