====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #220 Not tainted ------------------------------------------------------ syz-executor6/5579 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [<00000000aa3ff9f1>] xt_find_target+0x44/0x1e0 net/netfilter/x_tables.c:229 but task is already holding lock: (sk_lock-AF_INET6){+.+.}, at: [<000000001908d9dd>] lock_sock include/net/sock.h:1461 [inline] (sk_lock-AF_INET6){+.+.}, at: [<000000001908d9dd>] 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:1461 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x150 net/ipv6/ipv6_sockglue.c:922 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 -> #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 tee_tg_destroy+0x61/0xc0 net/netfilter/xt_TEE.c:123 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+0xa1/0xb0 net/ipv4/ip_sockglue.c:1260 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2905 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: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_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:567 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:744 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1686 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-executor6/5579: #0: (sk_lock-AF_INET6){+.+.}, at: [<000000001908d9dd>] lock_sock include/net/sock.h:1461 [inline] #0: (sk_lock-AF_INET6){+.+.}, at: [<000000001908d9dd>] ipv6_setsockopt+0xff/0x150 net/ipv6/ipv6_sockglue.c:927 stack backtrace: CPU: 0 PID: 5579 Comm: syz-executor6 Not tainted 4.15.0+ #220 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_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:567 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:744 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1686 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:00007f5ff82bcc58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f5ff82bd700 RCX: 0000000000453299 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000014 RBP: 0000000000000000 R08: 00000000000003a0 R09: 0000000000000000 R10: 0000000020019c48 R11: 0000000000000212 R12: 0000000000000000 R13: 0000000000a2f33f R14: 00007f5ff82bd9c0 R15: 0000000000000000 sctp: failed to load transform for md5: -2 x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1034 sclass=netlink_route_socket pig=5613 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1034 sclass=netlink_route_socket pig=5613 comm=syz-executor4 netlink: 'syz-executor6': attribute type 21 has an invalid length. netlink: 'syz-executor6': attribute type 21 has an invalid length. netlink: 'syz-executor5': attribute type 21 has an invalid length. netlink: 1 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 'syz-executor5': attribute type 21 has an invalid length. netlink: 1 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor0'. xt_connbytes: Forcing CT accounting to be enabled dccp_close: ABORT with 28 bytes unread sctp: [Deprecated]: syz-executor3 (pid 5772) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor3 (pid 5790) Use of int in maxseg socket option. Use struct sctp_assoc_value instead bpf: check failed: parse error bpf: check failed: parse error skbuff: bad partial csum: csum=8/65535 len=14 skbuff: bad partial csum: csum=8/65535 len=14 netlink: 'syz-executor6': attribute type 3 has an invalid length. netlink: 'syz-executor6': attribute type 3 has an invalid length. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=62978 sclass=netlink_route_socket pig=5980 comm=syz-executor5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=62978 sclass=netlink_route_socket pig=5980 comm=syz-executor5 sock: sock_set_timeout: `syz-executor4' (pid 6182) tries to set negative timeout netlink: 'syz-executor5': attribute type 1 has an invalid length. netlink: 'syz-executor5': attribute type 1 has an invalid length. netlink: 156 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 156 bytes leftover after parsing attributes in process `syz-executor4'. sctp: [Deprecated]: syz-executor4 (pid 6548) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor4 (pid 6548) Use of int in max_burst socket option. Use struct sctp_assoc_value instead kauditd_printk_skb: 22 callbacks suppressed audit: type=1400 audit(1517516603.791:44): avc: denied { create } for pid=6591 comm="syz-executor3" 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(1517516603.890:45): avc: denied { getattr } for pid=6626 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(1517516604.003:46): avc: denied { map } for pid=6685 comm="syz-executor4" path="socket:[16461]" dev="sockfs" ino=16461 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=rawip_socket permissive=1 audit: type=1400 audit(1517516604.095:47): avc: denied { bind } for pid=6723 comm="syz-executor3" 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(1517516604.095:48): avc: denied { setopt } for pid=6723 comm="syz-executor3" 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(1517516604.095:49): avc: denied { ioctl } for pid=6723 comm="syz-executor3" path="socket:[16375]" dev="sockfs" ino=16375 ioctlcmd=0x89e0 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 IPv4: Oversized IP packet from 172.20.5.15 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=57357 sclass=netlink_route_socket pig=6876 comm=syz-executor3 xt_DSCP: dscp fc out of range do_dccp_setsockopt: sockopt(PACKET_SIZE) is deprecated: fix your app do_dccp_setsockopt: sockopt(PACKET_SIZE) is deprecated: fix your app SELinux: unrecognized netlink message: protocol=0 nlmsg_type=57357 sclass=netlink_route_socket pig=6876 comm=syz-executor3 netlink: 'syz-executor5': attribute type 21 has an invalid length. netlink: 'syz-executor5': attribute type 5 has an invalid length. skbuff: bad partial csum: csum=65535/65535 len=14 device syz4 entered promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode dccp_close: ABORT with 260 bytes unread sctp: [Deprecated]: syz-executor4 (pid 7066) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor4 (pid 7066) Use of int in maxseg socket option. Use struct sctp_assoc_value instead kernel msg: ebtables bug: please report to author: Wrong len argument xt_CONNSECMARK: target only valid in the 'mangle' or 'security' tables, not 'filter'. xt_CONNSECMARK: target only valid in the 'mangle' or 'security' tables, not 'filter'. kernel msg: ebtables bug: please report to author: Wrong len argument netlink: 72 bytes leftover after parsing attributes in process `syz-executor7'. syz-executor1 (7386) used greatest stack depth: 15280 bytes left audit: type=1400 audit(1517516606.011:50): avc: denied { read } for pid=7444 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 bridge: RTM_NEWNEIGH bridge0 with NTF_USE is not supported bridge: RTM_NEWNEIGH bridge0 with NTF_USE is not supported A link change request failed with some changes committed already. Interface lo may have been left with an inconsistent configuration, please check. can: request_module (can-proto-3) failed. can: request_module (can-proto-3) failed. audit: type=1400 audit(1517516606.483:51): avc: denied { accept } for pid=7643 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 device syz1 entered promiscuous mode Protocol error: SET target dimension is over the limit! Protocol error: SET target dimension is over the limit! dccp_xmit_packet: Payload too large (65423) for featneg. dccp_close: ABORT with 65423 bytes unread device syz1 left promiscuous mode openvswitch: netlink: Flow set message rejected, Key attribute missing. openvswitch: netlink: Flow set message rejected, Key attribute missing. sit: non-ECT from 0.0.0.0 with TOS=0x3 sit: non-ECT from 0.0.0.0 with TOS=0x3 validate_nla: 10 callbacks suppressed netlink: 'syz-executor4': attribute type 21 has an invalid length. netlink: 'syz-executor4': attribute type 2 has an invalid length. netlink: 'syz-executor4': attribute type 21 has an invalid length. netlink: 'syz-executor4': attribute type 2 has an invalid length. ipt_CLUSTERIP: Please specify destination IP ipt_CLUSTERIP: Please specify destination IP sock: sock_set_timeout: `syz-executor4' (pid 8197) tries to set negative timeout sock: sock_set_timeout: `syz-executor4' (pid 8197) tries to set negative timeout audit: type=1400 audit(1517516608.084:52): avc: denied { connect } for pid=8238 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 audit: type=1400 audit(1517516608.106:53): avc: denied { read } for pid=8254 comm="syz-executor3" path="socket:[18764]" dev="sockfs" ino=18764 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 sctp: [Deprecated]: syz-executor0 (pid 8430) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor0 (pid 8430) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor6 (pid 8489) Use of int in maxseg socket option. Use struct sctp_assoc_value instead netlink: 'syz-executor3': attribute type 21 has an invalid length. sctp: [Deprecated]: syz-executor6 (pid 8489) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor6 (pid 8501) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor6 (pid 8489) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead netlink: 'syz-executor3': attribute type 21 has an invalid length. xt_CONNSECMARK: target only valid in the 'mangle' or 'security' tables, not 'filter'. Bearer <> rejected, not supported in standalone mode Bearer <> rejected, not supported in standalone mode kauditd_printk_skb: 2 callbacks suppressed audit: type=1400 audit(1517516609.158:56): avc: denied { connect } for pid=8670 comm="syz-executor3" 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 netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' rdma_op 00000000219b6ca7 conn xmit_rdma (null) rdma_op 00000000abf64a2d conn xmit_rdma (null) xt_hashlimit: Unknown mode mask 200, kernel too old? xt_hashlimit: Unknown mode mask 200, kernel too old? openvswitch: netlink: Message has 4 unknown bytes. netlink: 'syz-executor5': attribute type 10 has an invalid length. x_tables: ip6_tables: .0 target: invalid size 8 (kernel) != (user) 1 sctp: [Deprecated]: syz-executor7 (pid 9135) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor7 (pid 9135) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead