xt_connbytes: Forcing CT accounting to be enabled ====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc2+ #326 Not tainted ------------------------------------------------------ syz-executor5/6960 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<000000000f3244ba>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<000000000f3244ba>] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000004cdf2832>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (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+0x242/0x380 net/ipv6/netfilter/ip6_tables.c:673 __do_replace+0x7ac/0xa70 net/ipv6/netfilter/ip6_tables.c:1108 do_replace net/ipv6/netfilter/ip6_tables.c:1164 [inline] do_ip6t_set_ctl+0x40f/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+0x10b/0x130 net/ipv6/ipv6_sockglue.c:927 dccp_setsockopt+0x85/0xd0 net/dccp/proto.c:576 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 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&xt[i].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 xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1046 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1093 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_arpt_get_ctl+0x2a9/0xa00 net/ipv4/netfilter/arp_tables.c:1481 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ip_getsockopt+0x15c/0x220 net/ipv4/ip_sockglue.c:1571 tcp_getsockopt+0x82/0xd0 net/ipv4/tcp.c:3359 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 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (sk_lock-AF_INET){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 ip_getsockopt+0x90/0x220 net/ipv4/ip_sockglue.c:1560 udp_getsockopt+0x45/0x80 net/ipv4/udp.c:2478 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 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: sk_lock-AF_INET --> &xt[i].mutex --> rtnl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(&xt[i].mutex); lock(rtnl_mutex); lock(sk_lock-AF_INET); *** DEADLOCK *** 1 lock held by syz-executor5/6960: #0: (rtnl_mutex){+.+.}, at: [<000000004cdf2832>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 6960 Comm: syz-executor5 Not tainted 4.16.0-rc2+ #326 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/0x24d 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 lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 ip_getsockopt+0x90/0x220 net/ipv4/ip_sockglue.c:1560 udp_getsockopt+0x45/0x80 net/ipv4/udp.c:2478 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 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453de9 RSP: 002b:00007f08bc665c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007f08bc6666d4 RCX: 0000000000453de9 RDX: 0000000000000029 RSI: 0000000000000000 RDI: 0000000000000014 RBP: 000000000072bea0 R08: 0000000020000080 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000000f2 R14: 00000000006f1750 R15: 0000000000000000 binder_alloc: binder_alloc_mmap_handler: 7017 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 7017:7018 ioctl 40046207 0 returned -16 binder_alloc: 7017: binder_alloc_buf, no vma binder: 7017:7019 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered transaction 15, process died. audit: type=1400 audit(1519452295.079:39): avc: denied { map } for pid=7033 comm="syz-executor2" path="socket:[18343]" dev="sockfs" ino=18343 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(1519452295.113:40): avc: denied { map } for pid=7037 comm="syz-executor7" path=2F6D656D66643A202864656C6574656429 dev="tmpfs" ino=21118 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file permissive=1 audit: type=1400 audit(1519452295.173:41): avc: denied { prog_run } for pid=7052 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=bpf permissive=1 binder: 7094:7096 transaction failed 29189/-22, size 0-0 line 2848 binder: 7094:7107 transaction failed 29189/-22, size 0-0 line 2848 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 mmap: syz-executor6 (7152): VmData 18530304 exceed data ulimit 4. Update limits or use boot option ignore_rlimit_data. binder: 7156:7158 ioctl 890c 20000080 returned -22 binder: 7156:7174 ioctl 890c 20000080 returned -22 netlink: 'syz-executor4': attribute type 10 has an invalid length. netlink: 'syz-executor4': attribute type 10 has an invalid length. binder: BINDER_SET_CONTEXT_MGR already set binder: 7241:7254 ioctl 40046207 0 returned -16 binder: release 7241:7245 transaction 20 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 20, target dead audit: type=1400 audit(1519452296.255:42): avc: denied { setgid } for pid=7272 comm="syz-executor6" capability=6 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 audit: type=1400 audit(1519452296.420:43): avc: denied { map } for pid=7331 comm="syz-executor3" path="/dev/loop6" dev="devtmpfs" ino=81 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file permissive=1 audit: type=1400 audit(1519452296.517:44): avc: denied { map } for pid=7365 comm="syz-executor5" path="/selinux/checkreqprot" dev="selinuxfs" ino=15 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1 syz-executor7 (7396): /proc/7384/oom_adj is deprecated, please use /proc/7384/oom_score_adj instead. QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1400 audit(1519452296.774:45): avc: denied { create } for pid=7461 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_crypto_socket permissive=1 net_ratelimit: 11 callbacks suppressed arp_tables: arptables: counters copy to user failed while replacing table IPVS: ftp: loaded support on port[0] = 21 syz-executor6 uses obsolete (PF_INET,SOCK_PACKET) QAT: Invalid ioctl arp_tables: arptables: counters copy to user failed while replacing table QAT: Invalid ioctl mapping of prio or/and queue is allowed only from OUTPUT/FORWARD/POSTROUTING chains arp_tables: arptables: counters copy to user failed while replacing table Cannot find set identified by id 3 to match binder: 7626:7633 unknown command -1241021686 binder: 7626:7633 ioctl c0306201 20fc4000 returned -22 SELinux: failed to load policy binder: 7626:7633 unknown command -1241021686 binder: 7626:7633 ioctl c0306201 20fc4000 returned -22 arp_tables: arptables: counters copy to user failed while replacing table arp_tables: arptables: counters copy to user failed while replacing table xt_SECMARK: target only valid in the 'mangle' or 'security' tables, not 'filter'. device syz7 entered promiscuous mode xt_SECMARK: target only valid in the 'mangle' or 'security' tables, not 'filter'. SELinux: failed to load policy mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium SELinux: failed to load policy device syz7 left promiscuous mode syz7: Invalid MTU 1914947562 requested, hw max 65521 arp_tables: arptables: counters copy to user failed while replacing table syz7: Invalid MTU 1914947562 requested, hw max 65521 xt_connbytes: Forcing CT accounting to be enabled Cannot find add_set index 0 as target QAT: Invalid ioctl QAT: Invalid ioctl arp_tables: arptables: counters copy to user failed while replacing table netlink: 60 bytes leftover after parsing attributes in process `syz-executor5'. arp_tables: arptables: counters copy to user failed while replacing table binder: 7987:8005 BC_REQUEST_DEATH_NOTIFICATION death notification already set kauditd_printk_skb: 2 callbacks suppressed audit: type=1400 audit(1519452299.248:48): avc: denied { setopt } for pid=8006 comm="syz-executor0" 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 binder: BINDER_SET_CONTEXT_MGR already set binder: 7987:8017 BC_REQUEST_DEATH_NOTIFICATION death notification already set binder: 7987:8005 ioctl 40046207 0 returned -16 audit: type=1400 audit(1519452300.215:49): avc: denied { shutdown } for pid=8346 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_generic_socket permissive=1 audit: type=1400 audit(1519452300.221:50): avc: denied { setfcap } for pid=8355 comm="syz-executor4" capability=31 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 binder: 8403:8405 transaction failed 29189/-22, size 24-8 line 2848 binder: 8403:8405 transaction failed 29189/-22, size 24-8 line 2848 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 NFQUEUE: number of total queues is 0 QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1400 audit(1519452301.189:51): avc: denied { write } for pid=8721 comm="syz-executor3" name="net" dev="proc" ino=25734 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 audit: type=1400 audit(1519452301.189:52): avc: denied { add_name } for pid=8721 comm="syz-executor3" name="pfkey" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 audit: type=1400 audit(1519452301.189:53): avc: denied { create } for pid=8721 comm="syz-executor3" name="pfkey" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=58155 sclass=netlink_route_socket pig=8797 comm=syz-executor1 sctp: [Deprecated]: syz-executor7 (pid 8792) Use of int in maxseg socket option. Use struct sctp_assoc_value instead SELinux: unrecognized netlink message: protocol=0 nlmsg_type=58155 sclass=netlink_route_socket pig=8805 comm=syz-executor1 audit: type=1400 audit(1519452301.456:54): avc: denied { bind } for pid=8790 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 sctp: [Deprecated]: syz-executor7 (pid 8792) Use of int in maxseg socket option. Use struct sctp_assoc_value instead audit: type=1400 audit(1519452301.456:55): avc: denied { ioctl } for pid=8790 comm="syz-executor3" path="socket:[25828]" dev="sockfs" ino=25828 ioctlcmd=0xae73 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(1519452301.530:56): avc: denied { create } for pid=8817 comm="syz-executor0" 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 net_ratelimit: 20 callbacks suppressed arp_tables: arptables: counters copy to user failed while replacing table arp_tables: arptables: counters copy to user failed while replacing table ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1519452302.383:57): avc: denied { getopt } for pid=8912 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 ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' arp_tables: arptables: counters copy to user failed while replacing table TCP: request_sock_TCPv6: Possible SYN flooding on port 20006. Sending cookies. Check SNMP counters. arp_tables: arptables: counters copy to user failed while replacing table QAT: Invalid ioctl QAT: Invalid ioctl arp_tables: arptables: counters copy to user failed while replacing table x_tables: ip6_tables: mh match: only valid for protocol 135 x_tables: ip6_tables: mh match: only valid for protocol 135 TCP: request_sock_TCPv6: Possible SYN flooding on port 20022. Sending cookies. Check SNMP counters. arp_tables: arptables: counters copy to user failed while replacing table arp_tables: arptables: counters copy to user failed while replacing table arp_tables: arptables: counters copy to user failed while replacing table sg_write: data in/out 1969188161/39 bytes for SCSI command 0x20-- guessing data in; program syz-executor3 not setting count and/or reply_len properly netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. sg_write: data in/out 1969188161/39 bytes for SCSI command 0x20-- guessing data in; program syz-executor3 not setting count and/or reply_len properly netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'. rdma_op 00000000ce6827f6 conn xmit_rdma (null) raw_sendmsg: syz-executor7 forgot to set AF_INET. Fix it! arp_tables: arptables: counters copy to user failed while replacing table arp_tables: arptables: counters copy to user failed while replacing table