======================================================
[ INFO: possible circular locking dependency detected ]
4.4.174+ #17 Not tainted
-------------------------------------------------------
syz-executor.4/7783 is trying to acquire lock:
 (_xmit_NETROM){+.-...}, at: [<ffffffff822b1b58>] spin_lock include/linux/spinlock.h:302 [inline]
 (_xmit_NETROM){+.-...}, at: [<ffffffff822b1b58>] __netif_tx_lock include/linux/netdevice.h:3306 [inline]
 (_xmit_NETROM){+.-...}, at: [<ffffffff822b1b58>] sch_direct_xmit+0x238/0x700 net/sched/sch_generic.c:163

but task is already holding lock:
 (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8263b03c>] spin_lock include/linux/spinlock.h:302 [inline]
 (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8263b03c>] ipv6_frag_rcv+0x6cc/0x51e0 net/ipv6/reassembly.c:528

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

       [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
       [<ffffffff82717e50>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:112 [inline]
       [<ffffffff82717e50>] _raw_spin_lock_irqsave+0x50/0x70 kernel/locking/spinlock.c:159
       [<ffffffff81ab0033>] free_bitmap+0x63/0xc0 lib/idr.c:873
       [<ffffffff81ab0280>] ida_remove+0x1f0/0x270 lib/idr.c:1045
       [<ffffffff814fba4b>] mnt_release_group_id+0x4b/0xb0 fs/namespace.c:157
       [<ffffffff8152e711>] do_make_slave fs/pnode.c:93 [inline]
       [<ffffffff8152e711>] change_mnt_propagation+0x9b1/0xd60 fs/pnode.c:130
       [<ffffffff814f8119>] umount_tree+0x439/0xc60 fs/namespace.c:1525
       [<ffffffff814ff140>] do_umount fs/namespace.c:1614 [inline]
       [<ffffffff814ff140>] SYSC_umount fs/namespace.c:1714 [inline]
       [<ffffffff814ff140>] SyS_umount+0x630/0xd50 fs/namespace.c:1683
       [<ffffffff8100603d>] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
       [<ffffffff8100603d>] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397
       [<ffffffff8271a350>] sysenter_flags_fixed+0xd/0x1a

       [<ffffffff81202d86>] check_prev_add kernel/locking/lockdep.c:1853 [inline]
       [<ffffffff81202d86>] check_prevs_add kernel/locking/lockdep.c:1958 [inline]
       [<ffffffff81202d86>] validate_chain kernel/locking/lockdep.c:2144 [inline]
       [<ffffffff81202d86>] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213
       [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
       [<ffffffff82717c98>] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline]
       [<ffffffff82717c98>] _raw_spin_lock+0x38/0x50 kernel/locking/spinlock.c:151
       [<ffffffff822b1b58>] spin_lock include/linux/spinlock.h:302 [inline]
       [<ffffffff822b1b58>] __netif_tx_lock include/linux/netdevice.h:3306 [inline]
       [<ffffffff822b1b58>] sch_direct_xmit+0x238/0x700 net/sched/sch_generic.c:163
       [<ffffffff82246aa4>] __dev_xmit_skb net/core/dev.c:2979 [inline]
       [<ffffffff82246aa4>] __dev_queue_xmit+0xd24/0x1bb0 net/core/dev.c:3197
       [<ffffffff82247948>] dev_queue_xmit+0x18/0x20 net/core/dev.c:3263
       [<ffffffff822677e0>] neigh_resolve_output+0x4a0/0x7a0 net/core/neighbour.c:1329
       [<ffffffff8259f877>] dst_neigh_output include/net/dst.h:461 [inline]
       [<ffffffff8259f877>] ip6_finish_output2+0x9c7/0x1dc0 net/ipv6/ip6_output.c:113
       [<ffffffff825b0203>] ip6_finish_output+0x2f3/0x750 net/ipv6/ip6_output.c:131
       [<ffffffff825b0814>] NF_HOOK_COND include/linux/netfilter.h:240 [inline]
       [<ffffffff825b0814>] ip6_output+0x1b4/0x520 net/ipv6/ip6_output.c:145
       [<ffffffff826036dd>] dst_output include/net/dst.h:498 [inline]
       [<ffffffff826036dd>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
       [<ffffffff826036dd>] NF_HOOK include/linux/netfilter.h:249 [inline]
       [<ffffffff826036dd>] ndisc_send_skb+0x98d/0x1110 net/ipv6/ndisc.c:471
       [<ffffffff82606cef>] ndisc_send_ns+0x4bf/0x6b0 net/ipv6/ndisc.c:595
       [<ffffffff82607192>] ndisc_solicit+0x2b2/0x440 net/ipv6/ndisc.c:686
       [<ffffffff8225b508>] neigh_probe+0xc8/0x100 net/core/neighbour.c:871
       [<ffffffff8226699b>] __neigh_event_send+0x2ab/0xc50 net/core/neighbour.c:1027
       [<ffffffff8226792c>] neigh_event_send include/net/neighbour.h:431 [inline]
       [<ffffffff8226792c>] neigh_resolve_output+0x5ec/0x7a0 net/core/neighbour.c:1313
       [<ffffffff8259f877>] dst_neigh_output include/net/dst.h:461 [inline]
       [<ffffffff8259f877>] ip6_finish_output2+0x9c7/0x1dc0 net/ipv6/ip6_output.c:113
       [<ffffffff825b0203>] ip6_finish_output+0x2f3/0x750 net/ipv6/ip6_output.c:131
       [<ffffffff825b0814>] NF_HOOK_COND include/linux/netfilter.h:240 [inline]
       [<ffffffff825b0814>] ip6_output+0x1b4/0x520 net/ipv6/ip6_output.c:145
       [<ffffffff826bf66c>] dst_output include/net/dst.h:498 [inline]
       [<ffffffff826bf66c>] ip6_local_out+0x9c/0x180 net/ipv6/output_core.c:169
       [<ffffffff825b28c2>] ip6_send_skb+0xa2/0x340 net/ipv6/ip6_output.c:1725
       [<ffffffff825b2c1b>] ip6_push_pending_frames+0xbb/0xe0 net/ipv6/ip6_output.c:1745
       [<ffffffff82620f66>] icmpv6_push_pending_frames+0x336/0x530 net/ipv6/icmp.c:276
       [<ffffffff82622666>] icmp6_send+0x1506/0x1b40 net/ipv6/icmp.c:537
       [<ffffffff82624099>] icmpv6_param_prob+0x29/0x40 net/ipv6/icmp.c:551
       [<ffffffff8263e655>] ip6_frag_queue net/ipv6/reassembly.c:190 [inline]
       [<ffffffff8263e655>] ipv6_frag_rcv+0x3ce5/0x51e0 net/ipv6/reassembly.c:531
       [<ffffffff825b3c1d>] ip6_input_finish+0x57d/0x14f0 net/ipv6/ip6_input.c:248
       [<ffffffff825b66a8>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
       [<ffffffff825b66a8>] NF_HOOK include/linux/netfilter.h:249 [inline]
       [<ffffffff825b66a8>] ip6_input+0xf8/0x1f0 net/ipv6/ip6_input.c:280
       [<ffffffff825b317d>] dst_input include/net/dst.h:504 [inline]
       [<ffffffff825b317d>] ip6_rcv_finish+0x14d/0x670 net/ipv6/ip6_input.c:62
       [<ffffffff825b5b51>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
       [<ffffffff825b5b51>] NF_HOOK include/linux/netfilter.h:249 [inline]
       [<ffffffff825b5b51>] ipv6_rcv+0xfc1/0x1a20 net/ipv6/ip6_input.c:186
       [<ffffffff82230640>] __netif_receive_skb_core+0x1300/0x2950 net/core/dev.c:4041
       [<ffffffff82238bd8>] __netif_receive_skb+0x58/0x1c0 net/core/dev.c:4076
       [<ffffffff8223fec0>] process_backlog+0x200/0x630 net/core/dev.c:4673
       [<ffffffff8223f2f7>] napi_poll net/core/dev.c:4911 [inline]
       [<ffffffff8223f2f7>] net_rx_action+0x367/0xd30 net/core/dev.c:4976
       [<ffffffff8271bb16>] __do_softirq+0x226/0xa3f kernel/softirq.c:273
       [<ffffffff82719cdc>] do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:956
       [<ffffffff810e1744>] do_softirq.part.0+0x54/0x60 kernel/softirq.c:317
       [<ffffffff810e18a8>] do_softirq+0x18/0x20 kernel/softirq.c:305
       [<ffffffff8222ec4b>] netif_rx_ni+0xeb/0x3b0 net/core/dev.c:3675
       [<ffffffff81e22f6f>] tun_get_user+0xdbf/0x2640 drivers/net/tun.c:1264
       [<ffffffff81e24a0a>] tun_chr_write_iter+0xda/0x190 drivers/net/tun.c:1283
       [<ffffffff81497941>] do_iter_readv_writev+0x141/0x1e0 fs/read_write.c:666
       [<ffffffff81499539>] compat_do_readv_writev+0x389/0x6e0 fs/read_write.c:984
       [<ffffffff81499c31>] compat_writev+0xe1/0x150 fs/read_write.c:1092
       [<ffffffff8149bf0b>] C_SYSC_writev fs/read_write.c:1112 [inline]
       [<ffffffff8149bf0b>] compat_SyS_writev+0xdb/0x1c0 fs/read_write.c:1101
       [<ffffffff8100603d>] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
       [<ffffffff8100603d>] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397
       [<ffffffff8271a350>] sysenter_flags_fixed+0xd/0x1a

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&(&q->lock)->rlock);
                               lock(_xmit_NETROM);
                               lock(&(&q->lock)->rlock);
  lock(_xmit_NETROM);

 *** DEADLOCK ***

9 locks held by syz-executor.4/7783:
 #0:  (rcu_read_lock){......}, at: [<ffffffff8223fe5c>] __skb_unlink include/linux/skbuff.h:1648 [inline]
 #0:  (rcu_read_lock){......}, at: [<ffffffff8223fe5c>] __skb_dequeue include/linux/skbuff.h:1664 [inline]
 #0:  (rcu_read_lock){......}, at: [<ffffffff8223fe5c>] process_backlog+0x19c/0x630 net/core/dev.c:4670
 #1:  (rcu_read_lock){......}, at: [<ffffffff825b36a0>] ip6_input_finish+0x0/0x14f0 net/ipv6/ip6_input.c:55
 #2:  (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8263b03c>] spin_lock include/linux/spinlock.h:302 [inline]
 #2:  (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8263b03c>] ipv6_frag_rcv+0x6cc/0x51e0 net/ipv6/reassembly.c:528
 #3:  (slock-AF_INET6){+.-...}, at: [<ffffffff8262191d>] spin_trylock include/linux/spinlock.h:312 [inline]
 #3:  (slock-AF_INET6){+.-...}, at: [<ffffffff8262191d>] icmpv6_xmit_lock net/ipv6/icmp.c:120 [inline]
 #3:  (slock-AF_INET6){+.-...}, at: [<ffffffff8262191d>] icmp6_send+0x7bd/0x1b40 net/ipv6/icmp.c:485
 #4:  (rcu_read_lock){......}, at: [<ffffffff826220a4>] icmp6_send+0xf44/0x1b40 net/ipv6/icmp.c:517
 #5:  (rcu_read_lock_bh){......}, at: [<ffffffff8259f091>] ip6_finish_output2+0x1e1/0x1dc0 net/ipv6/ip6_output.c:71
 #6:  (rcu_read_lock){......}, at: [<ffffffff826034c9>] ip6_nd_hdr net/ipv6/ndisc.c:427 [inline]
 #6:  (rcu_read_lock){......}, at: [<ffffffff826034c9>] ndisc_send_skb+0x779/0x1110 net/ipv6/ndisc.c:465
 #7:  (rcu_read_lock_bh){......}, at: [<ffffffff8259f091>] ip6_finish_output2+0x1e1/0x1dc0 net/ipv6/ip6_output.c:71
 #8:  (rcu_read_lock_bh){......}, at: [<ffffffff82245f57>] __dev_queue_xmit+0x1d7/0x1bb0 net/core/dev.c:3161

stack backtrace:
CPU: 0 PID: 7783 Comm: syz-executor.4 Not tainted 4.4.174+ #17
 0000000000000000 27f0cd5916d94986 ffff8801db6064e0 ffffffff81aad1a1
 ffffffff84057a80 ffff8801d2ff5f00 ffffffff83ad51c0 ffffffff83af52c0
 ffffffff83ad51c0 ffff8801db606530 ffffffff813abcda ffff8801db606610
Call Trace:
 <IRQ>  [<ffffffff81aad1a1>] __dump_stack lib/dump_stack.c:15 [inline]
 <IRQ>  [<ffffffff81aad1a1>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<ffffffff813abcda>] print_circular_bug.cold+0x2f7/0x44e kernel/locking/lockdep.c:1226
 [<ffffffff81202d86>] check_prev_add kernel/locking/lockdep.c:1853 [inline]
 [<ffffffff81202d86>] check_prevs_add kernel/locking/lockdep.c:1958 [inline]
 [<ffffffff81202d86>] validate_chain kernel/locking/lockdep.c:2144 [inline]
 [<ffffffff81202d86>] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213
 [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
 [<ffffffff82717c98>] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline]
 [<ffffffff82717c98>] _raw_spin_lock+0x38/0x50 kernel/locking/spinlock.c:151
 [<ffffffff822b1b58>] spin_lock include/linux/spinlock.h:302 [inline]
 [<ffffffff822b1b58>] __netif_tx_lock include/linux/netdevice.h:3306 [inline]
 [<ffffffff822b1b58>] sch_direct_xmit+0x238/0x700 net/sched/sch_generic.c:163
 [<ffffffff82246aa4>] __dev_xmit_skb net/core/dev.c:2979 [inline]
 [<ffffffff82246aa4>] __dev_queue_xmit+0xd24/0x1bb0 net/core/dev.c:3197
 [<ffffffff82247948>] dev_queue_xmit+0x18/0x20 net/core/dev.c:3263
 [<ffffffff822677e0>] neigh_resolve_output+0x4a0/0x7a0 net/core/neighbour.c:1329
 [<ffffffff8259f877>] dst_neigh_output include/net/dst.h:461 [inline]
 [<ffffffff8259f877>] ip6_finish_output2+0x9c7/0x1dc0 net/ipv6/ip6_output.c:113
 [<ffffffff825b0203>] ip6_finish_output+0x2f3/0x750 net/ipv6/ip6_output.c:131
 [<ffffffff825b0814>] NF_HOOK_COND include/linux/netfilter.h:240 [inline]
 [<ffffffff825b0814>] ip6_output+0x1b4/0x520 net/ipv6/ip6_output.c:145
 [<ffffffff826036dd>] dst_output include/net/dst.h:498 [inline]
 [<ffffffff826036dd>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
 [<ffffffff826036dd>] NF_HOOK include/linux/netfilter.h:249 [inline]
 [<ffffffff826036dd>] ndisc_send_skb+0x98d/0x1110 net/ipv6/ndisc.c:471
 [<ffffffff82606cef>] ndisc_send_ns+0x4bf/0x6b0 net/ipv6/ndisc.c:595
 [<ffffffff82607192>] ndisc_solicit+0x2b2/0x440 net/ipv6/ndisc.c:686
 [<ffffffff8225b508>] neigh_probe+0xc8/0x100 net/core/neighbour.c:871
 [<ffffffff8226699b>] __neigh_event_send+0x2ab/0xc50 net/core/neighbour.c:1027
 [<ffffffff8226792c>] neigh_event_send include/net/neighbour.h:431 [inline]
 [<ffffffff8226792c>] neigh_resolve_output+0x5ec/0x7a0 net/core/neighbour.c:1313
 [<ffffffff8259f877>] dst_neigh_output include/net/dst.h:461 [inline]
 [<ffffffff8259f877>] ip6_finish_output2+0x9c7/0x1dc0 net/ipv6/ip6_output.c:113
 [<ffffffff825b0203>] ip6_finish_output+0x2f3/0x750 net/ipv6/ip6_output.c:131
 [<ffffffff825b0814>] NF_HOOK_COND include/linux/netfilter.h:240 [inline]
 [<ffffffff825b0814>] ip6_output+0x1b4/0x520 net/ipv6/ip6_output.c:145
 [<ffffffff826bf66c>] dst_output include/net/dst.h:498 [inline]
 [<ffffffff826bf66c>] ip6_local_out+0x9c/0x180 net/ipv6/output_core.c:169
 [<ffffffff825b28c2>] ip6_send_skb+0xa2/0x340 net/ipv6/ip6_output.c:1725
 [<ffffffff825b2c1b>] ip6_push_pending_frames+0xbb/0xe0 net/ipv6/ip6_output.c:1745
 [<ffffffff82620f66>] icmpv6_push_pending_frames+0x336/0x530 net/ipv6/icmp.c:276
 [<ffffffff82622666>] icmp6_send+0x1506/0x1b40 net/ipv6/icmp.c:537
 [<ffffffff82624099>] icmpv6_param_prob+0x29/0x40 net/ipv6/icmp.c:551
 [<ffffffff8263e655>] ip6_frag_queue net/ipv6/reassembly.c:190 [inline]
 [<ffffffff8263e655>] ipv6_frag_rcv+0x3ce5/0x51e0 net/ipv6/reassembly.c:531
 [<ffffffff825b3c1d>] ip6_input_finish+0x57d/0x14f0 net/ipv6/ip6_input.c:248
 [<ffffffff825b66a8>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
 [<ffffffff825b66a8>] NF_HOOK include/linux/netfilter.h:249 [inline]
 [<ffffffff825b66a8>] ip6_input+0xf8/0x1f0 net/ipv6/ip6_input.c:280
 [<ffffffff825b317d>] dst_input include/net/dst.h:504 [inline]
 [<ffffffff825b317d>] ip6_rcv_finish+0x14d/0x670 net/ipv6/ip6_input.c:62
 [<ffffffff825b5b51>] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline]
 [<ffffffff825b5b51>] NF_HOOK include/linux/netfilter.h:249 [inline]
 [<ffffffff825b5b51>] ipv6_rcv+0xfc1/0x1a20 net/ipv6/ip6_input.c:186
 [<ffffffff82230640>] __netif_receive_skb_core+0x1300/0x2950 net/core/dev.c:4041
 [<ffffffff82238bd8>] __netif_receive_skb+0x58/0x1c0 net/core/dev.c:4076
 [<ffffffff8223fec0>] process_backlog+0x200/0x630 net/core/dev.c:4673
 [<ffffffff8223f2f7>] napi_poll net/core/dev.c:4911 [inline]
 [<ffffffff8223f2f7>] net_rx_action+0x367/0xd30 net/core/dev.c:4976
 [<ffffffff8271bb16>] __do_softirq+0x226/0xa3f kernel/softirq.c:273
 [<ffffffff82719cdc>] do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:956
 <EOI>  [<ffffffff810e1744>] do_softirq.part.0+0x54/0x60 kernel/softirq.c:317
 [<ffffffff810e18a8>] do_softirq+0x18/0x20 kernel/softirq.c:305
 [<ffffffff8222ec4b>] netif_rx_ni+0xeb/0x3b0 net/core/dev.c:3675
 [<ffffffff81e22f6f>] tun_get_user+0xdbf/0x2640 drivers/net/tun.c:1264
 [<ffffffff81e24a0a>] tun_chr_write_iter+0xda/0x190 drivers/net/tun.c:1283
 [<ffffffff81497941>] do_iter_readv_writev+0x141/0x1e0 fs/read_write.c:666
 [<ffffffff81499539>] compat_do_readv_writev+0x389/0x6e0 fs/read_write.c:984
 [<ffffffff81499c31>] compat_writev+0xe1/0x150 fs/read_write.c:1092
 [<ffffffff8149bf0b>] C_SYSC_writev fs/read_write.c:1112 [inline]
 [<ffffffff8149bf0b>] compat_SyS_writev+0xdb/0x1c0 fs/read_write.c:1101
 [<ffffffff8100603d>] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 [<ffffffff8100603d>] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397
 [<ffffffff8271a350>] sysenter_flags_fixed+0xd/0x1a