bisecting fixing commit since 98db2bf27b9ed2d5ed0b6c9c8a4bfcb127a19796 building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 98db2bf27b9ed2d5ed0b6c9c8a4bfcb127a19796 with gcc (GCC) 8.1.0 kernel signature: 5e74cea325e58fbd223b48e304313a1f3ff1d77ecf37d290dc78a19ceddac91e all runs: crashed: possible deadlock in rtnl_lock testing current HEAD 01364dad1d4577e27a57729d41053f661bb8a5b9 testing commit 01364dad1d4577e27a57729d41053f661bb8a5b9 with gcc (GCC) 8.1.0 kernel signature: ddcf4d004689906a4e4d3258fb4d3926b57ede44d1958b0def2e1654ca0f99c5 all runs: crashed: possible deadlock in rtnl_lock revisions tested: 2, total time: 23m10.533949734s (build: 16m23.430665002s, test: 6m13.448740259s) the crash still happens on HEAD commit msg: Linux 4.14.174 crash: possible deadlock in rtnl_lock batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready ====================================================== WARNING: possible circular locking dependency detected 4.14.174-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/7787 is trying to acquire lock: (rtnl_mutex){+.+.}, at: [] rtnl_lock+0x12/0x20 net/core/rtnetlink.c:72 but task is already holding lock: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x37/0x370 net/netfilter/x_tables.c:1092 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&xt[i].mutex){+.+.}: lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3994 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xef/0x14c0 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 xt_find_revision+0x91/0x190 net/netfilter/x_tables.c:373 nfnl_compat_get+0x207/0x900 net/netfilter/nft_compat.c:678 nfnetlink_rcv_msg+0x89a/0xa70 net/netfilter/nfnetlink.c:214 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 nfnetlink_rcv+0x176/0x1570 net/netfilter/nfnetlink.c:515 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x600 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x625/0x920 net/socket.c:2062 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&table[i].mutex){+.+.}: lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3994 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xef/0x14c0 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 nfnl_lock+0x1d/0x20 net/netfilter/nfnetlink.c:61 nf_tables_netdev_event+0x123/0x560 net/netfilter/nf_tables_netdev.c:122 notifier_call_chain+0xd6/0x150 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x11/0x20 kernel/notifier.c:401 call_netdevice_notifiers_info+0x4b/0x60 net/core/dev.c:1671 call_netdevice_notifiers net/core/dev.c:1687 [inline] rollback_registered_many+0x652/0xb20 net/core/dev.c:7205 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:8278 ip6gre_exit_net+0x394/0x570 net/ipv6/ip6_gre.c:1208 ops_exit_list.isra.7+0x8b/0x120 net/core/net_namespace.c:142 cleanup_net+0x39d/0x7f0 net/core/net_namespace.c:484 process_one_work+0x79e/0x16c0 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #0 (rtnl_mutex){+.+.}: check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2e94/0x4500 kernel/locking/lockdep.c:3487 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3994 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xef/0x14c0 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x12/0x20 net/core/rtnetlink.c:72 unregister_netdevice_notifier+0x6a/0x2d0 net/core/dev.c:1634 tee_tg_destroy+0x52/0xa0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x159/0x210 net/ipv4/netfilter/ip_tables.c:666 __do_replace+0x38b/0x5d0 net/ipv4/netfilter/ip_tables.c:1086 do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline] do_ipt_set_ctl+0x25c/0x3be net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5c/0xb0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0x59/0x70 net/ipv4/ip_sockglue.c:1255 udp_setsockopt+0x16/0x30 net/ipv4/udp.c:2451 sock_common_setsockopt+0x73/0xf0 net/core/sock.c:2971 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x130/0x1f0 net/socket.c:1844 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: rtnl_mutex --> &table[i].mutex --> &xt[i].mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&xt[i].mutex); lock(&table[i].mutex); lock(&xt[i].mutex); lock(rtnl_mutex); *** DEADLOCK *** 1 lock held by syz-executor.4/7787: #0: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x37/0x370 net/netfilter/x_tables.c:1092 stack backtrace: CPU: 0 PID: 7787 Comm: syz-executor.4 Not tainted 4.14.174-syzkaller #0 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+0xf7/0x13b lib/dump_stack.c:58 print_circular_bug.isra.40.cold.67+0x1bd/0x27d kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2e94/0x4500 kernel/locking/lockdep.c:3487 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3994 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xef/0x14c0 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x12/0x20 net/core/rtnetlink.c:72 unregister_netdevice_notifier+0x6a/0x2d0 net/core/dev.c:1634 tee_tg_destroy+0x52/0xa0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x159/0x210 net/ipv4/netfilter/ip_tables.c:666 __do_replace+0x38b/0x5d0 net/ipv4/netfilter/ip_tables.c:1086 do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline] do_ipt_set_ctl+0x25c/0x3be net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5c/0xb0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0x59/0x70 net/ipv4/ip_sockglue.c:1255 udp_setsockopt+0x16/0x30 net/ipv4/udp.c:2451 sock_common_setsockopt+0x73/0xf0 net/core/sock.c:2971 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x130/0x1f0 net/socket.c:1844 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45c429 RSP: 002b:00007f7458dd4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f7458dd56d4 RCX: 000000000045c429 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000076c060 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000020000b40 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000a34 R14: 00000000004cc994 R15: 000000000076c06c ip_tables: iptables: counters copy to user failed while replacing table IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready ip_tables: iptables: counters copy to user failed while replacing table batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_0 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready ip_tables: iptables: counters copy to user failed while replacing table IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table IPVS: ftp: loaded support on port[0] = 21 NOHZ: local_softirq_pending 08 NOHZ: local_softirq_pending 08 IPVS: ftp: loaded support on port[0] = 21 net_ratelimit: 26 callbacks suppressed ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 net_ratelimit: 34 callbacks suppressed ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table