batman_adv: batadv0: Interface deactivated: batadv_slave_1
batman_adv: batadv0: Removing interface: batadv_slave_1
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
kworker/u8:4/6568 is trying to acquire lock:
ffff888112bb08c0 (&port->pnodes_lock){+.+.}-{4:4}, at: ipvlan_device_event+0x489/0xfb0

but task is already holding lock:
ffff88812021ae70 (&dev_instance_lock_key#3){+.+.}-{4:4}, at: unregister_netdevice_many_notify+0x5bb/0x2140

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

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

-> #2 (&xs->mutex){+.+.}-{4:4}:
       __mutex_lock+0x19d/0x1550
       xsk_diag_dump+0x52f/0x1560
       netlink_dump+0x711/0xee0
       __netlink_dump_start+0x589/0x7b0
       xsk_diag_handler_dump+0x1a0/0x250
       sock_diag_rcv_msg+0x4b0/0x5f0
       netlink_rcv_skb+0x226/0x4a0
       netlink_unicast+0x7bd/0x940
       netlink_sendmsg+0x813/0xb40
       sock_sendmsg_nosec+0x13a/0x180
       sock_write_iter+0x2de/0x3e0
       do_iter_readv_writev+0x612/0x8c0
       vfs_writev+0x343/0x990
       do_writev+0x154/0x2e0
       do_syscall_64+0x166/0x520
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&net->xdp.lock){+.+.}-{4:4}:
       __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
       ops_undo_list+0x391/0x8d0
       cleanup_net+0x572/0x810
       process_scheduled_works+0xc3d/0x1630
       worker_thread+0xa47/0xfb0
       kthread+0x38b/0x480
       ret_from_fork+0x514/0xb70
       ret_from_fork_asm+0x1a/0x30

-> #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
       __dev_close_many+0x119/0x6e0
       netif_close_many+0x249/0x660
       unregister_netdevice_many_notify+0x843/0x2140
       default_device_exit_batch+0x91e/0x9a0
       ops_undo_list+0x4b4/0x8d0
       cleanup_net+0x572/0x810
       process_scheduled_works+0xc3d/0x1630
       worker_thread+0xa47/0xfb0
       kthread+0x38b/0x480
       ret_from_fork+0x514/0xb70
       ret_from_fork_asm+0x1a/0x30

other info that might help us debug this:

Chain exists of:
  &port->pnodes_lock --> &xs->mutex --> &dev_instance_lock_key#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&dev_instance_lock_key#3);
                               lock(&xs->mutex);
                               lock(&dev_instance_lock_key#3);
  lock(&port->pnodes_lock);

 *** DEADLOCK ***

locks held by kworker/u8:4/6568: 5, last CPU#0:
 #0: ffff8881012d5940 ((wq_completion)netns){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630
 #1: ffffc900041bfc40 (net_cleanup_work){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630
 #2: ffffffff90241968 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0xf5/0x810
 #3: ffffffff902501c0 (rtnl_mutex){+.+.}-{4:4}, at: default_device_exit_batch+0xe5/0x9a0
 #4: ffff88812021ae70 (&dev_instance_lock_key#3){+.+.}-{4:4}, at: unregister_netdevice_many_notify+0x5bb/0x2140

stack backtrace:
CPU: 0 UID: 0 PID: 6568 Comm: kworker/u8:4 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
Workqueue: netns cleanup_net
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
 __dev_close_many+0x119/0x6e0
 netif_close_many+0x249/0x660
 unregister_netdevice_many_notify+0x843/0x2140
 default_device_exit_batch+0x91e/0x9a0
 ops_undo_list+0x4b4/0x8d0
 cleanup_net+0x572/0x810
 process_scheduled_works+0xc3d/0x1630
 worker_thread+0xa47/0xfb0
 kthread+0x38b/0x480
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30
 </TASK>
veth1_macvtap: left promiscuous mode
veth0_macvtap: left promiscuous mode
veth1_vlan: left promiscuous mode
veth0_vlan: left promiscuous mode
team0 (unregistering): Port device team_slave_1 removed
team0 (unregistering): Port device team_slave_0 removed
