====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc2+ #326 Not tainted ------------------------------------------------------ syz-executor0/6056 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<0000000035163c95>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<0000000035163c95>] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1329 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000004c2eb5a8>] 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 raw_setsockopt+0xb7/0xd0 net/ipv4/raw.c:870 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-executor0/6056: #0: (rtnl_mutex){+.+.}, at: [<000000004c2eb5a8>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 6056 Comm: syz-executor0 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:00007f51f1d64c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007f51f1d656d4 RCX: 0000000000453de9 RDX: 0000000000000030 RSI: 0000000000000000 RDI: 0000000000000014 RBP: 000000000072bea0 R08: 0000000020007ffd R09: 0000000000000000 R10: 0000000020008000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000000f2 R14: 00000000006f1750 R15: 0000000000000000 syz-executor7 (6112) used greatest stack depth: 12496 bytes left x_tables: ip6_tables: mh match: only valid for protocol 135 x_tables: ip6_tables: mh match: only valid for protocol 135 binder: BINDER_SET_CONTEXT_MGR already set binder: 6240:6243 ioctl 40046207 0 returned -16 binder: 6243 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 6240:6248 ioctl 40046207 0 returned -16 binder: 6240:6261 tried to acquire reference to desc 0, got 1 instead binder: 6240:6248 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 syz-executor4 uses obsolete (PF_INET,SOCK_PACKET) device eql entered promiscuous mode mmap: syz-executor0 (6348) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. bpf: check failed: parse error bpf: check failed: parse error ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' QAT: Invalid ioctl capability: warning: `syz-executor5' uses 32-bit capabilities (legacy support in use) encrypted_key: insufficient parameters specified encrypted_key: insufficient parameters specified kauditd_printk_skb: 26 callbacks suppressed audit: type=1400 audit(1519461714.334:48): avc: denied { read } for pid=6691 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: 6709 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 6703:6719 ioctl 40046207 0 returned -16 binder: 6709 RLIMIT_NICE not set device eql entered promiscuous mode xt_HMARK: hash modulus can't be zero xt_HMARK: hash modulus can't be zero QAT: Invalid ioctl QAT: Invalid ioctl FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 0 PID: 6928 Comm: syz-executor7 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 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+0x3440/0x3b60 mm/memory.c:4103 handle_mm_fault+0x44a/0xb00 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:ffff8801aac477e0 EFLAGS: 00010246 RAX: 0000000000010000 RBX: 0000000020011000 RCX: ffffffff825caf11 RDX: 0000000000001774 RSI: ffffc9000445f000 RDI: ffff8801aac47be0 RBP: ffff8801aac478c0 R08: 0000000000001000 R09: ffffea00065d70c0 R10: 0000000000000200 R11: ffffed0032eb87ff R12: 1ffff10035588eff R13: ffff8801aac47898 R14: 0000000000000000 R15: ffff8801aac47bd8 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:0x453de9 RSP: 002b:00007fbc9b8bfc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fbc9b8c06d4 RCX: 0000000000453de9 RDX: 00000000ffffffbf RSI: 0000000020000000 RDI: 0000000000000015 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000662 R14: 00000000006f99d0 R15: 0000000000000000 audit: type=1400 audit(1519461715.839:49): avc: denied { ioctl } for pid=6951 comm="syz-executor1" path="socket:[19116]" dev="sockfs" ino=19116 ioctlcmd=0x8917 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(1519461715.839:50): avc: denied { getopt } for pid=6951 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=netlink_generic_socket permissive=1 audit: type=1400 audit(1519461715.953:51): avc: denied { map } for pid=6974 comm="syz-executor2" path="/selinux/status" dev="selinuxfs" ino=19 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1 audit: type=1400 audit(1519461716.039:52): avc: denied { map } for pid=7018 comm="syz-executor3" path="socket:[19681]" dev="sockfs" ino=19681 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=unix_dgram_socket permissive=1 capability: warning: `syz-executor3' uses deprecated v2 capabilities in a way that may be insecure SELinux: unrecognized netlink message: protocol=4 nlmsg_type=17 sclass=netlink_tcpdiag_socket pig=7048 comm=syz-executor2 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=17 sclass=netlink_tcpdiag_socket pig=7056 comm=syz-executor2 x_tables: ip6_tables: SNAT target: used from hooks PREROUTING/POSTROUTING, but only usable from INPUT/POSTROUTING audit: type=1400 audit(1519461716.374:53): avc: denied { map } for pid=7094 comm="syz-executor5" path="/dev/net/tun" dev="devtmpfs" ino=125 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tun_tap_device_t:s0 tclass=chr_file permissive=1 x_tables: ip6_tables: SNAT target: used from hooks PREROUTING/POSTROUTING, but only usable from INPUT/POSTROUTING binder_alloc: binder_alloc_mmap_handler: 7177 20001000-20005000 already mapped failed -16 x86/PAT: syz-executor7:7185 map pfn RAM range req write-combining for [mem 0x1cee10000-0x1cee13fff], got write-back binder: 7177:7183 ioctl c0306201 20000040 returned -14 x86/PAT: syz-executor7:7185 map pfn RAM range req write-combining for [mem 0x19df50000-0x19df53fff], got write-back binder_alloc: binder_alloc_mmap_handler: 7177 20000000-20002000 already mapped failed -16 binder: 7177:7183 ioctl c0306201 20000040 returned -14 binder: 7222:7226 got transaction to invalid handle binder: 7222:7226 transaction failed 29201/-22, size 0-0 line 2848 binder: 7222:7226 got transaction to invalid handle binder: 7222:7226 transaction failed 29201/-22, size 0-0 line 2848 binder: 7266:7276 got new transaction with bad transaction stack, transaction 13 has target 7266:0 binder: 7266:7276 transaction failed 29201/-71, size 0-0 line 2875 binder_alloc: binder_alloc_mmap_handler: 7266 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 7266:7276 ioctl 40046207 0 returned -16 binder_alloc: 7266: binder_alloc_buf, no vma binder: 7266:7284 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7266:7276 transaction 13 out, still active binder: send failed reply for transaction 13, target dead device eql entered promiscuous mode device eql entered promiscuous mode binder: 7345:7346 got transaction with invalid offset (0, min 0 max 0) or object. binder: 7345:7346 transaction failed 29201/-22, size 0-8 line 3026 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: binder_alloc_mmap_handler: 7345 20000000-20002000 already mapped failed -16 binder: 7345:7362 ioctl 40046207 0 returned -16 binder_alloc: 7345: binder_alloc_buf, no vma binder: 7345:7362 transaction failed 29189/-3, size 0-8 line 2963 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29189 audit: type=1400 audit(1519461717.696:54): avc: denied { prog_run } for pid=7432 comm="syz-executor5" 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 sg_write: data in/out 16842723/276 bytes for SCSI command 0x0-- guessing data in; program syz-executor2 not setting count and/or reply_len properly sg_write: data in/out 16842723/276 bytes for SCSI command 0x0-- guessing data in; program syz-executor2 not setting count and/or reply_len properly kernel msg: ebtables bug: please report to author: bad policy TCP: request_sock_TCPv6: Possible SYN flooding on port 20022. Sending cookies. Check SNMP counters. kernel msg: ebtables bug: please report to author: bad policy audit: type=1400 audit(1519461718.074:55): avc: denied { map } for pid=7571 comm="syz-executor2" path="/dev/kvm" dev="devtmpfs" ino=9430 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kvm_device_t:s0 tclass=chr_file permissive=1 QAT: Invalid ioctl QAT: Invalid ioctl program syz-executor6 is using a deprecated SCSI ioctl, please convert it to SG_IO QAT: Invalid ioctl sd 0:0:1:0: ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0 QAT: Invalid ioctl kernel msg: ebtables bug: please report to author: bad policy kernel msg: ebtables bug: please report to author: bad policy audit: type=1400 audit(1519461718.786:56): avc: denied { fsetid } for pid=7782 comm="syz-executor5" capability=4 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_alloc: binder_alloc_mmap_handler: 7806 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 7806:7820 ioctl c0306201 2090a000 returned -14 binder: 7806:7811 ioctl c0306201 20008000 returned -14 binder: 7806:7817 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_COMPLETE binder: undelivered transaction 21, process died. binder: undelivered transaction 20, process died. xt_connbytes: Forcing CT accounting to be enabled net_ratelimit: 9 callbacks suppressed dccp_close: ABORT with 125 bytes unread SELinux: unrecognized netlink message: protocol=9 nlmsg_type=24 sclass=netlink_audit_socket pig=7919 comm=syz-executor5 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=24 sclass=netlink_audit_socket pig=7919 comm=syz-executor5 sctp: [Deprecated]: syz-executor7 (pid 8074) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor7 (pid 8083) Use of int in maxseg socket option. Use struct sctp_assoc_value instead QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl binder: 8265:8279 ioctl 40046411 20000040 returned -22 binder: 8265:8279 ioctl c018620b 20000080 returned -14 kauditd_printk_skb: 2 callbacks suppressed audit: type=1401 audit(1519461720.230:59): op=security_bounded_transition seresult=denied oldcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 newcontext=system_u:object_r:modules_object_t:s0 binder: 8265:8279 ioctl c0306201 20000280 returned -14 binder: 8265:8300 got transaction with invalid parent offset binder: 8265:8300 transaction failed 29201/-22, size 80-16 line 3148 binder: BINDER_SET_CONTEXT_MGR already set binder: 8265:8300 ioctl 40046207 0 returned -16 binder: 8265:8300 ioctl 40046411 20000040 returned -22 binder: 8265:8279 ioctl c018620b 20000080 returned -14 binder: 8265:8300 ioctl c0306201 20000280 returned -14 binder_alloc: 8265: binder_alloc_buf, no vma binder: 8265:8318 transaction failed 29189/-3, size 80-16 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 netlink: 'syz-executor7': attribute type 6 has an invalid length. netlink: 'syz-executor7': attribute type 6 has an invalid length. x_tables: ip_tables: SNAT target: used from hooks PREROUTING/INPUT/OUTPUT/POSTROUTING, but only usable from INPUT/POSTROUTING TCP: request_sock_TCPv6: Possible SYN flooding on port 20030. Sending cookies. Check SNMP counters. x_tables: ip_tables: SNAT target: used from hooks PREROUTING/INPUT/OUTPUT/POSTROUTING, but only usable from INPUT/POSTROUTING rfkill: input handler disabled rfkill: input handler enabled audit: type=1400 audit(1519461720.841:60): avc: denied { net_bind_service } for pid=8460 comm="syz-executor4" capability=10 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: 8656 RLIMIT_NICE not set binder: send failed reply for transaction 26 to 8654:8672 binder: BINDER_SET_CONTEXT_MGR already set binder: 8654:8672 ioctl 40046207 0 returned -16 binder: 8656 RLIMIT_NICE not set binder_alloc: 8654: binder_alloc_buf, no vma binder: 8654:8672 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_COMPLETE binder: undelivered TRANSACTION_ERROR: 29189 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 audit: type=1400 audit(1519461721.660:61): avc: denied { create } for pid=8721 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=key permissive=1 xt_connbytes: Forcing CT accounting to be enabled