====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc2+ #326 Not tainted ------------------------------------------------------ syz-executor5/6021 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<000000004ef6a64a>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<000000004ef6a64a>] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000005de8ad11>] 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 rawv6_setsockopt+0x4a/0xf0 net/ipv6/raw.c:1060 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/6021: #0: (rtnl_mutex){+.+.}, at: [<000000005de8ad11>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 6021 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:00007fe4787c2c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007fe4787c36d4 RCX: 0000000000453de9 RDX: 0000000000000029 RSI: 0000000000000000 RDI: 0000000000000015 RBP: 000000000072bea0 R08: 0000000020000080 R09: 0000000000000000 R10: 0000000020000040 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000000f2 R14: 00000000006f1750 R15: 0000000000000000 syz-executor0 uses obsolete (PF_INET,SOCK_PACKET) device eql entered promiscuous mode capability: warning: `syz-executor4' uses deprecated v2 capabilities in a way that may be insecure binder: BINDER_SET_CONTEXT_MGR already set binder: 6289:6291 ioctl 40046207 0 returned -16 ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' kauditd_printk_skb: 13 callbacks suppressed audit: type=1400 audit(1519448375.696:35): avc: denied { node_bind } for pid=6572 comm="syz-executor2" saddr=fe80::bb scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:node_t:s0 tclass=dccp_socket permissive=1 QAT: Invalid ioctl QAT: Invalid ioctl xt_connbytes: Forcing CT accounting to be enabled audit: type=1400 audit(1519448376.048:36): avc: denied { write } for pid=6748 comm="syz-executor3" name="map_files" dev="proc" ino=17823 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(1519448376.048:37): avc: denied { setattr } for pid=6748 comm="syz-executor3" name="map_files" dev="proc" ino=17823 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 binder: BINDER_SET_CONTEXT_MGR already set audit: type=1400 audit(1519448376.083:38): avc: denied { call } for pid=6762 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=binder permissive=1 binder: 6762:6767 ioctl 40046207 0 returned -16 audit: type=1400 audit(1519448376.083:39): avc: denied { transfer } for pid=6762 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=binder permissive=1 binder_alloc: 6762: binder_alloc_buf, no vma binder: 6762:6766 transaction failed 29189/-3, size 40-8 line 2963 net_ratelimit: 6 callbacks suppressed sock: sock_set_timeout: `syz-executor0' (pid 6770) tries to set negative timeout binder: 6762:6771 IncRefs 0 refcount change on invalid ref 1 ret -22 sock: sock_set_timeout: `syz-executor0' (pid 6770) tries to set negative timeout binder: undelivered TRANSACTION_ERROR: 29189 binder: release 6762:6766 transaction 3 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 3, target dead audit: type=1400 audit(1519448376.320:40): avc: denied { getopt } for pid=6801 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(1519448376.325:41): avc: denied { create } for pid=6811 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 audit: type=1326 audit(1519448376.674:42): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6877 comm="syz-executor1" exe="/root/syz-executor1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453de9 code=0x0 audit: type=1400 audit(1519448376.821:43): avc: denied { map } for pid=6936 comm="syz-executor5" path="socket:[19045]" dev="sockfs" ino=19045 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(1519448376.868:44): avc: denied { map_read map_write } for pid=6958 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=64 sclass=netlink_route_socket pig=7180 comm=syz-executor7 TCP: request_sock_TCPv6: Possible SYN flooding on port 20014. Sending cookies. Check SNMP counters. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=64 sclass=netlink_route_socket pig=7191 comm=syz-executor7 xt_ecn: cannot match TCP bits in rule for non-tcp packets xt_ecn: cannot match TCP bits in rule for non-tcp packets binder: 7267:7276 IncRefs 0 refcount change on invalid ref 0 ret -22 xt_connbytes: Forcing CT accounting to be enabled binder: 7267:7276 IncRefs 0 refcount change on invalid ref 0 ret -22 binder: 7267:7276 IncRefs 0 refcount change on invalid ref 0 ret -22 binder: 7267:7276 IncRefs 0 refcount change on invalid ref 0 ret -22 xt_connbytes: Forcing CT accounting to be enabled mmap: syz-executor2 (7380) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. xt_connbytes: Forcing CT accounting to be enabled device eql entered promiscuous mode QAT: Invalid ioctl QAT: Invalid ioctl Cannot find add_set index 3 as target Cannot find add_set index 3 as target device eql entered promiscuous mode Cannot find add_set index 0 as target Cannot find add_set index 0 as target binder: BINDER_SET_CONTEXT_MGR already set binder: 8013:8019 ioctl 40046207 0 returned -16 x_tables: ip6_tables: mh match: only valid for protocol 135 Protocol error: SET target dimension is over the limit! x_tables: ip6_tables: mh match: only valid for protocol 135 netlink: 4 bytes leftover after parsing attributes in process `syz-executor5'. rfkill: input handler disabled rfkill: input handler enabled QAT: Invalid ioctl x_tables: ip_tables: icmp match: only valid for protocol 1 QAT: Invalid ioctl x_tables: ip_tables: icmp match: only valid for protocol 1 kauditd_printk_skb: 10 callbacks suppressed audit: type=1400 audit(1519448381.250:55): avc: denied { prog_run } for pid=8240 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=bpf permissive=1 audit: type=1400 audit(1519448381.430:56): avc: denied { accept } for pid=8305 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 netlink: 'syz-executor5': attribute type 39 has an invalid length. netlink: 'syz-executor5': attribute type 39 has an invalid length. SELinux: unrecognized netlink message: protocol=4 nlmsg_type=72 sclass=netlink_tcpdiag_socket pig=8377 comm=syz-executor3 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=72 sclass=netlink_tcpdiag_socket pig=8377 comm=syz-executor3 audit: type=1400 audit(1519448382.306:57): avc: denied { ioctl } for pid=8598 comm="syz-executor3" path="socket:[23807]" dev="sockfs" ino=23807 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 audit: type=1326 audit(1519448382.468:58): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=8641 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453de9 code=0x0 kernel msg: ebtables bug: please report to author: Couldn't copy entries from userspace kernel msg: ebtables bug: please report to author: Couldn't copy entries from userspace audit: type=1400 audit(1519448382.713:59): avc: denied { ioctl } for pid=8744 comm="syz-executor3" path="socket:[24770]" dev="sockfs" ino=24770 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(1519448382.745:60): avc: denied { accept } for pid=8744 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 binder: 8777:8782 transaction failed 29189/-22, size 0-0 line 2848 device eql entered promiscuous mode binder: 8777:8782 ioctl c0306201 2001bfd0 returned -14 xt_CONNSECMARK: invalid mode: 0 binder: 8777:8806 transaction failed 29189/-22, size 0-0 line 2848 xt_TPROXY: Can be used only in combination with either -p tcp or -p udp xt_CONNSECMARK: invalid mode: 0 binder: undelivered TRANSACTION_ERROR: 29189 sctp: [Deprecated]: syz-executor7 (pid 8810) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead xt_TPROXY: Can be used only in combination with either -p tcp or -p udp sctp: [Deprecated]: syz-executor7 (pid 8817) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead xt_CONNSECMARK: invalid mode: 0 xt_TPROXY: Can be used only in combination with either -p tcp or -p udp FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 8898 Comm: syz-executor2 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:422 [inline] slab_alloc_node mm/slab.c:3286 [inline] kmem_cache_alloc_node_trace+0x5a/0x760 mm/slab.c:3648 __do_kmalloc_node mm/slab.c:3668 [inline] __kmalloc_node+0x33/0x70 mm/slab.c:3676 kmalloc_node include/linux/slab.h:554 [inline] kvmalloc_node+0x99/0xd0 mm/util.c:419 kvmalloc include/linux/mm.h:541 [inline] xt_alloc_table_info+0x63/0xe0 net/netfilter/x_tables.c:1016 do_replace net/ipv6/netfilter/ip6_tables.c:1149 [inline] do_ip6t_set_ctl+0x29b/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 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