====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc1+ #314 Not tainted ------------------------------------------------------ syz-executor6/5481 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<00000000c933bd02>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<00000000c933bd02>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000727f93c7>] 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_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-executor6/5481: #0: (rtnl_mutex){+.+.}, at: [<00000000727f93c7>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 5481 Comm: syz-executor6 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:00007ff008993c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007ff0089946d4 RCX: 0000000000453a59 RDX: 000000000000002a RSI: 0000000000000000 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000090 R09: 0000000000000000 R10: 000000002016f000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000518 R14: 00000000006f7ae0 R15: 0000000000000000 audit: type=1400 audit(1518772759.141:24): avc: denied { create } for pid=5508 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_netfilter_socket permissive=1 audit: type=1400 audit(1518772759.167:25): avc: denied { write } for pid=5508 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_netfilter_socket permissive=1 device eql entered promiscuous mode audit: type=1400 audit(1518772759.397:26): avc: denied { dyntransition } for pid=5573 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0,c1 tclass=process permissive=1 audit: type=1400 audit(1518772759.566:27): avc: denied { setopt } for pid=5631 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_generic_socket permissive=1 audit: type=1400 audit(1518772759.799:28): avc: denied { create } for pid=5704 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 netlink: 'syz-executor2': attribute type 21 has an invalid length. netlink: 'syz-executor2': attribute type 21 has an invalid length. syz-executor3 (5890): /proc/5882/oom_adj is deprecated, please use /proc/5882/oom_score_adj instead. device eql entered promiscuous mode xt_connbytes: Forcing CT accounting to be enabled *** Guest State *** CR0: actual=0xffffffff9ffffffc, shadow=0xfffffffffffffffc, gh_mask=fffffffffffffff7 CR4: actual=0x0000000000002060, shadow=0x0000000000000020, gh_mask=ffffffffffffe871 CR3 = 0x0000000000000000 PDPTR0 = 0x0200000000000003 PDPTR1 = 0x0000000000000000 PDPTR2 = 0x0000000000000000 PDPTR3 = 0x0000000000000000 RSP = 0x0000000000000000 RIP = 0x000000000000fff0 RFLAGS=0x00010002 DR7 = 0x0000000000000400 Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000 CS: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 DS: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 SS: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 ES: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 FS: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 GS: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 GDTR: limit=0x00000000, base=0x0000000000000000 LDTR: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 IDTR: limit=0x00000000, base=0x0000000000000000 TR: sel=0x0000, attr=0x10000, limit=0x00000000, base=0x0000000000000000 EFER = 0x0000000000000000 PAT = 0x0007040600070406 DebugCtl = 0x0000000000000000 DebugExceptions = 0x0000000000000000 Interruptibility = 00000000 ActivityState = 00000000 *** Host State *** RIP = 0xffffffff811cd915 RSP = 0xffff8801b13bf3b8 CS=0010 SS=0018 DS=0000 ES=0000 FS=0000 GS=0000 TR=0040 FSBase=00007f5ed78c3700 GSBase=ffff8801db400000 TRBase=fffffe0000003000 GDTBase=fffffe0000001000 IDTBase=fffffe0000000000 CR0=0000000080050033 CR3=00000001cc4d5003 CR4=00000000001626f0 Sysenter RSP=fffffe0000002200 CS:RIP=0010:ffffffff85a01e70 EFER = 0x0000000000000d01 PAT = 0x0000000000000000 *** Control State *** PinBased=0000003f CPUBased=b5986dfa SecondaryExec=000000c2 EntryControls=0000d1ff ExitControls=0023efff ExceptionBitmap=00060042 PFECmask=00000000 PFECmatch=00000000 VMEntry: intr_info=80000306 errcode=00000000 ilen=00000000 VMExit: intr_info=00000000 errcode=00000000 ilen=00000003 reason=80000021 qualification=0000000000000000 IDTVectoring: info=00000000 errcode=00000000 TSC Offset = 0xffffffe58dd7c603 EPT pointer = 0x00000001cf30501e netlink: 'syz-executor5': attribute type 1 has an invalid length. netlink: 24 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 'syz-executor5': attribute type 1 has an invalid length. QAT: Invalid ioctl QAT: Invalid ioctl x_tables: ip_tables: osf match: used from hooks OUTPUT/POSTROUTING, but only valid from PREROUTING/INPUT/FORWARD x_tables: ip_tables: osf match: used from hooks OUTPUT/POSTROUTING, but only valid from PREROUTING/INPUT/FORWARD x_tables: ip_tables: osf match: used from hooks OUTPUT/POSTROUTING, but only valid from PREROUTING/INPUT/FORWARD x_tables: ip_tables: osf match: used from hooks OUTPUT/POSTROUTING, but only valid from PREROUTING/INPUT/FORWARD xt_CT: You must specify a L4 protocol, and not use inversions on it. device eql entered promiscuous mode syz-executor7 uses obsolete (PF_INET,SOCK_PACKET) mmap: syz-executor2 (6637) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. kauditd_printk_skb: 16 callbacks suppressed audit: type=1400 audit(1518772763.534:45): avc: denied { ioctl } for pid=6673 comm="syz-executor7" path="socket:[18500]" dev="sockfs" ino=18500 ioctlcmd=0x89e6 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 QAT: Invalid ioctl audit: type=1400 audit(1518772763.537:46): avc: denied { validate_trans } for pid=6673 comm="syz-executor7" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:security_t:s0 tclass=security permissive=1 QAT: Invalid ioctl audit: type=1400 audit(1518772763.718:47): avc: denied { write } for pid=6716 comm="syz-executor7" name="net" dev="proc" ino=17952 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(1518772763.726:48): avc: denied { add_name } for pid=6716 comm="syz-executor7" 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 audit: type=1400 audit(1518772763.726:49): avc: denied { create } for pid=6716 comm="syz-executor7" name="pfkey" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:insmod_t:s0 tclass=file permissive=1 netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. SELinux: unknown mount option syz-executor0 (6954) used greatest stack depth: 15872 bytes left xt_CT: You must specify a L4 protocol, and not use inversions on it. audit: type=1400 audit(1518772764.653:50): avc: denied { setopt } for pid=7003 comm="syz-executor2" 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(1518772764.653:51): avc: denied { net_broadcast } for pid=7003 comm="syz-executor2" 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 audit: type=1400 audit(1518772765.405:52): avc: denied { set_context_mgr } for pid=7089 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=binder permissive=1 xt_connbytes: Forcing CT accounting to be enabled binder: 7089:7093 BC_FREE_BUFFER uffffffffffffffff no match binder: 7089:7116 BC_DEAD_BINDER_DONE 0000000000000003 not found binder: 7089:7120 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 7089:7120 BC_FREE_BUFFER uffffffffffffffff no match binder: 7089:7116 BC_DEAD_BINDER_DONE 0000000000000003 not found x_tables: ip6_tables: socket match: used from hooks INPUT/FORWARD/OUTPUT, but only valid from PREROUTING/INPUT binder: 7123:7134 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 x_tables: ip6_tables: socket match: used from hooks INPUT/FORWARD/OUTPUT, but only valid from PREROUTING/INPUT xt_HMARK: hash modulus can't be zero xt_HMARK: hash modulus can't be zero audit: type=1400 audit(1518772765.955:53): avc: denied { map } for pid=7253 comm="syz-executor6" path="socket:[19670]" dev="sockfs" ino=19670 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dccp_socket permissive=1 audit: type=1400 audit(1518772765.992:54): avc: denied { map } for pid=7274 comm="syz-executor3" path="/dev/sg0" dev="devtmpfs" ino=9110 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1 sctp: [Deprecated]: syz-executor5 (pid 7363) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor5 (pid 7363) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead openvswitch: netlink: Message has 8 unknown bytes. QAT: Invalid ioctl device eql entered promiscuous mode QAT: Invalid ioctl SELinux: unrecognized netlink message: protocol=0 nlmsg_type=31478 sclass=netlink_route_socket pig=7680 comm=syz-executor2 sctp: [Deprecated]: syz-executor7 (pid 7732) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead binder: BINDER_SET_CONTEXT_MGR already set binder: 7720:7739 ioctl 40046207 0 returned -16 binder_alloc: 7720: binder_alloc_buf, no vma binder: 7720:7748 transaction failed 29189/-3, size 40-0 line 2957 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7720:7728 transaction 6 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 6, target dead QAT: Invalid ioctl QAT: Invalid ioctl netlink: 'syz-executor1': attribute type 3 has an invalid length. netlink: 'syz-executor1': attribute type 3 has an invalid length. capability: warning: `syz-executor1' uses deprecated v2 capabilities in a way that may be insecure netlink: 4 bytes leftover after parsing attributes in process `syz-executor7'.