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

CPU: 0 UID: 0 PID: 13606 Comm: syz.2.2178 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:0x7fcf7419e559
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:00007fcf75011028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fcf74425fa0 RCX: 00007fcf7419e559
RDX: 0000000000000090 RSI: 0000200000000080 RDI: 0000000000000004
RBP: 00007fcf742358b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fcf74426038 R14: 00007fcf74425fa0 R15: 00007fff5a52c798
 </TASK>

Allocated by task 12681:
 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 5621:
 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

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10dcd8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88810bec7fc1
flags: 0x17ff00000000040(head|node=0|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 017ff00000000040 ffff88810168b3c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000200030003 00000000f5000000 ffff88810bec7fc1
head: 017ff00000000040 ffff88810168b3c0 dead000000000100 dead000000000122
head: 0000000000000000 0000000200030003 00000000f5000000 ffff88810bec7fc1
head: 017ff00000000003 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 5594, tgid 5594 (syz-executor), ts 47831624248
 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 5590 tgid 5590 ts 47815570199 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
 fib_create_info+0x16fe/0x3170
 fib_table_insert+0xcb/0x1b10
 fib_magic+0x43b/0x530
 fib_add_ifaddr+0x139/0x5d0
 fib_inetaddr_event+0x12e/0x190
 notifier_call_chain+0x1a5/0x3d0
 blocking_notifier_call_chain+0x6a/0x90
 __inet_insert_ifa+0x9ef/0xbc0
 inet_rtm_newaddr+0x1039/0x19f0
 rtnetlink_rcv_msg+0x802/0xc00

Memory state around the buggy address:
 ffff88810dcd8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810dcd8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810dcd8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff88810dcd8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810dcd8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
