====================================================== [ INFO: possible circular locking dependency detected ] 4.4.162+ #7 Not tainted ------------------------------------------------------- syz-executor119/2085 is trying to acquire lock: (&(&q->lock)->rlock){+.-...}, at: [] spin_lock include/linux/spinlock.h:302 [inline] (&(&q->lock)->rlock){+.-...}, at: [] ip_defrag+0x31b/0x40c0 net/ipv4/ip_fragment.c:680 but task is already holding lock: (_xmit_NETROM){+.-...}, at: [] spin_lock include/linux/spinlock.h:302 [inline] (_xmit_NETROM){+.-...}, at: [] __netif_tx_lock include/linux/netdevice.h:3306 [inline] (_xmit_NETROM){+.-...}, at: [] sch_direct_xmit+0x233/0x6c0 net/sched/sch_generic.c:163 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:112 [inline] [] _raw_spin_lock_irqsave+0x4e/0x70 kernel/locking/spinlock.c:159 [] depot_save_stack+0x20b/0x5eb lib/stackdepot.c:252 [] save_stack mm/kasan/kasan.c:518 [inline] [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc.part.1+0xc9/0xf0 mm/kasan/kasan.c:616 [] kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:601 [] kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:554 [] slab_post_alloc_hook mm/slub.c:1349 [inline] [] slab_alloc_node mm/slub.c:2615 [inline] [] slab_alloc mm/slub.c:2623 [inline] [] kmem_cache_alloc+0xdc/0x2c0 mm/slub.c:2628 [] inet_getpeer+0x159d/0x1d70 net/ipv4/inetpeer.c:444 [] inet_getpeer_v6 include/net/inetpeer.h:127 [inline] [] icmpv6_xrlim_allow net/ipv6/icmp.c:211 [inline] [] icmp6_send+0x17b7/0x1b70 net/ipv6/icmp.c:491 [] icmpv6_param_prob+0x29/0x40 net/ipv6/icmp.c:551 [] ip6_frag_queue net/ipv6/reassembly.c:228 [inline] [] ipv6_frag_rcv+0x3ba5/0x4f80 net/ipv6/reassembly.c:562 [] ip6_input_finish+0x57d/0x1510 net/ipv6/ip6_input.c:248 [] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline] [] NF_HOOK include/linux/netfilter.h:249 [inline] [] ip6_input+0xf6/0x200 net/ipv6/ip6_input.c:280 [] dst_input include/net/dst.h:504 [inline] [] ip6_rcv_finish+0x14e/0x670 net/ipv6/ip6_input.c:62 [] NF_HOOK_THRESH include/linux/netfilter.h:226 [inline] [] ipv6_defrag+0x33b/0x5c0 net/ipv6/netfilter/nf_defrag_ipv6_hooks.c:78 [] nf_iterate+0x182/0x210 net/netfilter/core.c:274 [] nf_hook_slow+0x1b6/0x340 net/netfilter/core.c:306 [] nf_hook_thresh include/linux/netfilter.h:187 [inline] [] NF_HOOK_THRESH include/linux/netfilter.h:224 [inline] [] NF_HOOK include/linux/netfilter.h:249 [inline] [] ipv6_rcv+0x1455/0x1d10 net/ipv6/ip6_input.c:186 [] __netif_receive_skb_core+0x12c8/0x2820 net/core/dev.c:4041 [] __netif_receive_skb+0x5b/0x1c0 net/core/dev.c:4076 [] process_backlog+0x20a/0x670 net/core/dev.c:4669 [] napi_poll net/core/dev.c:4907 [inline] [] net_rx_action+0x367/0xd50 net/core/dev.c:4972 [] __do_softirq+0x22c/0xa1a kernel/softirq.c:273 [] invoke_softirq kernel/softirq.c:350 [inline] [] irq_exit+0x10d/0x140 kernel/softirq.c:391 [] exiting_irq arch/x86/include/asm/apic.h:652 [inline] [] do_IRQ+0x10d/0x1c0 arch/x86/kernel/irq.c:251 [] ret_from_intr+0x0/0x20 [] netif_rx_internal+0x15b/0x700 net/core/dev.c:3637 [] netif_rx_ni+0xa5/0x3a0 net/core/dev.c:3673 [] tun_get_user+0xf3a/0x2690 drivers/net/tun.c:1264 [] tun_chr_write_iter+0xd5/0x190 drivers/net/tun.c:1283 [] do_iter_readv_writev+0x133/0x1d0 fs/read_write.c:664 [] compat_do_readv_writev+0x337/0x6f0 fs/read_write.c:982 [] compat_writev+0xe1/0x150 fs/read_write.c:1090 [] C_SYSC_writev fs/read_write.c:1110 [inline] [] compat_SyS_writev+0xd8/0x1c0 fs/read_write.c:1099 [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x31e/0xa80 arch/x86/entry/common.c:463 [] sysenter_flags_fixed+0xd/0x1a [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x3e6c/0x5f10 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline] [] _raw_spin_lock+0x36/0x50 kernel/locking/spinlock.c:151 [] spin_lock include/linux/spinlock.h:302 [inline] [] ip_defrag+0x31b/0x40c0 net/ipv4/ip_fragment.c:680 [] ip_check_defrag+0x3a7/0x710 net/ipv4/ip_fragment.c:724 [] packet_rcv_fanout+0x52a/0x5e0 net/packet/af_packet.c:1458 [] dev_queue_xmit_nit net/core/dev.c:1935 [inline] [] xmit_one net/core/dev.c:2777 [inline] [] dev_hard_start_xmit+0x650/0x11c0 net/core/dev.c:2797 [] sch_direct_xmit+0x2b8/0x6c0 net/sched/sch_generic.c:165 [] __dev_xmit_skb net/core/dev.c:2979 [inline] [] __dev_queue_xmit+0xf95/0x1c30 net/core/dev.c:3197 [] dev_queue_xmit+0x17/0x20 net/core/dev.c:3263 [] neigh_resolve_output+0x600/0x780 net/core/neighbour.c:1329 [] dst_neigh_output include/net/dst.h:461 [inline] [] ip_finish_output2+0x8f0/0x1100 net/ipv4/ip_output.c:213 [] ip_do_fragment+0x1870/0x1f60 net/ipv4/ip_output.c:635 [] ip_fragment.constprop.5+0x145/0x200 net/ipv4/ip_output.c:505 [] ip_finish_output+0x396/0xc00 net/ipv4/ip_output.c:286 [] NF_HOOK_COND include/linux/netfilter.h:240 [inline] [] ip_mc_output+0x237/0x980 net/ipv4/ip_output.c:347 [] dst_output include/net/dst.h:498 [inline] [] ip_local_out+0x9b/0x180 net/ipv4/ip_output.c:119 [] ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1453 [] udp_send_skb+0x503/0xc70 net/ipv4/udp.c:842 [] udp_sendmsg+0x16c9/0x1c70 net/ipv4/udp.c:1072 [] inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:755 [] sock_sendmsg_nosec net/socket.c:638 [inline] [] sock_sendmsg+0xbb/0x110 net/socket.c:648 [] SYSC_sendto net/socket.c:1678 [inline] [] SyS_sendto+0x220/0x370 net/socket.c:1646 [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x31e/0xa80 arch/x86/entry/common.c:463 [] sysenter_flags_fixed+0xd/0x1a other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(_xmit_NETROM); lock(&(&q->lock)->rlock); lock(_xmit_NETROM); lock(&(&q->lock)->rlock); *** DEADLOCK *** 4 locks held by syz-executor119/2085: #0: (rcu_read_lock_bh){......}, at: [] ip_finish_output2+0x20b/0x1100 net/ipv4/ip_output.c:193 #1: (rcu_read_lock_bh){......}, at: [] __dev_queue_xmit+0x1d7/0x1c30 net/core/dev.c:3161 #2: (_xmit_NETROM){+.-...}, at: [] spin_lock include/linux/spinlock.h:302 [inline] #2: (_xmit_NETROM){+.-...}, at: [] __netif_tx_lock include/linux/netdevice.h:3306 [inline] #2: (_xmit_NETROM){+.-...}, at: [] sch_direct_xmit+0x233/0x6c0 net/sched/sch_generic.c:163 #3: (rcu_read_lock){......}, at: [] xmit_one net/core/dev.c:2776 [inline] #3: (rcu_read_lock){......}, at: [] dev_hard_start_xmit+0xa8/0x11c0 net/core/dev.c:2797 stack backtrace: CPU: 1 PID: 2085 Comm: syz-executor119 Not tainted 4.4.162+ #7 0000000000000000 58a7002b0ad2e19a ffff8801d3f86d18 ffffffff81a994bd ffffffff83acb680 ffffffff83acbd40 ffffffff83acb680 ffff8801d5df38b8 ffff8801d5df2f80 ffff8801d3f86d60 ffffffff813a834a 0000000000000003 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_circular_bug.cold.34+0x2f7/0x432 kernel/locking/lockdep.c:1226 [] check_prev_add kernel/locking/lockdep.c:1853 [inline] [] check_prevs_add kernel/locking/lockdep.c:1958 [inline] [] validate_chain kernel/locking/lockdep.c:2144 [inline] [] __lock_acquire+0x3e6c/0x5f10 kernel/locking/lockdep.c:3213 [] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592 [] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline] [] _raw_spin_lock+0x36/0x50 kernel/locking/spinlock.c:151 [] spin_lock include/linux/spinlock.h:302 [inline] [] ip_defrag+0x31b/0x40c0 net/ipv4/ip_fragment.c:680 [] ip_check_defrag+0x3a7/0x710 net/ipv4/ip_fragment.c:724 [] packet_rcv_fanout+0x52a/0x5e0 net/packet/af_packet.c:1458 [] dev_queue_xmit_nit net/core/dev.c:1935 [inline] [] xmit_one net/core/dev.c:2777 [inline] [] dev_hard_start_xmit+0x650/0x11c0 net/core/dev.c:2797 [] sch_direct_xmit+0x2b8/0x6c0 net/sched/sch_generic.c:165 [] __dev_xmit_skb net/core/dev.c:2979 [inline] [] __dev_queue_xmit+0xf95/0x1c30 net/core/dev.c:3197 [] dev_queue_xmit+0x17/0x20 net/core/dev.c:3263 [] neigh_resolve_output+0x600/0x780 net/core/neighbour.c:1329 [] dst_neigh_output include/net/dst.h:461 [inline] [] ip_finish_output2+0x8f0/0x1100 net/ipv4/ip_output.c:213 [] ip_do_fragment+0x1870/0x1f60 net/ipv4/ip_output.c:635 [] ip_fragment.constprop.5+0x145/0x200 net/ipv4/ip_output.c:505 [] ip_finish_output+0x396/0xc00 net/ipv4/ip_output.c:286 [] NF_HOOK_COND include/linux/netfilter.h:240 [inline] [] ip_mc_output+0x237/0x980 net/ipv4/ip_output.c:347 [] dst_output include/net/dst.h:498 [inline] [] ip_local_out+0x9b/0x180 net/ipv4/ip_output.c:119 [] ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1453 [] udp_send_skb+0x503/0xc70 net/ipv4/udp.c:842 [] udp_sendmsg+0x16c9/0x1c70 net/ipv4/udp.c:1072 [] inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:755 [] sock_sendmsg_nosec net/socket.c:638 [inline] [] sock_sendmsg+0xbb/0x110 net/socket.c:648 [] SYSC_sendto net/socket.c:1678 [inline] [] SyS_sendto+0x220/0x370 net/socket.c:1646 [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x31e/0xa80 arch/x86/entry/common.c:463 [] sysenter_flags_fixed+0xd/0x1a