====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #221 Not tainted ------------------------------------------------------ syz-executor6/5493 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<00000000675f7507>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<00000000675f7507>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<00000000ff311aee>] 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 clusterip_config_entry_put net/ipv4/netfilter/ipt_CLUSTERIP.c:114 [inline] clusterip_tg_destroy+0x389/0x6e0 net/ipv4/netfilter/ipt_CLUSTERIP.c:518 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 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 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #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:1041 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1088 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_ipt_get_ctl+0x159/0xac0 net/ipv4/netfilter/ip_tables.c:1699 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 entry_SYSCALL_64_fastpath+0x29/0xa0 -> #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 entry_SYSCALL_64_fastpath+0x29/0xa0 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/5493: #0: (rtnl_mutex){+.+.}, at: [<00000000ff311aee>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 0 PID: 5493 Comm: syz-executor6 Not tainted 4.15.0+ #221 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 ipt_ECN: cannot use TCP operations on a non-tcp rule ipt_ECN: cannot use TCP operations on a non-tcp rule 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 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x453299 RSP: 002b:00007fd01cfa9c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000027 RSI: 0000000000000000 RDI: 0000000000000013 RBP: 0000000000000000 R08: 000000000000000c R09: 0000000000000000 R10: 0000000020de2ff4 R11: 0000000000000212 R12: 00000000006ef0a0 R13: 00000000ffffffff R14: 00007fd01cfaa6d4 R15: 0000000000000000 sock: process `syz-executor5' is using obsolete getsockopt SO_BSDCOMPAT ipt_CLUSTERIP: ipt_CLUSTERIP is deprecated and it will removed soon, use xt_cluster instead ipt_REJECT: TCP_RESET invalid for non-tcp ipt_REJECT: TCP_RESET invalid for non-tcp ip_tables: iptables: counters copy to user failed while replacing table netlink: 'syz-executor1': attribute type 3 has an invalid length. netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. openvswitch: netlink: Either Ethernet header or EtherType is required. dccp_xmit_packet: Payload too large (65423) for featneg. netlink: 4 bytes leftover after parsing attributes in process `syz-executor2'. openvswitch: netlink: Either Ethernet header or EtherType is required. dccp_xmit_packet: Payload too large (65423) for featneg. NFQUEUE: number of total queues is 0 NFQUEUE: number of total queues is 0 ipt_ECN: cannot use TCP operations on a non-tcp rule ipt_ECN: cannot use TCP operations on a non-tcp rule SNAT: multiple ranges no longer supported netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. SNAT: multiple ranges no longer supported netlink: 'syz-executor1': attribute type 1 has an invalid length. netlink: 'syz-executor1': attribute type 16 has an invalid length. netlink: 'syz-executor1': attribute type 16 has an invalid length. SELinux: unrecognized netlink message: protocol=9 nlmsg_type=40 sclass=netlink_audit_socket pig=6561 comm=syz-executor1 SELinux: unrecognized netlink message: protocol=9 nlmsg_type=40 sclass=netlink_audit_socket pig=6587 comm=syz-executor1 ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' sctp: [Deprecated]: syz-executor0 (pid 6600) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' ieee80211 phy4: Selected rate control algorithm 'minstrel_ht' ieee80211 phy5: Selected rate control algorithm 'minstrel_ht' sctp: [Deprecated]: syz-executor5 (pid 7015) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor5 (pid 7015) Use of int in maxseg socket option. Use struct sctp_assoc_value instead kauditd_printk_skb: 22 callbacks suppressed audit: type=1400 audit(1517997697.737:44): avc: denied { setopt } for pid=7134 comm="syz-executor5" 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(1517997697.773:45): avc: denied { write } for pid=7134 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=socket permissive=1 netlink: 'syz-executor2': attribute type 1 has an invalid length. netlink: 'syz-executor2': attribute type 1 has an invalid length. device lo entered promiscuous mode kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 7242 Comm: syz-executor2 Not tainted 4.15.0+ #221 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:ip6t_do_table+0x132d/0x1a30 net/ipv6/netfilter/ip6_tables.c:355 RSP: 0018:ffff8801c509e728 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8801aff76500 RCX: ffffffff84db22a1 RDX: 0000000000000347 RSI: 0000000000000000 RDI: ffff8801aff7665e RBP: ffff8801c509e970 R08: ffff8801c509ea68 R09: 0000000000000000 R10: 00000000000000d0 R11: ffffffff86b423c0 R12: 0000000000000001 R13: 0000000000000000 R14: dffffc0000000000 R15: ffff8801aff765d0 FS: 00007f89c73dc700(0000) GS:ffff8801db400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020efe000 CR3: 00000001ac493006 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ip6table_security_hook+0x65/0x80 net/ipv6/netfilter/ip6table_security.c:45 nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline] nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483 nf_hook include/linux/netfilter.h:243 [inline] NF_HOOK include/linux/netfilter.h:286 [inline] ip6_input+0x35c/0x560 net/ipv6/ip6_input.c:327 ip6_mc_input+0x3a8/0xb10 net/ipv6/ip6_input.c:404 dst_input include/net/dst.h:449 [inline] ip6_rcv_finish+0x297/0x8c0 net/ipv6/ip6_input.c:71 NF_HOOK include/linux/netfilter.h:288 [inline] ipv6_rcv+0xf37/0x1fa0 net/ipv6/ip6_input.c:208 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4547 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4612 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4686 netif_receive_skb+0xae/0x390 net/core/dev.c:4710 tun_rx_batched.isra.52+0x5ee/0x870 drivers/net/tun.c:1558 tun_get_user+0x25de/0x3940 drivers/net/tun.c:1958 tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1986 call_write_iter include/linux/fs.h:1781 [inline] do_iter_readv_writev+0x55c/0x830 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:00007f89c73dbb80 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453171 RDX: 0000000000000001 RSI: 00007f89c73dbbd0 RDI: 0000000000000012 RBP: 0000000000000060 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000046 R11: 0000000000000293 R12: 00000000006ef9a0 R13: 00000000ffffffff R14: 00007f89c73dc6d4 R15: 0000000000000000 Code: 41 f6 87 83 00 00 00 04 75 37 e8 0f 83 95 fc 8b 85 14 fe ff ff 48 8b b5 50 fe ff ff 4c 8d 2c c6 44 8d 60 01 4c 89 e8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 26 03 00 00 4d 89 7d 00 44 89 a5 14 fe ff RIP: ip6t_do_table+0x132d/0x1a30 net/ipv6/netfilter/ip6_tables.c:355 RSP: ffff8801c509e728 ---[ end trace 4d4c38c71ab72b67 ]---