====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc2+ #323 Not tainted ------------------------------------------------------ syz-executor6/5649 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<000000007dc91d8c>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<000000007dc91d8c>] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000eed79a96>] 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+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 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 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 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-executor6/5649: #0: (rtnl_mutex){+.+.}, at: [<00000000eed79a96>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 0 PID: 5649 Comm: syz-executor6 Not tainted 4.16.0-rc2+ #323 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 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 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 RIP: 0033:0x453da9 RSP: 002b:00007f758ef99c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007f758ef9a6d4 RCX: 0000000000453da9 RDX: 0000000000000029 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000020fae000 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000000f2 R14: 00000000006f1750 R15: 0000000000000000 device syz4 entered promiscuous mode device syz4 left promiscuous mode x86/PAT: syz-executor5:5681 map pfn RAM range req write-combining for [mem 0x1b5af0000-0x1b5af1fff], got write-back netlink: 5 bytes leftover after parsing attributes in process `syz-executor6'. x86/PAT: syz-executor5:5681 map pfn RAM range req write-combining for [mem 0x1b5a60000-0x1b5a61fff], got write-back netlink: 5 bytes leftover after parsing attributes in process `syz-executor6'. ipt_CLUSTERIP: bad num_local_nodes 140 x_tables: ip6_tables: eui64 match: used from hooks FORWARD/OUTPUT, but only valid from PREROUTING/INPUT/FORWARD TCP: request_sock_TCPv6: Possible SYN flooding on port 20010. Sending cookies. Check SNMP counters. x_tables: ip6_tables: eui64 match: used from hooks FORWARD/OUTPUT, but only valid from PREROUTING/INPUT/FORWARD TCP: request_sock_TCPv6: Possible SYN flooding on port 20026. Sending cookies. Check SNMP counters. rfkill: input handler disabled rfkill: input handler enabled binder: 5872:5877 IncRefs 0 refcount change on invalid ref 0 ret -22 syz-executor4 (5936) used greatest stack depth: 15904 bytes left kauditd_printk_skb: 17 callbacks suppressed audit: type=1400 audit(1519302171.876:39): avc: denied { ioctl } for pid=6104 comm="syz-executor3" path="socket:[17620]" dev="sockfs" ino=17620 ioctlcmd=0x8946 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 audit: type=1400 audit(1519302172.045:40): avc: denied { map } for pid=6171 comm="syz-executor3" path="/proc/237/stack" dev="proc" ino=16897 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=file permissive=1 audit: type=1400 audit(1519302172.062:41): avc: denied { map_read map_write } for pid=6173 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=bpf permissive=1 IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_UP): bridge0: link is not ready kernel msg: ebtables bug: please report to author: counter_offset != totalcnt kernel msg: ebtables bug: please report to author: counter_offset != totalcnt atomic_op 00000000922587a8 conn xmit_atomic (null) atomic_op 000000006d9f80ae conn xmit_atomic (null) binder: 6506:6515 got transaction to invalid handle binder: 6506:6515 transaction failed 29201/-22, size 24-8 line 2842 audit: type=1400 audit(1519302174.416:42): avc: denied { attach_queue } for pid=6505 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=tun_socket permissive=1 binder: 6506:6528 ERROR: BC_REGISTER_LOOPER called without request binder: 6528 RLIMIT_NICE not set audit: type=1400 audit(1519302174.463:43): avc: denied { write } for pid=6507 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 capability: warning: `syz-executor3' uses deprecated v2 capabilities in a way that may be insecure binder: 6506:6531 ERROR: BC_REGISTER_LOOPER called without request binder: 6531 RLIMIT_NICE not set binder: 6506:6515 got transaction to invalid handle binder: 6506:6515 transaction failed 29201/-22, size 24-8 line 2842 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 audit: type=1400 audit(1519302174.721:44): avc: denied { name_bind } for pid=6576 comm="syz-executor2" src=20008 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:port_t:s0 tclass=dccp_socket permissive=1 audit: type=1400 audit(1519302174.721:45): avc: denied { node_bind } for pid=6576 comm="syz-executor2" src=20008 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:node_t:s0 tclass=dccp_socket permissive=1 audit: type=1400 audit(1519302174.722:46): avc: denied { name_connect } for pid=6576 comm="syz-executor2" dest=20008 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:port_t:s0 tclass=dccp_socket permissive=1 xt_recent: Unsupported user space flags (000000d8) xt_recent: Unsupported user space flags (000000d8) audit: type=1400 audit(1519302174.889:47): avc: denied { map } for pid=6608 comm="syz-executor7" path="socket:[18170]" dev="sockfs" ino=18170 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(1519302175.000:48): avc: denied { ipc_lock } for pid=6658 comm="syz-executor0" capability=14 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: BINDER_SET_CONTEXT_MGR already set binder: 6687:6703 ioctl 40046207 0 returned -16 binder: release 6687:6691 transaction 5 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 5, target dead netlink: 'syz-executor7': attribute type 39 has an invalid length. A link change request failed with some changes committed already. Interface lo may have been left with an inconsistent configuration, please check. x_tables: ip_tables: rpfilter match: used from hooks POSTROUTING, but only valid from PREROUTING x_tables: ip_tables: rpfilter match: used from hooks POSTROUTING, but only valid from PREROUTING device eql entered promiscuous mode binder: 6840:6851 ERROR: BC_REGISTER_LOOPER called after BC_ENTER_LOOPER binder: 6840:6860 ERROR: BC_REGISTER_LOOPER called after BC_ENTER_LOOPER Disabled LAPIC found during irq injection device syz1 entered promiscuous mode netlink: 180 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 180 bytes leftover after parsing attributes in process `syz-executor0'. device syz1 left promiscuous mode netlink: 'syz-executor3': attribute type 26 has an invalid length. netlink: 'syz-executor3': attribute type 26 has an invalid length. QAT: Invalid ioctl QAT: Invalid ioctl binder: 7220 RLIMIT_NICE not set binder: 7217:7220 BC_DEAD_BINDER_DONE 0000000000000003 not found binder: 7217:7220 unknown command 536907575 binder: 7226 RLIMIT_NICE not set binder: 7217:7220 ioctl c0306201 20008fd0 returned -22 ebt_limit: overflow, try lower: 0/0 ebt_limit: overflow, try lower: 0/0 netlink: 188 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 188 bytes leftover after parsing attributes in process `syz-executor1'. kauditd_printk_skb: 2 callbacks suppressed audit: type=1400 audit(1519302177.182:51): avc: denied { net_broadcast } for pid=7331 comm="syz-executor6" capability=11 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 TCP: request_sock_TCPv6: Possible SYN flooding on port 20014. Sending cookies. Check SNMP counters. netlink: 180 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 180 bytes leftover after parsing attributes in process `syz-executor5'. x86/PAT: syz-executor3:7499 map pfn RAM range req write-combining for [mem 0x1b5af0000-0x1b5af3fff], got write-back x86/PAT: syz-executor3:7499 map pfn RAM range req write-combining for [mem 0x1b5a60000-0x1b5a63fff], got write-back audit: type=1400 audit(1519302177.757:52): avc: denied { ioctl } for pid=7510 comm="syz-executor4" path="socket:[20895]" dev="sockfs" ino=20895 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_netfilter_socket permissive=1 SELinux: truncated policydb string identifier SELinux: failed to load policy SELinux: truncated policydb string identifier SELinux: failed to load policy binder: 7632:7638 ioctl c0306201 20008000 returned -14 binder: 7632:7638 IncRefs 0 refcount change on invalid ref 1 ret -22 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: binder_alloc_mmap_handler: 7632 20000000-20002000 already mapped failed -16 binder: 7632:7661 ioctl 40046207 0 returned -16 binder: 7632:7638 ioctl c0306201 20008000 returned -14 binder: 7632:7654 IncRefs 0 refcount change on invalid ref 1 ret -22 audit: type=1400 audit(1519302178.402:53): avc: denied { create } for pid=7713 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=key permissive=1 audit: type=1400 audit(1519302178.402:54): avc: denied { write } for pid=7713 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:init_var_run_t:s0 tclass=key permissive=1 xt_connbytes: Forcing CT accounting to be enabled QAT: Invalid ioctl QAT: Invalid ioctl x_tables: ip6_tables: TCPOPTSTRIP target: only valid in mangle table, not security device syz6 entered promiscuous mode x_tables: ip6_tables: TCPOPTSTRIP target: only valid in mangle table, not security binder: 7838:7841 ioctl 40042408 15 returned -22 audit: type=1400 audit(1519302178.748:55): avc: denied { transfer } for pid=7838 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=binder permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 7838:7849 ioctl 40046207 0 returned -16 binder: 7838:7841 ioctl 40042408 18 returned -22 binder_alloc: 7838: binder_alloc_buf, no vma binder: 7838:7849 transaction failed 29189/-3, size 40-8 line 2957 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7838:7841 transaction 12 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 12, target dead ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'