====================================================== WARNING: possible circular locking dependency detected 4.15.0-rc9+ #214 Not tainted netlink: 'syz-executor3': attribute type 19 has an invalid length. ------------------------------------------------------ syz-executor4/5285 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [<00000000a4c97f76>] xt_find_target+0x44/0x1e0 net/netfilter/x_tables.c:229 but task is already holding lock: (sk_lock-AF_INET6){+.+.}, at: [<00000000b5cac929>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET6){+.+.}, at: [<00000000b5cac929>] ipv6_setsockopt+0xff/0x150 net/ipv6/ipv6_sockglue.c:927 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:2780 lock_sock include/net/sock.h:1463 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x150 net/ipv6/ipv6_sockglue.c:922 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2896 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 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:508 cleanup_entry+0x218/0x350 net/ipv4/netfilter/ip_tables.c:659 __do_replace+0x79d/0xa50 net/ipv4/netfilter/ip_tables.c:1094 do_replace net/ipv4/netfilter/ip_tables.c:1150 [inline] do_ipt_set_ctl+0x40f/0x5f0 net/ipv4/netfilter/ip_tables.c:1680 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0xa1/0xb0 net/ipv4/ip_sockglue.c:1260 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2896 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 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:3914 __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_target+0x44/0x1e0 net/netfilter/x_tables.c:229 xt_request_find_target+0x2c/0xb0 net/netfilter/x_tables.c:255 find_check_entry.isra.7+0x669/0xcf0 net/ipv6/netfilter/ip6_tables.c:572 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749 do_replace net/ipv6/netfilter/ip6_tables.c:1165 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1691 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1422 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 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-executor4/5285: #0: (sk_lock-AF_INET6){+.+.}, at: [<00000000b5cac929>] lock_sock include/net/sock.h:1463 [inline] #0: (sk_lock-AF_INET6){+.+.}, at: [<00000000b5cac929>] ipv6_setsockopt+0xff/0x150 net/ipv6/ipv6_sockglue.c:927 stack backtrace: CPU: 0 PID: 5285 Comm: syz-executor4 Not tainted 4.15.0-rc9+ #214 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.37+0x2cd/0x2dc kernel/locking/lockdep.c:1218 check_prev_add kernel/locking/lockdep.c:1858 [inline] check_prevs_add kernel/locking/lockdep.c:1971 [inline] validate_chain kernel/locking/lockdep.c:2412 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3426 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914 __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_target+0x44/0x1e0 net/netfilter/x_tables.c:229 xt_request_find_target+0x2c/0xb0 net/netfilter/x_tables.c:255 find_check_entry.isra.7+0x669/0xcf0 net/ipv6/netfilter/ip6_tables.c:572 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749 do_replace net/ipv6/netfilter/ip6_tables.c:1165 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1691 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1422 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007f56c5243c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000014 RBP: 00000000000005c5 R08: 0000000000000408 R09: 0000000000000000 R10: 0000000020007000 R11: 0000000000000212 R12: 00000000006f7b18 R13: 00000000ffffffff R14: 00007f56c52446d4 R15: 0000000000000000 xt_CT: No such helper "pptp" netlink: 'syz-executor5': attribute type 17 has an invalid length. netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 'syz-executor5': attribute type 17 has an invalid length. netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 'syz-executor5': attribute type 20 has an invalid length. TCP: request_sock_TCPv6: Possible SYN flooding on port 20022. Sending cookies. Check SNMP counters. netlink: 40 bytes leftover after parsing attributes in process `syz-executor4'. sctp: [Deprecated]: syz-executor0 (pid 5914) Use of int in max_burst socket option. Use struct sctp_assoc_value instead Cannot find del_set index 0 as target sctp: [Deprecated]: syz-executor0 (pid 5893) Use of int in max_burst socket option. Use struct sctp_assoc_value instead dccp_close: ABORT with 1 bytes unread IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route IPv6: NLM_F_CREATE should be set when creating new route SELinux: unrecognized netlink message: protocol=4 nlmsg_type=24 sclass=netlink_tcpdiag_socket pig=6260 comm=syz-executor5 xt_HMARK: spi-set and port-set can't be combined Cannot find add_set index 0 as target Protocol error: SET target dimension is over the limit! Cannot find add_set index 0 as target kauditd_printk_skb: 15 callbacks suppressed audit: type=1400 audit(1517210649.772:37): avc: denied { connect } for pid=6390 comm="syz-executor2" 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 validate_nla: 3 callbacks suppressed netlink: 'syz-executor5': attribute type 17 has an invalid length. netlink: 'syz-executor5': attribute type 17 has an invalid length. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=260 sclass=netlink_route_socket pig=6639 comm=syz-executor3 audit: type=1400 audit(1517210650.413:38): avc: denied { map } for pid=6630 comm="syz-executor2" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=15246 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:hugetlbfs_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=260 sclass=netlink_route_socket pig=6648 comm=syz-executor3 device lo entered promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode audit: type=1400 audit(1517210650.743:39): avc: denied { map } for pid=6752 comm="syz-executor0" path="socket:[16102]" dev="sockfs" ino=16102 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=socket permissive=1 audit: type=1400 audit(1517210650.962:40): avc: denied { create } for pid=6843 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_connector_socket permissive=1 audit: type=1400 audit(1517210650.963:41): avc: denied { read } for pid=6843 comm="syz-executor7" 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 audit: type=1400 audit(1517210650.963:42): avc: denied { write } for pid=6843 comm="syz-executor7" path="socket:[16166]" dev="sockfs" ino=16166 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_connector_socket permissive=1 audit: type=1400 audit(1517210651.128:43): avc: denied { ioctl } for pid=6877 comm="syz-executor0" path="socket:[16451]" dev="sockfs" ino=16451 ioctlcmd=0x89e2 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=sock_file permissive=1 audit: type=1400 audit(1517210651.161:44): avc: denied { setopt } for pid=6877 comm="syz-executor0" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 audit: type=1400 audit(1517210651.425:45): avc: denied { map } for pid=6998 comm="syz-executor1" path="socket:[16526]" dev="sockfs" ino=16526 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 audit: type=1400 audit(1517210651.458:46): avc: denied { getopt } for pid=6997 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_generic_socket permissive=1 ipt_CLUSTERIP: Please specify destination IP ipt_CLUSTERIP: Please specify destination IP ip6t_REJECT: TCP_RESET illegal for non-tcp netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 'syz-executor7': attribute type 1 has an invalid length. netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 'syz-executor7': attribute type 1 has an invalid length. netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. dccp_invalid_packet: P.Data Offset(0) too small netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. xt_policy: neither incoming nor outgoing policy selected mip6: mip6_rthdr_init_state: state's mode is not 2: 0 mip6: mip6_rthdr_init_state: state's mode is not 2: 0 do_dccp_setsockopt: sockopt(PACKET_SIZE) is deprecated: fix your app 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 do_dccp_setsockopt: sockopt(PACKET_SIZE) is deprecated: fix your app kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 7537 Comm: syz-executor6 Not tainted 4.15.0-rc9+ #214 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:ip6t_do_table+0x12de/0x19d0 net/ipv6/netfilter/ip6_tables.c:360 RSP: 0018:ffff8801db206c60 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8801c8530080 RCX: ffffffff84d67822 RDX: 0000000000000100 RSI: 0000000000000000 RDI: ffff8801c85301de RBP: ffff8801db206e68 R08: ffff8801db206f60 R09: 0000000000000000 R10: 00000000000000d0 R11: ffffffff86b41580 R12: 0000000000000001 R13: 0000000000000000 R14: dffffc0000000000 R15: ffff8801c8530150 FS: 00007fb912268700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002075ffe4 CR3: 00000001bdb3e004 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ip6table_security_hook+0x65/0x80 net/ipv6/netfilter/ip6table_security.c:45 nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline] nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483 nf_hook include/linux/netfilter.h:243 [inline] NF_HOOK include/linux/netfilter.h:286 [inline] ip6_input+0x35c/0x560 net/ipv6/ip6_input.c:327 dst_input include/net/dst.h:449 [inline] ip6_rcv_finish+0x297/0x8c0 net/ipv6/ip6_input.c:71 NF_HOOK include/linux/netfilter.h:288 [inline] ipv6_rcv+0xf37/0x1fa0 net/ipv6/ip6_input.c:208 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4547 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4612 process_backlog+0x203/0x740 net/core/dev.c:5292 napi_poll net/core/dev.c:5690 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5756 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1150 do_softirq.part.19+0x14d/0x190 kernel/softirq.c:329 do_softirq kernel/softirq.c:177 [inline] __local_bh_enable_ip+0x1ee/0x230 kernel/softirq.c:182 local_bh_enable include/linux/bottom_half.h:32 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:727 [inline] ip6_finish_output2+0xba0/0x23a0 net/ipv6/ip6_output.c:121 ip6_finish_output+0x698/0xaf0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:277 [inline] ip6_output+0x1eb/0x840 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:288 [inline] ip6_xmit+0xe1f/0x2260 net/ipv6/ip6_output.c:277 inet6_csk_xmit+0x2fc/0x580 net/ipv6/inet6_connection_sock.c:139 tcp_transmit_skb+0x1b12/0x38b0 net/ipv4/tcp_output.c:1176 tcp_send_syn_data net/ipv4/tcp_output.c:3461 [inline] tcp_connect+0x1f42/0x4110 net/ipv4/tcp_output.c:3500 tcp_v6_connect+0x2083/0x26c0 net/ipv6/tcp_ipv6.c:306 __inet_stream_connect+0x2d4/0xf00 net/ipv4/af_inet.c:620 tcp_sendmsg_fastopen net/ipv4/tcp.c:1168 [inline] tcp_sendmsg_locked+0x264e/0x3c70 net/ipv4/tcp.c:1214 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1463 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:764 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007fb912267c58 EFLAGS: 00000212 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: ffffffffffffffdb RSI: 00000000202a0b14 RDI: 0000000000000013 RBP: 0000000000000465 R08: 000000002072e000 R09: 000000000000001c R10: 00000000200408d4 R11: 0000000000000212 R12: 00000000006f5a18 R13: 00000000ffffffff R14: 00007fb9122686d4 R15: 0000000000000000 Code: 41 f6 87 83 00 00 00 04 75 37 e8 1e b9 99 fc 8b 85 54 fe ff ff 48 8b b5 90 fe ff ff 4c 8d 2c c6 44 8d 60 01 4c 89 e8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 5c 03 00 00 4d 89 7d 00 44 89 a5 54 fe ff RIP: ip6t_do_table+0x12de/0x19d0 net/ipv6/netfilter/ip6_tables.c:360 RSP: ffff8801db206c60 ---[ end trace cba97b2995f1bb53 ]---