bond0: (slave syz_tun): Releasing backup interface
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/20426 is trying to acquire lock:
ffff88810920c8c0 (&port->pnodes_lock){+.+.}-{4:4}, at: ipvlan_device_event+0x489/0xfb0

but task is already holding lock:
ffff888110598e70 (&dev_instance_lock_key#2){+.+.}-{4:4}, at: xdp_set_features_flag+0x34/0x2a0

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&dev_instance_lock_key#2){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       xdp_set_features_flag+0x34/0x2a0
       bond_xdp_set_features+0x277/0x320
       bond_netdev_event+0x57c/0xf80
       notifier_call_chain+0x1a5/0x3d0
       call_netdevice_notifiers+0x90/0xd0
       xdp_features_set_redirect_target+0x1af/0x2b0
       veth_xdp+0x5e0/0x720
       dev_xdp_install+0x7b6/0xa00
       dev_xdp_attach+0xaea/0xbe0
       bpf_xdp_link_attach+0x4ea/0x990
       link_create+0x4cb/0x850
       __sys_bpf+0x760/0xd90
       __x64_sys_bpf+0xba/0xd0
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&dev_instance_lock_key#17){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       ipvlan_uninit+0x147/0x290
       unregister_netdevice_many_notify+0x1acd/0x2140
       ipvlan_device_event+0xf1f/0xfb0
       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 (&port->pnodes_lock){+.+.}-{4:4}:
       __lock_acquire+0x15ff/0x2e50
       lock_acquire+0x115/0x350
       __mutex_lock+0x19d/0x1550
       ipvlan_device_event+0x489/0xfb0
       notifier_call_chain+0x1a5/0x3d0
       call_netdevice_notifiers+0x90/0xd0
       xdp_set_features_flag+0x1a0/0x2a0
       bond_xdp_set_features+0x277/0x320
       __bond_release_one+0xeb3/0x11c0
       bond_netdev_event+0x54a/0xf80
       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
       __x64_sys_exit_group+0x3f/0x40
       x64_sys_call+0x18c6/0x18d0
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  &port->pnodes_lock --> &dev_instance_lock_key#17 --> &dev_instance_lock_key#2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&dev_instance_lock_key#2);
                               lock(&dev_instance_lock_key#17);
                               lock(&dev_instance_lock_key#2);
  lock(&port->pnodes_lock);

 *** DEADLOCK ***

locks held by syz-executor/20426: 2, last CPU#0:
 #0: ffffffff90250d00 (rtnl_mutex){+.+.}-{4:4}, at: tun_chr_close+0x3e/0x1c0
 #1: ffff888110598e70 (&dev_instance_lock_key#2){+.+.}-{4:4}, at: xdp_set_features_flag+0x34/0x2a0

stack backtrace:
CPU: 0 UID: 0 PID: 20426 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_circular_bug+0x2e2/0x300
 check_noncircular+0x12f/0x150
 __lock_acquire+0x15ff/0x2e50
 lock_acquire+0x115/0x350
 __mutex_lock+0x19d/0x1550
 ipvlan_device_event+0x489/0xfb0
 notifier_call_chain+0x1a5/0x3d0
 call_netdevice_notifiers+0x90/0xd0
 xdp_set_features_flag+0x1a0/0x2a0
 bond_xdp_set_features+0x277/0x320
 __bond_release_one+0xeb3/0x11c0
 bond_netdev_event+0x54a/0xf80
 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
 __x64_sys_exit_group+0x3f/0x40
 x64_sys_call+0x18c6/0x18d0
 do_syscall_64+0x166/0x520
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe0f559e159
Code: Unable to access opcode bytes at 0x7fe0f559e12f.
RSP: 002b:00007ffc4ebe6a58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007fe0f563453f RCX: 00007fe0f559e159
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 0000000000000001 R08: 0000000000000000 R09: 00007fe0f56344bb
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc4ebe7d10
R13: 00007fe0f56344bb R14: 000055556c97f4e8 R15: 00007ffc4ebe8de0
 </TASK>
