======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
syz.9.18964/18070 is trying to acquire lock:
ffff8881731c9fd0 (&net->xdp.lock){+.+.}-{4:4}, at: xsk_notifier+0x89/0x230

but task is already holding lock:
ffff8881ab1128c0 (&port->pnodes_lock){+.+.}-{4:4}, at: ipvlan_device_event+0x489/0xfb0

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&port->pnodes_lock){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       ipvlan_device_event+0x489/0xfb0
       notifier_call_chain+0x1a5/0x3d0
       netif_set_mtu_ext+0x442/0x830
       netif_set_mtu+0xd7/0x1b0
       dev_set_mtu+0x105/0x210
       dev_ioctl+0x7b4/0x1150
       sock_do_ioctl+0x23e/0x320
       sock_ioctl+0x57a/0x7e0
       __se_sys_ioctl+0xfc/0x170
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #2 (&dev_instance_lock_key#3){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       xsk_bind+0x331/0x1380
       __sys_bind+0x2e3/0x410
       __x64_sys_bind+0x7a/0x90
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&xs->mutex){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       xsk_notifier+0xcd/0x230
       notifier_call_chain+0x1a5/0x3d0
       unregister_netdevice_many_notify+0x17f9/0x2140
       rtnl_dellink+0x5be/0x810
       rtnetlink_rcv_msg+0x802/0xc00
       netlink_rcv_skb+0x226/0x4a0
       netlink_unicast+0x7bd/0x940
       netlink_sendmsg+0x813/0xb40
       sock_sendmsg_nosec+0x13a/0x180
       ____sys_sendmsg+0x54e/0x850
       ___sys_sendmsg+0x2a5/0x360
       __x64_sys_sendmsg+0x1b1/0x290
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&net->xdp.lock){+.+.}-{4:4}:
       __lock_acquire+0x15ff/0x2e50
       lock_acquire+0x115/0x350
       __mutex_lock+0x19d/0x1550
       xsk_notifier+0x89/0x230
       notifier_call_chain+0x1a5/0x3d0
       unregister_netdevice_many_notify+0x17f9/0x2140
       ipvlan_device_event+0xf1f/0xfb0
       notifier_call_chain+0x1a5/0x3d0
       unregister_netdevice_many_notify+0x17f9/0x2140
       unregister_netdevice_queue+0x2f5/0x340
       __tun_detach+0x1074/0x1900
       tun_chr_close+0x10a/0x1c0
       __fput+0x418/0xa50
       task_work_run+0x1d9/0x270
       do_exit+0x73a/0x2360
       do_group_exit+0x22d/0x2f0
       get_signal+0x121b/0x12c0
       arch_do_signal_or_restart+0xbb/0x860
       exit_to_user_mode_loop+0x10e/0x770
       do_syscall_64+0x328/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  &net->xdp.lock --> &dev_instance_lock_key#3 --> &port->pnodes_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&port->pnodes_lock);
                               lock(&dev_instance_lock_key#3);
                               lock(&port->pnodes_lock);
  lock(&net->xdp.lock);

 *** DEADLOCK ***

locks held by syz.9.18964/18070: 2, last CPU#0:
 #0: ffffffff90250f00 (rtnl_mutex){+.+.}-{4:4}, at: tun_chr_close+0x3e/0x1c0
 #1: ffff8881ab1128c0 (&port->pnodes_lock){+.+.}-{4:4}, at: ipvlan_device_event+0x489/0xfb0

stack backtrace:
CPU: 0 UID: 0 PID: 18070 Comm: syz.9.18964 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_circular_bug+0x2e2/0x300
 check_noncircular+0x12f/0x150
 __lock_acquire+0x15ff/0x2e50
 lock_acquire+0x115/0x350
 __mutex_lock+0x19d/0x1550
 xsk_notifier+0x89/0x230
 notifier_call_chain+0x1a5/0x3d0
 unregister_netdevice_many_notify+0x17f9/0x2140
 ipvlan_device_event+0xf1f/0xfb0
 notifier_call_chain+0x1a5/0x3d0
 unregister_netdevice_many_notify+0x17f9/0x2140
 unregister_netdevice_queue+0x2f5/0x340
 __tun_detach+0x1074/0x1900
 tun_chr_close+0x10a/0x1c0
 __fput+0x418/0xa50
 task_work_run+0x1d9/0x270
 do_exit+0x73a/0x2360
 do_group_exit+0x22d/0x2f0
 get_signal+0x121b/0x12c0
 arch_do_signal_or_restart+0xbb/0x860
 exit_to_user_mode_loop+0x10e/0x770
 do_syscall_64+0x328/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7febd555e98e
Code: Unable to access opcode bytes at 0x7febd555e964.
RSP: 002b:00007febd63b5f58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6
RAX: fffffffffffffdfc RBX: 00007febd63b66c0 RCX: 00007febd555e98e
RDX: 00007febd63b5fb0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007febd563506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007febd5826038 R14: 00007febd5825fa0 R15: 00007fffc5d9fac8
 </TASK>
