==================================================================
BUG: KASAN: slab-use-after-free in devlink_port_notify+0x181/0x520
Read of size 8 at addr ffff8881b982ac00 by task syz-executor/11501

CPU: 0 UID: 0 PID: 11501 Comm: syz-executor 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
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 devlink_port_notify+0x181/0x520
 __devlink_port_type_set+0x5f1/0x7a0
 devlink_port_netdevice_event+0x25d/0x3a0
 notifier_call_chain+0x1a5/0x3d0
 unregister_netdevice_many_notify+0x1a76/0x2140
 unregister_netdevice_queue+0x2f5/0x340
 nsim_destroy+0x275/0x800
 __nsim_dev_port_del+0x14e/0x200
 nsim_dev_reload_destroy+0x288/0x490
 nsim_drv_remove+0x58/0x170
 device_release_driver_internal+0x48b/0x880
 bus_remove_device+0x444/0x560
 device_del+0x524/0x8f0
 device_unregister+0x21/0xf0
 del_device_store+0x2b5/0x370
 kernfs_fop_write_iter+0x3a4/0x540
 vfs_write+0x612/0xba0
 ksys_write+0x150/0x270
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ffa51b5fd8e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007ffe880339e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000055556d4bd500 RCX: 00007ffa51b5fd8e
RDX: 0000000000000001 RSI: 00007ffe88033a70 RDI: 0000000000000005
RBP: 00007ffa51c373e4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe88033a70 R14: 00007ffe880342b0 R15: 0000000000000003
 </TASK>

Allocated by task 939:
 kasan_save_track+0x3e/0x80
 __kasan_slab_alloc+0x6c/0x80
 kmem_cache_alloc_noprof+0x2b9/0x600
 copy_net_ns+0x1e3/0x780
 create_new_namespaces+0x3f0/0x6b0
 unshare_nsproxy_namespaces+0x149/0x190
 ksys_unshare+0x532/0x890
 __x64_sys_unshare+0x38/0x50
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 5845:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x40/0x50
 __kasan_slab_free+0x5c/0x80
 kmem_cache_free+0x182/0x650
 cleanup_net+0x5dd/0x810
 process_scheduled_works+0xc3d/0x1630
 worker_thread+0xa47/0xfb0
 kthread+0x38b/0x480
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 insert_work+0x3d/0x330
 __queue_work+0xd10/0x10e0
 call_timer_fn+0x18d/0x5f0
 __run_timer_base+0x67e/0x8b0
 run_timer_softirq+0x103/0x170
 handle_softirqs+0x226/0x860
 __irq_exit_rcu+0xcb/0x220
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 asm_sysvec_apic_timer_interrupt+0x1a/0x20

Second to last potentially related work creation:
 kasan_save_stack+0x3e/0x60
 kasan_record_aux_stack+0xbd/0xd0
 insert_work+0x3d/0x330
 __queue_work+0xd10/0x10e0
 call_timer_fn+0x18d/0x5f0
 __run_timer_base+0x67e/0x8b0
 run_timer_softirq+0x103/0x170
 handle_softirqs+0x226/0x860
 __irq_exit_rcu+0xcb/0x220
 irq_exit_rcu+0x9/0x30
 sysvec_apic_timer_interrupt+0xa6/0xc0
 asm_sysvec_apic_timer_interrupt+0x1a/0x20

The buggy address belongs to the object at ffff8881b982a7c0
 which belongs to the cache net_namespace of size 9920
The buggy address is located 1088 bytes inside of
 freed 9920-byte region [ffff8881b982a7c0, ffff8881b982ce80)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881b982a7c0 pfn:0x1b9828
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000240(workingset|head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000240 ffff888101688b40 ffffea0005b06c10 ffffea0006f75410
raw: ffff8881b982a7c0 0000000200030002 00000000f5000000 0000000000000000
head: 057ff00000000240 ffff888101688b40 ffffea0005b06c10 ffffea0006f75410
head: ffff8881b982a7c0 0000000200030002 00000000f5000000 0000000000000000
head: 057ff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5602, tgid 5602 (syz-executor), ts 50194303693
 post_alloc_hook+0x1f9/0x250
 get_page_from_freelist+0x2209/0x2280
 __alloc_frozen_pages_noprof+0x217/0x5a0
 allocate_slab+0x7d/0x620
 refill_objects+0x2d5/0x350
 __pcs_replace_empty_main+0x2c8/0x6c0
 kmem_cache_alloc_noprof+0x399/0x600
 copy_net_ns+0x1e3/0x780
 create_new_namespaces+0x3f0/0x6b0
 unshare_nsproxy_namespaces+0x149/0x190
 ksys_unshare+0x532/0x890
 __x64_sys_unshare+0x38/0x50
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5595 tgid 5595 ts 50126766798 stack trace:
 __free_frozen_pages+0xc93/0xd90
 __slab_free+0x274/0x2c0
 qlist_free_all+0x99/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_cache_noprof+0x29f/0x600
 ref_tracker_alloc+0x15b/0x4b0
 net_rx_queue_update_kobjects+0x1c4/0x780
 netdev_register_kobject+0x23e/0x350
 register_netdevice+0x1433/0x1eb0
 rtnl_newlink_create+0x314/0x7b0
 rtnl_newlink+0x166d/0x1c30
 rtnetlink_rcv_msg+0x802/0xc00
 netlink_rcv_skb+0x226/0x4a0
 netlink_unicast+0x7bd/0x940
 netlink_sendmsg+0x884/0xba0

Memory state around the buggy address:
 ffff8881b982ab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b982ab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881b982ac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8881b982ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b982ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
