====================================================== WARNING: possible circular locking dependency detected 4.15.0-rc9+ #214 Not tainted ------------------------------------------------------ syz-executor3/5293 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [<00000000ecfb0445>] xt_find_target+0x44/0x1e0 net/netfilter/x_tables.c:229 but task is already holding lock: (sk_lock-AF_INET6){+.+.}, at: [<0000000068d7de03>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET6){+.+.}, at: [<0000000068d7de03>] ipv6_setsockopt+0xff/0x150 net/ipv6/ipv6_sockglue.c:927 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sk_lock-AF_INET6){+.+.}: lock_sock_nested+0xc2/0x110 net/core/sock.c:2780 lock_sock include/net/sock.h:1463 [inline] do_ipv6_setsockopt.isra.8+0x3c5/0x39d0 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xd7/0x150 net/ipv6/ipv6_sockglue.c:922 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2896 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 -> #1 (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 clusterip_config_entry_put net/ipv4/netfilter/ipt_CLUSTERIP.c:114 [inline] clusterip_tg_destroy+0x389/0x6e0 net/ipv4/netfilter/ipt_CLUSTERIP.c:508 cleanup_entry+0x218/0x350 net/ipv4/netfilter/ip_tables.c:659 __do_replace+0x79d/0xa50 net/ipv4/netfilter/ip_tables.c:1094 do_replace net/ipv4/netfilter/ip_tables.c:1150 [inline] do_ipt_set_ctl+0x40f/0x5f0 net/ipv4/netfilter/ip_tables.c:1680 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 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2896 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 -> #0 (&xt[i].mutex){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914 __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_target+0x44/0x1e0 net/netfilter/x_tables.c:229 xt_request_find_target+0x2c/0xb0 net/netfilter/x_tables.c:255 find_check_entry.isra.7+0x669/0xcf0 net/ipv6/netfilter/ip6_tables.c:572 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749 do_replace net/ipv6/netfilter/ip6_tables.c:1165 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1691 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4141 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: Chain exists of: &xt[i].mutex --> rtnl_mutex --> sk_lock-AF_INET6 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sk_lock-AF_INET6); lock(rtnl_mutex); lock(sk_lock-AF_INET6); lock(&xt[i].mutex); *** DEADLOCK *** 1 lock held by syz-executor3/5293: #0: (sk_lock-AF_INET6){+.+.}, at: [<0000000068d7de03>] lock_sock include/net/sock.h:1463 [inline] #0: (sk_lock-AF_INET6){+.+.}, at: [<0000000068d7de03>] ipv6_setsockopt+0xff/0x150 net/ipv6/ipv6_sockglue.c:927 stack backtrace: CPU: 0 PID: 5293 Comm: syz-executor3 Not tainted 4.15.0-rc9+ #214 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.37+0x2cd/0x2dc kernel/locking/lockdep.c:1218 check_prev_add kernel/locking/lockdep.c:1858 [inline] check_prevs_add kernel/locking/lockdep.c:1971 [inline] validate_chain kernel/locking/lockdep.c:2412 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3426 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3914 __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_target+0x44/0x1e0 net/netfilter/x_tables.c:229 xt_request_find_target+0x2c/0xb0 net/netfilter/x_tables.c:255 find_check_entry.isra.7+0x669/0xcf0 net/ipv6/netfilter/ip6_tables.c:572 translate_table+0xf52/0x1690 net/ipv6/netfilter/ip6_tables.c:749 do_replace net/ipv6/netfilter/ip6_tables.c:1165 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1691 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x115/0x150 net/ipv6/ipv6_sockglue.c:928 sctp_setsockopt+0x2b6/0x61d0 net/sctp/socket.c:4141 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:00007fe3ba150c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000014 RBP: 000000000000000b R08: 00000000000003b8 R09: 0000000000000000 R10: 0000000020006000 R11: 0000000000000212 R12: 00000000006ef1a8 R13: 00000000ffffffff R14: 00007fe3ba1516d4 R15: 0000000000000000 netlink: 8 bytes leftover after parsing attributes in process `syz-executor2'. mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium netlink: 20 bytes leftover after parsing attributes in process `syz-executor6'. tc_dump_action: action bad kind syz0: Invalid MTU -2147483647 requested, hw min 68 syz0: Invalid MTU -2147483647 requested, hw min 68 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=32 sclass=netlink_tcpdiag_socket pig=5588 comm=syz-executor5 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=32 sclass=netlink_tcpdiag_socket pig=5588 comm=syz-executor5 xt_CT: You must specify a L4 protocol, and not use inversions on it. netlink: 'syz-executor1': attribute type 16 has an invalid length. netlink: 'syz-executor1': attribute type 16 has an invalid length. xt_CT: You must specify a L4 protocol, and not use inversions on it. KCM: Hard failure on kcm_write_msgs netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. device syz7 entered promiscuous mode netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. device syz7 left promiscuous mode netlink: 'syz-executor6': attribute type 1 has an invalid length. netlink: 'syz-executor6': attribute type 1 has an invalid length. KCM: Hard failure on kcm_write_msgs -2147483648 syz-executor3 uses obsolete (PF_INET,SOCK_PACKET) IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 xt_cgroup: no path or classid specified dccp_close: ABORT with 253 bytes unread netlink: 156 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 156 bytes leftover after parsing attributes in process `syz-executor7'. kernel msg: ebtables bug: please report to author: Wrong len argument FAULT_INJECTION: forcing a failure. name fail_page_alloc, interval 1, probability 0, space 0, times 1 CPU: 0 PID: 6142 Comm: syz-executor5 Not tainted 4.15.0-rc9+ #214 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_fail_alloc_page mm/page_alloc.c:2948 [inline] prepare_alloc_pages mm/page_alloc.c:4187 [inline] __alloc_pages_nodemask+0x338/0xd80 mm/page_alloc.c:4226 alloc_pages_current+0xb6/0x1e0 mm/mempolicy.c:2036 alloc_pages include/linux/gfp.h:492 [inline] skb_page_frag_refill+0x358/0x5f0 net/core/sock.c:2211 tun_build_skb.isra.51+0x2f0/0x1810 drivers/net/tun.c:1630 tun_get_user+0x17d0/0x3940 drivers/net/tun.c:1800 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1986 call_write_iter include/linux/fs.h:1772 [inline] do_iter_readv_writev+0x525/0x7f0 fs/read_write.c:653 do_iter_write+0x154/0x540 fs/read_write.c:932 vfs_writev+0x18a/0x340 fs/read_write.c:977 do_writev+0xfc/0x2a0 fs/read_write.c:1012 SYSC_writev fs/read_write.c:1085 [inline] SyS_writev+0x27/0x30 fs/read_write.c:1082 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453171 RSP: 002b:00007f5ed6771b80 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f5ed6771aa0 RCX: 0000000000453171 RDX: 0000000000000001 RSI: 00007f5ed6771bd0 RDI: 0000000000000012 RBP: 00007f5ed6771a90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000082 R11: 0000000000000293 R12: 00000000004b8096 R13: 00007f5ed6771bc8 R14: 00000000004b8096 R15: 0000000000000000 xt_connbytes: Forcing CT accounting to be enabled kernel msg: ebtables bug: please report to author: Wrong len argument FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 kauditd_printk_skb: 14 callbacks suppressed audit: type=1400 audit(1517216327.111:38): avc: denied { accept } for pid=6176 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 CPU: 1 PID: 6188 Comm: syz-executor5 Not tainted 4.15.0-rc9+ #214 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 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3368 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3542 __build_skb+0x9d/0x450 net/core/skbuff.c:281 build_skb+0x6f/0x2a0 net/core/skbuff.c:312 tun_build_skb.isra.51+0x9cb/0x1810 drivers/net/tun.c:1690 tun_get_user+0x17d0/0x3940 drivers/net/tun.c:1800 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1986 call_write_iter include/linux/fs.h:1772 [inline] do_iter_readv_writev+0x525/0x7f0 fs/read_write.c:653 do_iter_write+0x154/0x540 fs/read_write.c:932 vfs_writev+0x18a/0x340 fs/read_write.c:977 do_writev+0xfc/0x2a0 fs/read_write.c:1012 SYSC_writev fs/read_write.c:1085 [inline] SyS_writev+0x27/0x30 fs/read_write.c:1082 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453171 RSP: 002b:00007f5ed6771b80 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f5ed6771aa0 RCX: 0000000000453171 RDX: 0000000000000001 RSI: 00007f5ed6771bd0 RDI: 0000000000000012 RBP: 00007f5ed6771a90 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000082 R11: 0000000000000293 R12: 00000000004b8096 R13: 00007f5ed6771bc8 R14: 00000000004b8096 R15: 0000000000000000 xt_connbytes: Forcing CT accounting to be enabled audit: type=1400 audit(1517216327.866:39): avc: denied { connect } for pid=6352 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 ip6tnl0: Invalid MTU 547700704 requested, hw max 65392 sctp: [Deprecated]: syz-executor1 (pid 6475) Use of int in max_burst socket option. Use struct sctp_assoc_value instead net_ratelimit: 1 callbacks suppressed IPv4: Oversized IP packet from 127.0.0.1 sctp: [Deprecated]: syz-executor1 (pid 6475) Use of int in max_burst socket option. Use struct sctp_assoc_value instead mip6: mip6_destopt_init_state: state's mode is not 2: 0 mip6: mip6_destopt_init_state: state's mode is not 2: 0 8021q: VLANs not supported on lo 8021q: VLANs not supported on lo SELinux: unrecognized netlink message: protocol=6 nlmsg_type=725 sclass=netlink_xfrm_socket pig=6832 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=725 sclass=netlink_xfrm_socket pig=6849 comm=syz-executor1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1400 audit(1517216329.438:40): avc: denied { connect } for pid=6979 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_netfilter_socket permissive=1 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x3 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x3 netlink: 'syz-executor6': attribute type 1 has an invalid length. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=55534 sclass=netlink_route_socket pig=7225 comm=syz-executor4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=55534 sclass=netlink_route_socket pig=7241 comm=syz-executor4 audit: type=1400 audit(1517216330.222:41): avc: denied { map } for pid=7294 comm="syz-executor4" path="socket:[17582]" dev="sockfs" ino=17582 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_route_socket permissive=1 raw_sendmsg: syz-executor5 forgot to set AF_INET. Fix it! IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route IPv6: NLM_F_CREATE should be set when creating new route IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route IPv6: NLM_F_CREATE should be set when creating new route IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE netlink: 'syz-executor3': attribute type 1 has an invalid length. netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 'syz-executor3': attribute type 1 has an invalid length. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=3138 sclass=netlink_route_socket pig=7723 comm=syz-executor3 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=3138 sclass=netlink_route_socket pig=7736 comm=syz-executor3 TCP: request_sock_TCPv6: Possible SYN flooding on port 20014. Sending cookies. Check SNMP counters. oom_reaper: reaped process 7795 (syz-executor1), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB rsyslogd invoked oom-killer: gfp_mask=0x14200ca(GFP_HIGHUSER_MOVABLE), nodemask=(null), order=0, oom_score_adj=0 rsyslogd cpuset=/ mems_allowed=0 CPU: 0 PID: 3533 Comm: rsyslogd Not tainted 4.15.0-rc9+ #214 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 dump_header+0x28c/0xe1e mm/oom_kill.c:437 oom_kill_process+0x8b5/0x14a0 mm/oom_kill.c:865 out_of_memory+0x86d/0x1220 mm/oom_kill.c:1079 __alloc_pages_may_oom mm/page_alloc.c:3395 [inline] __alloc_pages_slowpath+0x1d1b/0x2d00 mm/page_alloc.c:4096 __alloc_pages_nodemask+0x9fb/0xd80 mm/page_alloc.c:4252 alloc_pages_current+0xb6/0x1e0 mm/mempolicy.c:2036 alloc_pages include/linux/gfp.h:492 [inline] __page_cache_alloc+0x334/0x500 mm/filemap.c:946 page_cache_read mm/filemap.c:2388 [inline] filemap_fault+0xefc/0x1c20 mm/filemap.c:2572 ext4_filemap_fault+0x82/0xad fs/ext4/inode.c:6164 __do_fault+0xeb/0x30f mm/memory.c:3202 do_read_fault mm/memory.c:3612 [inline] do_fault mm/memory.c:3712 [inline] handle_pte_fault mm/memory.c:3943 [inline] __handle_mm_fault+0x1d8f/0x3ce0 mm/memory.c:4067 handle_mm_fault+0x334/0x8d0 mm/memory.c:4104