====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc1+ #314 Not tainted ------------------------------------------------------ syz-executor4/5918 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<00000000937b45f6>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<00000000937b45f6>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000006ca5ab6d>] 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 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_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xa0 net/ipv4/ip_sockglue.c:1252 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 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-executor4/5918: #0: (rtnl_mutex){+.+.}, at: [<000000006ca5ab6d>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 0 PID: 5918 Comm: syz-executor4 Not tainted 4.16.0-rc1+ #314 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_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xa0 net/ipv4/ip_sockglue.c:1252 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 RIP: 0033:0x453a59 RSP: 002b:00007f8a35384c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f8a353856d4 RCX: 0000000000453a59 RDX: 0000000000000027 RSI: 0000000000000000 RDI: 0000000000000015 RBP: 000000000071bea0 R08: 000000000000000c R09: 0000000000000000 R10: 0000000020a87ff4 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000523 R14: 00000000006f7be8 R15: 0000000000000000 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 CUSE: info not properly terminated QAT: Invalid ioctl kauditd_printk_skb: 14 callbacks suppressed audit: type=1400 audit(1518786038.236:42): avc: denied { map } for pid=6256 comm="syz-executor0" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=16155 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:hugetlbfs_t:s0 tclass=file permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 6345:6356 ioctl 40046207 0 returned -16 binder_alloc: 6345: binder_alloc_buf, no vma binder: 6345:6356 transaction failed 29189/-3, size 40-0 line 2957 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 6345:6347 transaction 11 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 11, target dead audit: type=1400 audit(1518786038.782:43): avc: denied { setpcap } for pid=6378 comm="syz-executor3" capability=8 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 netlink: 'syz-executor0': attribute type 1 has an invalid length. audit: type=1400 audit(1518786038.874:44): avc: denied { prog_run } for pid=6389 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 netlink: 'syz-executor0': attribute type 1 has an invalid length. x_tables: ip_tables: REDIRECT target: used from hooks OUTPUT/POSTROUTING, but only usable from PREROUTING/OUTPUT x_tables: ip_tables: REDIRECT target: used from hooks OUTPUT/POSTROUTING, but only usable from PREROUTING/OUTPUT l2tp_core: tunl 7: fd 20 wrong protocol, got 1, expected 17 l2tp_core: tunl 7: fd 23 wrong protocol, got 1, expected 17 PPPIOCDETACH file->f_count=2 PPPIOCDETACH file->f_count=3 audit: type=1326 audit(1518786039.475:45): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6569 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453a59 code=0x0 audit: type=1326 audit(1518786039.483:46): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6569 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453a59 code=0x0 syz-executor1 uses obsolete (PF_INET,SOCK_PACKET) audit: type=1400 audit(1518786039.745:47): avc: denied { write } for pid=6639 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 SELinux: unknown mount option NFS: security options invalid: -22 binder: 6811 RLIMIT_NICE not set binder: 6835 RLIMIT_NICE not set binder: 6835 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 6808:6835 ioctl 40046207 0 returned -16 binder_alloc: 6808: binder_alloc_buf, no vma binder: 6808:6846 transaction failed 29189/-3, size 0-0 line 2957 audit: type=1400 audit(1518786040.361:48): avc: denied { setattr } for pid=6807 comm="syz-executor2" name="comm" dev="proc" ino=18535 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 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 6808:6828 transaction 14 out, still active binder: undelivered TRANSACTION_COMPLETE binder: release 6808:6835 transaction 14 in, still active binder: send failed reply for transaction 14, target dead capability: warning: `syz-executor3' uses deprecated v2 capabilities in a way that may be insecure audit: type=1400 audit(1518786040.729:49): avc: denied { connect } for pid=6865 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 ipt_CLUSTERIP: Please specify destination IP xt_addrtype: ipv6 PROHIBIT (THROW, NAT ..) matching not supported ipt_CLUSTERIP: Please specify destination IP audit: type=1400 audit(1518786040.822:50): avc: denied { write } for pid=6897 comm="syz-executor2" name="net" dev="proc" ino=18649 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(1518786040.874:51): avc: denied { add_name } for pid=6897 comm="syz-executor2" 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 xt_addrtype: ipv6 PROHIBIT (THROW, NAT ..) matching not supported irq bypass consumer (token 00000000e31248eb) registration fails: -16 netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 'syz-executor0': attribute type 1 has an invalid length. netlink: 'syz-executor0': attribute type 21 has an invalid length. netlink: 'syz-executor0': attribute type 1 has an invalid length. device syz0 entered promiscuous mode device syz0 left promiscuous mode SELinux: unrecognized netlink message: protocol=9 nlmsg_type=82 sclass=netlink_audit_socket pig=7230 comm=syz-executor2 xt_HL: invalid or unknown mode 3 xt_connbytes: Forcing CT accounting to be enabled xt_HL: invalid or unknown mode 3 binder: 7323:7324 transaction failed 29189/-22, size 0-0 line 2842 binder: 7323:7325 transaction failed 29189/-22, size 0-0 line 2842 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: 7377:7381 BC_FREE_BUFFER u00000000204edf8a no match binder_alloc: binder_alloc_mmap_handler: 7377 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: 7377: binder_alloc_buf, no vma binder: 7377:7427 transaction failed 29189/-3, size 40-8 line 2957 binder: 7377:7381 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7377:7381 transaction 19 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 19, target dead binder: undelivered transaction 22, process died. binder: 7457 RLIMIT_NICE not set binder: 7455:7457 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 7457 RLIMIT_NICE not set binder: 7455:7477 BC_DEAD_BINDER_DONE 0000000000000000 not found binder: binder_mmap: 7548 20498000-2049a000 bad vm_flags failed -1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20026. Sending cookies. Check SNMP counters. binder: binder_mmap: 7548 20498000-2049a000 bad vm_flags failed -1 kauditd_printk_skb: 4 callbacks suppressed audit: type=1400 audit(1518786043.853:56): avc: denied { name_bind } for pid=7609 comm="syz-executor5" src=20020 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(1518786043.854:57): avc: denied { node_bind } for pid=7609 comm="syz-executor5" src=20020 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(1518786043.869:58): avc: denied { name_connect } for pid=7609 comm="syz-executor5" dest=20020 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:port_t:s0 tclass=dccp_socket permissive=1 FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 1 PID: 7660 Comm: syz-executor3 Not tainted 4.16.0-rc1+ #314 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 handle_userfault+0xbd9/0x2500 fs/userfaultfd.c:430 do_anonymous_page mm/memory.c:3163 [inline] handle_pte_fault mm/memory.c:3977 [inline] __handle_mm_fault+0x32a3/0x3ce0 mm/memory.c:4103 handle_mm_fault+0x35c/0x970 mm/memory.c:4140 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1426 do_page_fault+0xee/0x730 arch/x86/mm/fault.c:1501 page_fault+0x62/0x90 arch/x86/entry/entry_64.S:1122 RIP: 0010:fault_in_pages_readable arch/x86/include/asm/smap.h:58 [inline] RIP: 0010:iov_iter_fault_in_readable+0x1aa/0x420 lib/iov_iter.c:421 RSP: 0018:ffff8801b8fbf7e0 EFLAGS: 00010246 RAX: 0000000000010000 RBX: 0000000020011fd2 RCX: ffffffff825c8c01 RDX: 00000000000000c6 RSI: ffffc900042e1000 RDI: ffff8801b8fbfbe0 RBP: ffff8801b8fbf8c0 R08: 1ffff10036b20512 R09: 1ffff100371f7ef1 R10: ffff8801b8fbf710 R11: ffffffff8814d108 R12: 1ffff100371f7eff R13: ffff8801b8fbf898 R14: 0000000000000000 R15: ffff8801b8fbfbd8 generic_perform_write+0x200/0x600 mm/filemap.c:3128 __generic_file_write_iter+0x366/0x5b0 mm/filemap.c:3263 generic_file_write_iter+0x399/0x790 mm/filemap.c:3291 call_write_iter include/linux/fs.h:1781 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x684/0x970 fs/read_write.c:482 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453a59 RSP: 002b:00007ff0898bbc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007ff0898bc6d4 RCX: 0000000000453a59 RDX: 0000000000000030 RSI: 0000000020011fd2 RDI: 0000000000000014 RBP: 000000000071bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000065f R14: 00000000006f9988 R15: 0000000000000000 audit: type=1400 audit(1518786044.638:59): avc: denied { map } for pid=7694 comm="syz-executor3" path="socket:[22016]" dev="sockfs" ino=22016 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(1518786044.716:60): avc: denied { read } for pid=7719 comm="syz-executor2" path="socket:[22096]" dev="sockfs" ino=22096 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: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=7844 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=7859 comm=syz-executor1 binder: 7909:7911 BC_INCREFS_DONE node 26 has no pending increfs request binder: 7909:7911 ioctl 4b63 2026bff8 returned -22 binder: BINDER_SET_CONTEXT_MGR already set binder: 7909:7911 ioctl 40046207 0 returned -16 binder: 7909:7929 BC_INCREFS_DONE u0000000000000000 no match binder: 7909:7911 ioctl 4b63 2026bff8 returned -22 xt_connbytes: Forcing CT accounting to be enabled ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'