bisecting fixing commit since 98db2bf27b9ed2d5ed0b6c9c8a4bfcb127a19796 building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 98db2bf27b9ed2d5ed0b6c9c8a4bfcb127a19796 with gcc (GCC) 8.1.0 kernel signature: f341c4ae8e0403fb44a0816f100917b10ccc86da24fddb203ef07e00f816a34b all runs: crashed: possible deadlock in rtnl_lock testing current HEAD a41ba30d9df20fe141c92aacbb56b6b077f19716 testing commit a41ba30d9df20fe141c92aacbb56b6b077f19716 with gcc (GCC) 8.1.0 kernel signature: c6717f30d86b99b0ab35572124a48e1ed83149e889ce9d2b9328b1e805d24eea all runs: crashed: possible deadlock in rtnl_lock revisions tested: 2, total time: 23m50.482339937s (build: 16m46.695571451s, test: 6m28.123080303s) the crash still happens on HEAD commit msg: Linux 4.14.181 crash: possible deadlock in rtnl_lock 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): veth0_macvtap: link is not ready ====================================================== WARNING: possible circular locking dependency detected 4.14.181-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/7781 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 IPv6: ADDRCONF(NETDEV_UP): veth1_macvtap: link is not ready 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:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xef/0x14c0 kernel/locking/mutex.c:893 device veth0_macvtap entered promiscuous mode 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+0x46/0xbb -> #1 IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready (&table[i].mutex){+.+.}: lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3998 __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 device veth1_macvtap entered promiscuous mode 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:7206 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:8281 ip6gre_exit_net+0x394/0x570 net/ipv6/ip6_gre.c:1208 ops_exit_list.isra.7+0x8b/0x120 net/core/net_namespace.c:142 IPv6: ADDRCONF(NETDEV_UP): macsec0: link is not ready 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 IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready (rtnl_mutex){+.+.}: check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e94/0x4500 kernel/locking/lockdep.c:3491 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3998 __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 IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready 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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 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+0x46/0xbb other info that might help us debug this: Chain exists of: batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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.5/7781: #0: ( batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 &xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x37/0x370 net/netfilter/x_tables.c:1092 stack backtrace: CPU: 0 PID: 7781 Comm: syz-executor.5 Not tainted 4.14.181-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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e94/0x4500 kernel/locking/lockdep.c:3491 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3998 __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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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+0x46/0xbb RIP: 0033:0x45c429 RSP: 002b:00007fc88bf82c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fc88bf836d4 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 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): veth1_macvtap: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): macsec0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: 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 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 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 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 net_ratelimit: 22 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 IPVS: ftp: loaded support on port[0] = 21 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: 33 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