==================================================================
BUG: KASAN: slab-use-after-free in devlink_port_notify+0x181/0x520
Read of size 8 at addr ffff8881b87f0440 by task syz.3.10126/8641

CPU: 0 UID: 0 PID: 8641 Comm: syz.3.10126 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
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:0x7fb97eb9e559
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb97fb12028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fb97ee25fa0 RCX: 00007fb97eb9e559
RDX: 0000000000000090 RSI: 0000200000000140 RDI: 0000000000000004
RBP: 00007fb97ec358b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb97ee26038 R14: 00007fb97ee25fa0 R15: 00007ffd6817e158
 </TASK>

Allocated by task 5598:
 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+0x5a7/0x950
 __x64_sys_unshare+0x38/0x50
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 13:
 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+0xd07/0x10d0
 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+0xd07/0x10d0
 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 ffff8881b87f0000
 which belongs to the cache net_namespace of size 9920
The buggy address is located 1088 bytes inside of
 freed 9920-byte region [ffff8881b87f0000, ffff8881b87f26c0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881b87f4f80 pfn:0x1b87f0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888166f9d401
flags: 0x57ff00000000240(workingset|head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000240 ffff88816041a500 ffff888160419408 ffffea0006dff810
raw: ffff8881b87f4f80 0000000200030001 00000000f5000000 ffff888166f9d401
head: 057ff00000000240 ffff88816041a500 ffff888160419408 ffffea0006dff810
head: ffff8881b87f4f80 0000000200030001 00000000f5000000 ffff888166f9d401
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 5598, tgid 5598 (syz-executor), ts 48097744735
 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+0x5a7/0x950
 __x64_sys_unshare+0x38/0x50
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5615 tgid 5615 ts 47900730693 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_noprof+0x307/0x720
 load_elf_binary+0x2c6/0x28d0
 bprm_execve+0x930/0x1590
 kernel_execve+0x8c3/0x9c0
 call_usermodehelper_exec_async+0x20f/0x360
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

Memory state around the buggy address:
 ffff8881b87f0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b87f0380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881b87f0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8881b87f0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b87f0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
