binder: 5350 invalid dec weak, ref 4 desc 1 s 1 w 0 ====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #290 Not tainted ------------------------------------------------------ syz-executor7/5356 is trying to acquire lock: (rtnl_mutex){+.+.}, at: [<00000000e8f9cfeb>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 but task is already holding lock: (sk_lock-AF_INET){+.+.}, at: [<00000000a2729258>] lock_sock include/net/sock.h:1461 [inline] (sk_lock-AF_INET){+.+.}, at: [<00000000a2729258>] ip_setsockopt+0x8c/0xb0 net/ipv4/ip_sockglue.c:1259 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sk_lock-AF_INET){+.+.}: lock_sock_nested+0xc2/0x110 net/core/sock.c:2780 lock_sock include/net/sock.h:1461 [inline] do_ip_getsockopt+0x1b3/0x2170 net/ipv4/ip_sockglue.c:1335 ip_getsockopt+0x90/0x220 net/ipv4/ip_sockglue.c:1566 udp_getsockopt+0x45/0x80 net/ipv4/udp.c:2473 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2937 SYSC_getsockopt net/socket.c:1880 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1862 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #0 (rtnl_mutex){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 __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 register_netdevice_notifier+0xad/0x860 net/core/dev.c:1607 tee_tg_check+0x1a0/0x280 net/netfilter/xt_TEE.c:106 xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:845 check_target net/ipv4/netfilter/ip_tables.c:513 [inline] find_check_entry.isra.8+0x8c8/0xcb0 net/ipv4/netfilter/ip_tables.c:554 translate_table+0xed1/0x1610 net/ipv4/netfilter/ip_tables.c:725 do_replace net/ipv4/netfilter/ip_tables.c:1141 [inline] do_ipt_set_ctl+0x370/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+0xa1/0xb0 net/ipv4/ip_sockglue.c:1260 udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2401 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sk_lock-AF_INET); lock(rtnl_mutex); lock(sk_lock-AF_INET); lock(rtnl_mutex); *** DEADLOCK *** 1 lock held by syz-executor7/5356: #0: (sk_lock-AF_INET){+.+.}, at: [<00000000a2729258>] lock_sock include/net/sock.h:1461 [inline] #0: (sk_lock-AF_INET){+.+.}, at: [<00000000a2729258>] ip_setsockopt+0x8c/0xb0 net/ipv4/ip_sockglue.c:1259 stack backtrace: CPU: 1 PID: 5356 Comm: syz-executor7 Not tainted 4.15.0+ #290 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 __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 register_netdevice_notifier+0xad/0x860 net/core/dev.c:1607 tee_tg_check+0x1a0/0x280 net/netfilter/xt_TEE.c:106 xt_check_target+0x22c/0x7d0 net/netfilter/x_tables.c:845 check_target net/ipv4/netfilter/ip_tables.c:513 [inline] find_check_entry.isra.8+0x8c8/0xcb0 net/ipv4/netfilter/ip_tables.c:554 translate_table+0xed1/0x1610 net/ipv4/netfilter/ip_tables.c:725 do_replace net/ipv4/netfilter/ip_tables.c:1141 [inline] do_ipt_set_ctl+0x370/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+0xa1/0xb0 net/ipv4/ip_sockglue.c:1260 udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2401 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2978 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007fb6e0e84c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: cccccccccccccccd RCX: 0000000000453299 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 0000000000000622 R08: 00000000000002e0 R09: 0000000000000000 R10: 000000002002ccf8 R11: 0000000000000212 R12: 00000000006f83d0 R13: 00000000ffffffff R14: 00007fb6e0e856d4 R15: 0000000000000000 ipt_REJECT: ECHOREPLY no longer supported. binder: BINDER_SET_CONTEXT_MGR already set binder: 5350:5351 ioctl 40046207 0 returned -16 binder: 5350:5360 DecRefs 0 refcount change on invalid ref 1 ret -22 binder_alloc: 5350: binder_alloc_buf, no vma binder: 5350:5351 transaction failed 29189/-3, size 40-8 line 2903 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 5350:5351 transaction 2 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 2, target dead ipt_REJECT: ECHOREPLY no longer supported. netlink: 188 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 188 bytes leftover after parsing attributes in process `syz-executor2'. device eql entered promiscuous mode audit: type=1400 audit(1517488376.623:17): avc: denied { map } for pid=5329 comm="syz-executor6" path=2F6D656D66643A24202864656C6574656429 dev="tmpfs" ino=14619 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(1517488376.655:18): avc: denied { set_context_mgr } for pid=5350 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=binder permissive=1 audit: type=1400 audit(1517488376.660:19): avc: denied { call } for pid=5350 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=binder permissive=1 audit: type=1400 audit(1517488376.660:20): avc: denied { transfer } for pid=5350 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=binder permissive=1 audit: type=1400 audit(1517488376.833:21): avc: denied { dac_override } for pid=5373 comm="syz-executor1" capability=1 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(1517488376.843:22): avc: denied { setuid } for pid=5373 comm="syz-executor1" capability=7 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(1517488376.877:23): avc: denied { dac_read_search } for pid=5373 comm="syz-executor1" capability=2 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(1517488376.969:24): avc: denied { setgid } for pid=5401 comm="syz-executor1" 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(1517488377.065:25): avc: denied { map } for pid=5440 comm="syz-executor6" path="/dev/dsp1" dev="devtmpfs" ino=1141 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sound_device_t:s0 tclass=chr_file permissive=1 capability: warning: `syz-executor2' uses deprecated v2 capabilities in a way that may be insecure audit: type=1400 audit(1517488377.902:26): avc: denied { prog_load } for pid=5474 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=bpf permissive=1 binder: 5466 invalid dec weak, ref 9 desc 1 s 1 w 0 binder: BINDER_SET_CONTEXT_MGR already set binder: 5466:5484 ioctl 40046207 0 returned -16 binder_alloc: 5466: binder_alloc_buf, no vma binder: 5466:5484 transaction failed 29189/-3, size 40-8 line 2903 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 5466:5479 transaction 7 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 7, target dead sctp: [Deprecated]: syz-executor2 (pid 5536) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead device eql entered promiscuous mode sctp: [Deprecated]: syz-executor2 (pid 5545) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sg_write: data in/out 392735298/566 bytes for SCSI command 0x0-- guessing data in; program syz-executor4 not setting count and/or reply_len properly sg_write: data in/out 392735298/566 bytes for SCSI command 0x0-- guessing data in; program syz-executor4 not setting count and/or reply_len properly ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x1 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x1 netlink: 8 bytes leftover after parsing attributes in process `syz-executor2'. capability: warning: `syz-executor1' uses 32-bit capabilities (legacy support in use) netlink: 'syz-executor7': attribute type 3 has an invalid length. netlink: 'syz-executor7': attribute type 3 has an invalid length. device lo entered promiscuous mode dccp_xmit_packet: Payload too large (65423) for featneg. device lo left promiscuous mode syz-executor5 (6295) used greatest stack depth: 10992 bytes left QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl syz-executor6 uses obsolete (PF_INET,SOCK_PACKET) device syz6 entered promiscuous mode device syz6 left promiscuous mode device syz6 entered promiscuous mode sock: process `syz-executor2' is using obsolete setsockopt SO_BSDCOMPAT device eql entered promiscuous mode QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl binder: BINDER_SET_CONTEXT_MGR already set binder: 6728:6743 ioctl 40046207 0 returned -16 binder_alloc: 6728: binder_alloc_buf, no vma binder: 6728:6732 transaction failed 29189/-3, size 80-16 line 2903 device eql entered promiscuous mode binder: undelivered TRANSACTION_ERROR: 29189 binder: release 6728:6732 transaction 12 out, still active binder: unexpected work type, 4, not freed Dead loop on virtual device ip6_vti0, fix it urgently! binder: unexpected work type, 4, not freed Dead loop on virtual device ip6_vti0, fix it urgently! binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 12, target dead netlink: 'syz-executor2': attribute type 21 has an invalid length. netlink: 'syz-executor2': attribute type 21 has an invalid length. binder_alloc: binder_alloc_mmap_handler: 6913 2016a000-2016c000 already mapped failed -16 binder_alloc: binder_alloc_mmap_handler: 6913 20000000-20002000 already mapped failed -16 rdma_op 000000007793a951 conn xmit_rdma (null) rdma_op 00000000f5b6b841 conn xmit_rdma (null) handle_userfault: 118 callbacks suppressed FAULT_FLAG_ALLOW_RETRY missing 30 CPU: 1 PID: 7025 Comm: syz-executor0 Not tainted 4.15.0+ #290 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 QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl do_anonymous_page mm/memory.c:3153 [inline] handle_pte_fault mm/memory.c:3967 [inline] __handle_mm_fault+0x32a3/0x3ce0 mm/memory.c:4093 handle_mm_fault+0x38f/0x930 mm/memory.c:4130 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1426 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1501 page_fault+0x2c/0x60 arch/x86/entry/entry_64.S:1261 RIP: 0010:fault_in_pages_readable include/linux/pagemap.h:601 [inline] RIP: 0010:iov_iter_fault_in_readable+0x1a7/0x410 lib/iov_iter.c:421 RSP: 0018:ffff8801b7127928 EFLAGS: 00010246 RAX: 0000000000010000 RBX: 0000000020011fd2 RCX: ffffffff825adc81 RDX: 0000000000000100 RSI: ffffc90004159000 RDI: ffff8801b7127d28 RBP: ffff8801b7127a08 R08: ffff8801cc1cec00 R09: 1ffff10036e24ed1 R10: ffff8801b7127858 R11: ffff8801cc1cec00 R12: 1ffff10036e24f28 R13: ffff8801b71279e0 R14: 0000000000000000 R15: ffff8801b7127d20 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 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007f76f4764c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000030 RSI: 0000000020011fd2 RDI: 0000000000000017 RBP: 00000000000003ce R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f4bf0 R13: 00000000ffffffff R14: 00007f76f47656d4 R15: 0000000000000000 QAT: Invalid ioctl