====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc1+ #315 Not tainted ------------------------------------------------------ syz-executor2/5842 is trying to acquire lock: (sk_lock-AF_INET6){+.+.}, at: [<000000006eff0230>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET6){+.+.}, at: [<000000006eff0230>] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000321e8a3c>] 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_ip6t_get_ctl+0x159/0xaf0 net/ipv6/netfilter/ip6_tables.c:1710 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt+0x1df/0x2e0 net/ipv6/ipv6_sockglue.c:1371 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_INET6){+.+.}: 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_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x130 net/ipv6/ipv6_sockglue.c:922 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_INET6 --> &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_INET6); *** DEADLOCK *** 1 lock held by syz-executor2/5842: #0: (rtnl_mutex){+.+.}, at: [<00000000321e8a3c>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 1 PID: 5842 Comm: syz-executor2 Not tainted 4.16.0-rc1+ #315 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_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x130 net/ipv6/ipv6_sockglue.c:922 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:00007fe3445b4c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fe3445b56d4 RCX: 0000000000453a59 RDX: 000000000000002a RSI: 0000000000000029 RDI: 0000000000000013 RBP: 000000000071bea0 R08: 0000000000000088 R09: 0000000000000000 R10: 00000000205ccf78 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004fb R14: 00000000006f7828 R15: 0000000000000000 audit: type=1400 audit(1518828124.157:35): avc: denied { connect } for pid=5874 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_generic_socket permissive=1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 binder: 6001:6004 transaction failed 29189/-22, size 0-0 line 2842 TCP: request_sock_TCPv6: Possible SYN flooding on port 20030. Sending cookies. Check SNMP counters. binder: 6001:6018 transaction failed 29189/-22, size 0-0 line 2842 ion_ioctl: ioctl validate failed ipt_CLUSTERIP: bad local_nodes[1] 0 rfkill: input handler disabled rfkill: input handler enabled raw_sendmsg: syz-executor1 forgot to set AF_INET. Fix it! binder: 6412:6417 ioctl c0405519 20000fc0 returned -22 binder: 6412:6417 transaction failed 29189/-22, size 0-0 line 2842 binder: 6417 RLIMIT_NICE not set binder: 6412:6417 ioctl c0306201 20004000 returned -11 binder: 6412:6417 ioctl c0306201 2000a000 returned -14 binder: 6412:6439 ioctl c0405519 20000fc0 returned -22 binder_alloc: binder_alloc_mmap_handler: 6412 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 6412:6439 ioctl 40046207 0 returned -16 9pnet_virtio: no channels available for device ./file0 binder: 6412:6417 transaction failed 29189/-22, size 0-0 line 2842 binder: 6439 RLIMIT_NICE not set binder: 6412:6439 ioctl c0306201 20004000 returned -11 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 netlink: 'syz-executor1': attribute type 21 has an invalid length. netlink: 'syz-executor1': attribute type 21 has an invalid length. rfkill: input handler disabled rfkill: input handler enabled netlink: 4092 bytes leftover after parsing attributes in process `syz-executor4'. xt_dscp: dscp 7f out of range QAT: Invalid ioctl QAT: Invalid ioctl xt_HMARK: hash modulus can't be zero xt_HMARK: hash modulus can't be zero netlink: 'syz-executor6': attribute type 1 has an invalid length. netlink: 'syz-executor6': attribute type 1 has an invalid length. mip6: mip6_destopt_init_state: state's mode is not 2: 0 mip6: mip6_destopt_init_state: state's mode is not 2: 0 syz-executor4 uses obsolete (PF_INET,SOCK_PACKET) l2tp_core: tunl 59: sockfd_lookup(fd=0) returned -88 l2tp_core: tunl 59: sockfd_lookup(fd=0) returned -88 tc_dump_action: action bad kind SELinux: unrecognized netlink message: protocol=0 nlmsg_type=43 sclass=netlink_route_socket pig=6913 comm=syz-executor5 tc_dump_action: action bad kind netlink: 'syz-executor2': attribute type 1 has an invalid length. netlink: 'syz-executor2': attribute type 1 has an invalid length. netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor6'. xt_HMARK: hash modulus can't be zero xt_HMARK: hash modulus can't be zero dccp_close: ABORT with 1 bytes unread netlink: 'syz-executor3': attribute type 26 has an invalid length. netlink: 'syz-executor3': attribute type 1 has an invalid length. netlink: 'syz-executor3': attribute type 26 has an invalid length. netlink: 'syz-executor3': attribute type 1 has an invalid length. ipt_CLUSTERIP: bad local_nodes[0] 0 CUSE: DEVNAME unspecified ipt_CLUSTERIP: bad local_nodes[0] 0 binder: 7182:7186 transaction failed 29189/-22, size 0-0 line 2842 binder: 7182:7197 got reply transaction with no transaction stack binder: 7182:7197 transaction failed 29201/-71, size 0-0 line 2757 binder: 7182:7197 transaction failed 29189/-22, size 0-0 line 2842 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 netlink: 216 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 216 bytes leftover after parsing attributes in process `syz-executor0'. sctp: [Deprecated]: syz-executor1 (pid 7238) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead kauditd_printk_skb: 31 callbacks suppressed audit: type=1400 audit(1518828128.641:67): avc: denied { setopt } for pid=7263 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 audit: type=1400 audit(1518828128.642:68): avc: denied { ioctl } for pid=7263 comm="syz-executor7" path="socket:[19122]" dev="sockfs" ino=19122 ioctlcmd=0x5429 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 openvswitch: netlink: Flow actions attr not present in new flow. binder: 7319:7325 unknown command 0 binder: 7319:7325 ioctl c0306201 2000a000 returned -22 audit: type=1400 audit(1518828128.917:69): avc: denied { call } for pid=7319 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=binder permissive=1 audit: type=1400 audit(1518828128.918:70): avc: denied { transfer } for pid=7319 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=binder permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: binder_alloc_mmap_handler: 7319 20000000-20002000 already mapped failed -16 binder: 7319:7325 ioctl 40046207 0 returned -16 binder: 7319:7361 unknown command 0 binder_alloc: 7319: binder_alloc_buf, no vma binder: 7319:7325 transaction failed 29189/-3, size 56-8 line 2957 binder: 7319:7361 ioctl c0306201 2000a000 returned -22 audit: type=1400 audit(1518828129.066:71): avc: denied { map } for pid=7365 comm="syz-executor0" path="/dev/rfkill" dev="devtmpfs" ino=1052 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:wireless_device_t:s0 tclass=chr_file permissive=1 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 7319:7325 transaction 11 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 11, target dead dccp_invalid_packet: invalid packet type audit: type=1400 audit(1518828129.224:72): avc: denied { dyntransition } for pid=7390 comm="syz-executor2" 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 BUG: sleeping function called from invalid context at mm/slab.h:420 in_atomic(): 1, irqs_disabled(): 0, pid: 7414, name: syz-executor1 INFO: lockdep is turned off. CPU: 1 PID: 7414 Comm: syz-executor1 Not tainted 4.16.0-rc1+ #315 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 ___might_sleep+0x2b2/0x470 kernel/sched/core.c:6133 __might_sleep+0x95/0x190 kernel/sched/core.c:6086 slab_pre_alloc_hook mm/slab.h:420 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc_trace+0x299/0x740 mm/slab.c:3605 kmalloc include/linux/slab.h:512 [inline] kzalloc include/linux/slab.h:701 [inline] rds_loop_conn_alloc+0xc8/0x380 net/rds/loop.c:126 __rds_conn_create+0x112f/0x1b50 net/rds/connection.c:227 rds_conn_create_outgoing+0x3f/0x50 net/rds/connection.c:309 rds_sendmsg+0xda3/0x2390 net/rds/send.c:1126 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453a59 RSP: 002b:00007f270cbc1c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f270cbc26d4 RCX: 0000000000453a59 RDX: 0000000000000000 RSI: 00000000205f0000 RDI: 0000000000000013 RBP: 000000000071c010 R08: 0000000020f61ff0 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004b9 R14: 00000000006f71f8 R15: 0000000000000002 binder: 7416:7423 BC_ACQUIRE_DONE uffffffffffffffff no match binder: 7416:7423 IncRefs 0 refcount change on invalid ref 2 ret -22 binder: 7416:7423 ERROR: BC_REGISTER_LOOPER called without request binder: 7416:7423 BC_INCREFS_DONE uffffffffffffffff no match binder: 7423 RLIMIT_NICE not set binder: 7416:7423 BC_ACQUIRE_DONE uffffffffffffffff no match binder: 7416:7423 IncRefs 0 refcount change on invalid ref 2 ret -22 binder: 7416:7423 ERROR: BC_REGISTER_LOOPER called without request binder: 7416:7423 BC_INCREFS_DONE uffffffffffffffff no match binder: 7423 RLIMIT_NICE not set Cannot find add_set index 0 as target Cannot find add_set index 0 as target dccp_close: ABORT with 1 bytes unread audit: type=1400 audit(1518828130.383:73): avc: denied { ipc_lock } for pid=7622 comm="syz-executor0" capability=14 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 irq bypass consumer (token 00000000a6c1c179) registration fails: -16 audit: type=1400 audit(1518828130.828:74): avc: denied { getrlimit } for pid=7756 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=process permissive=1 audit: type=1326 audit(1518828131.084:75): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=7815 comm="syz-executor7" exe="/root/syz-executor7" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453a59 code=0x0 QAT: Invalid ioctl audit: type=1400 audit(1518828131.114:76): avc: denied { read } for pid=7827 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 QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl sctp: [Deprecated]: syz-executor4 (pid 7945) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor4 (pid 7945) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl xt_CT: netfilter: NOTRACK target is deprecated, use CT instead or upgrade iptables QAT: Invalid ioctl QAT: Invalid ioctl device eql entered promiscuous mode ipt_REJECT: TCP_RESET invalid for non-tcp ipt_REJECT: TCP_RESET invalid for non-tcp RDS: rds_bind could not find a transport for 224.0.0.1, load rds_tcp or rds_rdma? RDS: rds_bind could not find a transport for 224.0.0.1, load rds_tcp or rds_rdma? PPPIOCDETACH file->f_count=2