====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc1+ #314 Not tainted ------------------------------------------------------ syz-executor3/5430 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<000000007e271bbb>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<000000007e271bbb>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000006455c9d0>] 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 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 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-executor3/5430: #0: (rtnl_mutex){+.+.}, at: [<000000006455c9d0>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 5430 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 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 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 RIP: 0033:0x453a59 RSP: 002b:00007f2ad173bc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f2ad173c6d4 RCX: 0000000000453a59 RDX: 0000000000000029 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000028 R09: 0000000000000000 R10: 0000000020769fd8 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000524 R14: 00000000006f7c00 R15: 0000000000000000 xt_connbytes: Forcing CT accounting to be enabled IPVS: ftp: loaded support on port[0] = 21 Can not set IPV6_FL_F_REFLECT if flowlabel_consistency sysctl is enable binder: 5880 RLIMIT_NICE not set binder: 5880 RLIMIT_NICE not set binder: 5874:5880 ioctl 5473 2001cff8 returned -22 binder: 5874:5891 tried to acquire reference to desc 0, got 1 instead SELinux: unrecognized netlink message: protocol=0 nlmsg_type=256 sclass=netlink_route_socket pig=5888 comm=syz-executor5 binder: 5874:5880 unknown command 536907575 binder: 5874:5891 BC_CLEAR_DEATH_NOTIFICATION invalid ref 0 binder: 5891 RLIMIT_NICE not set binder: 5874:5880 ioctl c0306201 20008fd0 returned -22 binder: 5874:5909 BC_REQUEST_DEATH_NOTIFICATION death notification already set SELinux: unrecognized netlink message: protocol=0 nlmsg_type=256 sclass=netlink_route_socket pig=5881 comm=syz-executor5 binder: 5874:5911 ioctl 5473 2001cff8 returned -22 QAT: Invalid ioctl QAT: Invalid ioctl syz-executor3 (6039): /proc/6036/oom_adj is deprecated, please use /proc/6036/oom_score_adj instead. netlink: 'syz-executor2': attribute type 16 has an invalid length. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=6066 comm=syz-executor1 netlink: 'syz-executor2': attribute type 16 has an invalid length. ip6t_srh: unknown srh invflags FFFE ip6t_srh: unknown srh invflags FFFE mmap: syz-executor7 (6273) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. kauditd_printk_skb: 18 callbacks suppressed audit: type=1400 audit(1518801461.798:40): avc: denied { ioctl } for pid=6314 comm="syz-executor3" path="socket:[16741]" dev="sockfs" ino=16741 ioctlcmd=0x891a 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 netlink: 'syz-executor3': attribute type 3 has an invalid length. ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x3 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x3 audit: type=1400 audit(1518801462.271:41): avc: denied { setuid } for pid=6454 comm="syz-executor7" 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 netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. audit: type=1400 audit(1518801462.496:42): avc: denied { write } for pid=6515 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 audit: type=1400 audit(1518801462.554:43): avc: denied { create } for pid=6539 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_iscsi_socket permissive=1 audit: type=1400 audit(1518801462.635:44): avc: denied { create } for pid=6544 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(1518801462.695:45): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6582 comm="syz-executor7" exe="/root/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453a59 code=0x0 audit: type=1326 audit(1518801462.703:46): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=6582 comm="syz-executor7" exe="/root/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453a59 code=0x0 netlink: 5 bytes leftover after parsing attributes in process `syz-executor7'. xprt_adjust_timeout: rq_timeout = 0! netlink: 5 bytes leftover after parsing attributes in process `syz-executor7'. xprt_adjust_timeout: rq_timeout = 0! audit: type=1400 audit(1518801463.321:47): avc: denied { map } for pid=6791 comm="syz-executor0" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=18413 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:hugetlbfs_t:s0 tclass=file permissive=1 ptrace attach of "/root/syz-executor0"[4213] was attempted by "/root/syz-executor0"[6809] netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor1'. ptrace attach of "/root/syz-executor0"[4213] was attempted by "/root/syz-executor0"[6822] ptrace attach of "/root/syz-executor4"[4223] was attempted by "/root/syz-executor4"[6827] audit: type=1400 audit(1518801463.633:48): avc: denied { prog_run } for pid=6853 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=bpf permissive=1 netlink: 'syz-executor4': attribute type 1 has an invalid length. x_tables: ip_tables: TCPMSS target: only valid for protocol 6 x_tables: ip_tables: TCPMSS target: only valid for protocol 6 audit: type=1400 audit(1518801464.206:49): avc: denied { read } for pid=7039 comm="syz-executor0" path="socket:[19796]" dev="sockfs" ino=19796 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: 7043 RLIMIT_NICE not set QAT: Invalid ioctl syz6: Invalid MTU 7 requested, hw min 68 *** Guest State *** CR0: actual=0x0000000000000030, shadow=0x0000000060000010, gh_mask=fffffffffffffff7 CR4: actual=0x0000000000002050, shadow=0x0000000000000000, gh_mask=ffffffffffffe871 CR3 = 0x00000000fffbc000 RSP = 0x0000000000000000 RIP = 0x000000000000fff0 binder: BINDER_SET_CONTEXT_MGR already set RFLAGS=0x00000002 DR7 = 0x0000000000000400 Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000 CS: sel=0xf000, attr=0x0009b, limit=0x0000ffff, base=0x00000000ffff0000 DS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000 binder: 7040:7088 ioctl 40046207 0 returned -16 SS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000 ES: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000 FS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000 GS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000 GDTR: limit=0x0000ffff, base=0x0000000000000000 LDTR: sel=0x0000, attr=0x00082, limit=0x0000ffff, base=0x0000000000000000 IDTR: limit=0x0000ffff, base=0x0000000000000000 TR: sel=0x0000, attr=0x0008b, limit=0x0000ffff, base=0x0000000000000000 EFER = 0x0000000000000000 PAT = 0x0007040600070406 DebugCtl = 0x0000000000000000 DebugExceptions = 0x0000000000000000 Interruptibility = 00000001 ActivityState = 00000000 *** Host State *** RIP = 0xffffffff811cd915 RSP = 0xffff8801a24c73b8 CS=0010 SS=0018 DS=0000 ES=0000 FS=0000 GS=0000 TR=0040 FSBase=00007f2ad171b700 GSBase=ffff8801db500000 TRBase=fffffe0000034000 GDTBase=fffffe0000032000 IDTBase=fffffe0000000000 CR0=0000000080050033 CR3=00000001b125c006 CR4=00000000001626e0 Sysenter RSP=fffffe0000033200 CS:RIP=0010:ffffffff85a01e70 EFER = 0x0000000000000d01 PAT = 0x0000000000000000 *** Control State *** PinBased=0000003f CPUBased=b599edfe SecondaryExec=000000c2 EntryControls=0000d1ff ExitControls=0023efff ExceptionBitmap=00060042 PFECmask=00000000 PFECmatch=00000000 VMEntry: intr_info=00000000 errcode=00000000 ilen=00000000 VMExit: intr_info=00000000 errcode=00000000 ilen=00000000 reason=80000021 qualification=0000000000000000 IDTVectoring: info=00000000 errcode=00000000 TSC Offset = 0xffffffe680499478 EPT pointer = 0x00000001ac71e01e binder: 7105:7129 transaction failed 29189/-22, size 40-8 line 2842 binder: 7105:7129 BC_INCREFS_DONE u0000000000000000 no match binder: 7105:7129 transaction failed 29189/-22, size 40-8 line 2842 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 xt_nfacct: accounting object with name `syz0' does not exists xt_nfacct: accounting object with name `syz0' does not exists QAT: Invalid ioctl xt_connbytes: Forcing CT accounting to be enabled binder_alloc: binder_alloc_mmap_handler: 7581 20fa2000-20fa3000 already mapped failed -16 SELinux: failed to load policy device syz7 entered promiscuous mode mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium device syz5 entered promiscuous mode device syz5 left promiscuous mode device syz5 entered promiscuous mode xt_connbytes: Forcing CT accounting to be enabled syz-executor3 uses obsolete (PF_INET,SOCK_PACKET) QAT: Invalid ioctl QAT: Invalid ioctl capability: warning: `syz-executor1' uses deprecated v2 capabilities in a way that may be insecure audit: type=1400 audit(1518801467.029:50): avc: denied { setopt } for pid=7836 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_generic_socket permissive=1 audit: type=1400 audit(1518801467.285:51): avc: denied { map } for pid=7939 comm="syz-executor6" path="/dev/loop0" dev="devtmpfs" ino=9142 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file permissive=1 autofs4:pid:8003:check_dev_ioctl_version: ioctl control interface version mismatch: kernel(1.1), user(1.64), cmd(0x0000937e) binder: 8005 RLIMIT_NICE not set autofs4:pid:8003:validate_dev_ioctl: invalid device control module version supplied for cmd(0x0000937e) audit: type=1400 audit(1518801467.561:52): avc: denied { getattr } for pid=8002 comm="syz-executor7" path="socket:[22708]" dev="sockfs" ino=22708 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: BINDER_SET_CONTEXT_MGR already set binder: 7993:8005 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_COMPLETE