======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.5263/25356 is trying to acquire lock:
ffff88811f5e4e70 (&dev_instance_lock_key#2){+.+.}-{4:4}, at: xdp_set_features_flag+0x34/0x2a0

but task is already holding lock:
ffff8881738a2e70 (&dev_instance_lock_key#17){+.+.}-{4:4}, at: xdp_features_set_redirect_target+0x34/0x2b0

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&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

-> #1 (&port->pnodes_lock){+.+.}-{4:4}:
       __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_enslave+0x2c78/0x3b10
       bond_do_ioctl+0x6f6/0x8e0
       bond_siocdevprivate+0x19c/0x1f0
       dev_ifsioc+0xb56/0x1360
       dev_ioctl+0x84c/0x1150
       sock_ioctl+0x753/0x7e0
       __se_sys_ioctl+0xfc/0x170
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&dev_instance_lock_key#2){+.+.}-{4:4}:
       __lock_acquire+0x1520/0x2cf0
       lock_acquire+0x106/0x350
       __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

other info that might help us debug this:

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

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

locks held by syz.2.5263/25356: 2, last CPU#1:
 #0: ffffffff90035e40 (rtnl_mutex){+.+.}-{4:4}, at: bpf_xdp_link_attach+0x120/0x990
 #1: ffff8881738a2e70 (&dev_instance_lock_key#17){+.+.}-{4:4}, at: xdp_features_set_redirect_target+0x34/0x2b0

stack backtrace:
CPU: 1 UID: 0 PID: 25356 Comm: syz.2.5263 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+0x2e1/0x300
 check_noncircular+0x12e/0x150
 __lock_acquire+0x1520/0x2cf0
 lock_acquire+0x106/0x350
 __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
RIP: 0033:0x7f940819e0d9
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:00007f9408ffd028 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f9408425fa0 RCX: 00007f940819e0d9
RDX: 0000000000000040 RSI: 0000200000000240 RDI: 000000000000001c
RBP: 00007f9408235024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9408426038 R14: 00007f9408425fa0 R15: 00007ffcf9a984b8
 </TASK>
