====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #221 Not tainted ------------------------------------------------------ syz-executor6/6144 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [<00000000a45c27c5>] xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1041 but task is already holding lock: (sk_lock-AF_INET6){+.+.}, at: [<000000009335b4c0>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET6){+.+.}, at: [<000000009335b4c0>] ipv6_getsockopt+0x1c5/0x2e0 net/ipv6/ipv6_sockglue.c:1370 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sk_lock-AF_INET6){+.+.}: lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x130 net/ipv6/ipv6_sockglue.c:922 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4104 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #1 (rtnl_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 unregister_netdevice_notifier+0x91/0x4e0 net/core/dev.c:1673 clusterip_config_entry_put net/ipv4/netfilter/ipt_CLUSTERIP.c:114 [inline] clusterip_tg_destroy+0x389/0x6e0 net/ipv4/netfilter/ipt_CLUSTERIP.c:518 cleanup_entry+0x218/0x350 net/ipv4/netfilter/ip_tables.c:654 __do_replace+0x79d/0xa50 net/ipv4/netfilter/ip_tables.c:1089 do_replace net/ipv4/netfilter/ip_tables.c:1145 [inline] do_ipt_set_ctl+0x40f/0x5f0 net/ipv4/netfilter/ip_tables.c:1675 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0x97/0xa0 net/ipv4/ip_sockglue.c:1259 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2905 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #0 (&xt[i].mutex){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1041 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1088 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_ip6t_get_ctl+0x159/0xaf0 net/ipv6/netfilter/ip6_tables.c:1710 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x1df/0x2e0 net/ipv6/ipv6_sockglue.c:1371 sctp_getsockopt+0x450/0x739a net/sctp/socket.c:7087 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2934 SYSC_getsockopt net/socket.c:1880 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1862 entry_SYSCALL_64_fastpath+0x29/0xa0 other info that might help us debug this: Chain exists of: &xt[i].mutex --> rtnl_mutex --> sk_lock-AF_INET6 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sk_lock-AF_INET6); lock(rtnl_mutex); lock(sk_lock-AF_INET6); lock(&xt[i].mutex); *** DEADLOCK *** 1 lock held by syz-executor6/6144: #0: (sk_lock-AF_INET6){+.+.}, at: [<000000009335b4c0>] lock_sock include/net/sock.h:1463 [inline] #0: (sk_lock-AF_INET6){+.+.}, at: [<000000009335b4c0>] ipv6_getsockopt+0x1c5/0x2e0 net/ipv6/ipv6_sockglue.c:1370 stack backtrace: CPU: 1 PID: 6144 Comm: syz-executor6 Not tainted 4.15.0+ #221 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2417 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1041 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1088 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_ip6t_get_ctl+0x159/0xaf0 net/ipv6/netfilter/ip6_tables.c:1710 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x1df/0x2e0 net/ipv6/ipv6_sockglue.c:1371 sctp_getsockopt+0x450/0x739a net/sctp/socket.c:7087 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2934 SYSC_getsockopt net/socket.c:1880 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1862 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007f9f813dbc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007f9f813dc700 RCX: 0000000000453299 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000013 RBP: 0000000000000000 R08: 000000002000cffc R09: 0000000000000000 R10: 000000002000efac R11: 0000000000000212 R12: 0000000000000000 R13: 0000000000a2f33f R14: 00007f9f813dc9c0 R15: 0000000000000000 xt_TPROXY: Can be used only in combination with either -p tcp or -p udp xt_TPROXY: Can be used only in combination with either -p tcp or -p udp IPv6: Can't replace route, no match found IPv6: Can't replace route, no match found TCP: request_sock_TCP: Possible SYN flooding on port 20006. Sending cookies. Check SNMP counters. Protocol error: SET target dimension is over the limit! kauditd_printk_skb: 17 callbacks suppressed audit: type=1400 audit(1518129056.941:39): avc: denied { getopt } for pid=6355 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 sctp: [Deprecated]: syz-executor2 (pid 6400) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor2 (pid 6418) Use of int in maxseg socket option. Use struct sctp_assoc_value instead xt_CT: netfilter: NOTRACK target is deprecated, use CT instead or upgrade iptables xt_CT: No such helper "snmp" xt_CT: No such helper "snmp" RDS: rds_bind could not find a transport for 172.20.0.187, load rds_tcp or rds_rdma? RDS: rds_bind could not find a transport for 172.20.0.187, load rds_tcp or rds_rdma? SELinux: unrecognized netlink message: protocol=4 nlmsg_type=6619 sclass=netlink_tcpdiag_socket pig=6628 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=6619 sclass=netlink_tcpdiag_socket pig=6637 comm=syz-executor4 audit: type=1400 audit(1518129057.723:40): avc: denied { read } for pid=6658 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. audit: type=1400 audit(1518129057.762:41): avc: denied { accept } for pid=6658 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=56 sclass=netlink_route_socket pig=6705 comm=syz-executor7 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=56 sclass=netlink_route_socket pig=6705 comm=syz-executor7 RDS: rds_bind could not find a transport for 172.20.0.21, load rds_tcp or rds_rdma? RDS: rds_bind could not find a transport for 172.20.0.21, load rds_tcp or rds_rdma? netlink: 3 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor5'. audit: type=1400 audit(1518129058.932:42): avc: denied { create } for pid=7032 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_scsitransport_socket permissive=1 device erspan0 entered promiscuous mode TCP: request_sock_TCP: Possible SYN flooding on port 20014. Sending cookies. Check SNMP counters. netlink: 'syz-executor0': attribute type 10 has an invalid length. sctp: [Deprecated]: syz-executor6 (pid 7234) Use of int in maxseg socket option. Use struct sctp_assoc_value instead netlink: 'syz-executor0': attribute type 10 has an invalid length. sctp: [Deprecated]: syz-executor6 (pid 7256) Use of int in maxseg socket option. Use struct sctp_assoc_value instead netlink: 'syz-executor1': attribute type 21 has an invalid length. insert transport fail, errno -17 sctp: [Deprecated]: syz-executor5 (pid 7310) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor5 (pid 7310) Use of int in max_burst socket option. Use struct sctp_assoc_value instead TCP: request_sock_TCPv6: Possible SYN flooding on port 20026. Sending cookies. Check SNMP counters. netlink: 'syz-executor0': attribute type 1 has an invalid length. audit: type=1400 audit(1518129060.713:43): avc: denied { map } for pid=7422 comm="syz-executor4" path="socket:[16874]" dev="sockfs" ino=16874 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=packet_socket permissive=1 netlink: 'syz-executor0': attribute type 1 has an invalid length. dccp_xmit_packet: Payload too large (65423) for featneg. dccp_xmit_packet: Payload too large (65423) for featneg. audit: type=1400 audit(1518129061.472:44): avc: denied { ioctl } for pid=7703 comm="syz-executor3" path="socket:[17108]" dev="sockfs" ino=17108 ioctlcmd=0x8933 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium ipt_CLUSTERIP: ipt_CLUSTERIP is deprecated and it will removed soon, use xt_cluster instead audit: type=1400 audit(1518129062.495:45): avc: denied { connect } for pid=8045 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=24 sclass=netlink_audit_socket pig=8105 comm=syz-executor7 ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' ieee80211 phy5: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1518129062.932:46): avc: denied { map } for pid=8214 comm="syz-executor1" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=18533 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:hugetlbfs_t:s0 tclass=file permissive=1 device lo entered promiscuous mode netlink: 'syz-executor4': attribute type 3 has an invalid length. netlink: 'syz-executor4': attribute type 3 has an invalid length. ipt_CLUSTERIP: bad local_nodes[1] 0 ipt_CLUSTERIP: bad local_nodes[1] 0 netlink: 8 bytes leftover after parsing attributes in process `syz-executor3'. sctp: [Deprecated]: syz-executor7 (pid 8319) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead openvswitch: netlink: Flow set message rejected, Key attribute missing. sctp: [Deprecated]: syz-executor7 (pid 8353) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead openvswitch: netlink: Flow set message rejected, Key attribute missing. device syz3 entered promiscuous mode device syz3 left promiscuous mode device syz3 entered promiscuous mode device syz3 left promiscuous mode SELinux: unrecognized netlink message: protocol=4 nlmsg_type=26 sclass=netlink_tcpdiag_socket pig=8439 comm=syz-executor2 device syz0 entered promiscuous mode netlink: 'syz-executor5': attribute type 26 has an invalid length. RDS: rds_bind could not find a transport for 172.20.0.187, load rds_tcp or rds_rdma? netlink: 'syz-executor5': attribute type 26 has an invalid length. sctp: [Deprecated]: syz-executor1 (pid 8714) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor1 (pid 8714) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead can: request_module (can-proto-6) failed. can: request_module (can-proto-6) failed. sctp: [Deprecated]: syz-executor4 (pid 8928) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor4 (pid 8938) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead ieee80211 phy6: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1518129064.923:47): avc: denied { write } for pid=8973 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1400 audit(1518129065.121:48): avc: denied { ioctl } for pid=9025 comm="syz-executor6" path="socket:[19166]" dev="sockfs" ino=19166 ioctlcmd=0x89a1 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 sctp: [Deprecated]: syz-executor0 (pid 9077) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor0 (pid 9077) Use of int in maxseg socket option. Use struct sctp_assoc_value instead Cannot find add_set index 0 as target audit: type=1400 audit(1518129065.414:49): avc: denied { map } for pid=9131 comm="syz-executor1" path="socket:[19278]" dev="sockfs" ino=19278 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=udp_socket permissive=1 Cannot find add_set index 0 as target