bisecting fixing commit since d7e78d08fa77acdea351c8f628f49ca9a0e1029a building syzkaller on abf9ba4fc75d9b29af15625d44dcfc1360fad3b7 testing commit d7e78d08fa77acdea351c8f628f49ca9a0e1029a with gcc (GCC) 8.1.0 kernel signature: 8f235e03b2cbd3d585d8ad9cf83ae939916e635f1409227b7bd69ca83b06ba0c all runs: crashed: possible deadlock in rtnl_lock testing current HEAD 1752938529c614a8ed4432ecce6ebc95d3b87207 testing commit 1752938529c614a8ed4432ecce6ebc95d3b87207 with gcc (GCC) 8.1.0 kernel signature: 9c4029832aa3c89d2d1c297a952e75ed13796a7f0788952ef5b9e949837a386d all runs: crashed: possible deadlock in rtnl_lock revisions tested: 2, total time: 22m7.765223205s (build: 16m18.692961567s, test: 5m20.468886178s) the crash still happens on HEAD commit msg: Linux 4.14.213 crash: possible deadlock in rtnl_lock IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready ====================================================== IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready WARNING: possible circular locking dependency detected 4.14.213-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/7179 is trying to acquire lock: (rtnl_mutex){+.+.}, at: [] rtnl_lock+0x12/0x20 net/core/rtnetlink.c:72 but task is already holding lock: batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 (&xt[i].mutex 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 , 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+0x17e/0x3e0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xed/0x1490 kernel/locking/mutex.c:893 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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/0x8d0 net/netfilter/nft_compat.c:678 nfnetlink_rcv_msg+0x872/0xa60 net/netfilter/nfnetlink.c:214 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 nfnetlink_rcv+0x176/0x15b0 net/netfilter/nfnetlink.c:515 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 netlink_sendmsg+0x657/0xc60 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! (&table[i].mutex){+.+.}: lock_acquire+0x17e/0x3e0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xed/0x1490 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:1667 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 call_netdevice_notifiers net/core/dev.c:1683 [inline] rollback_registered_many+0x652/0xb20 net/core/dev.c:7203 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:8285 ip6gre_exit_net+0x394/0x570 net/ipv6/ip6_gre.c:1212 ops_exit_list.isra.3+0x8b/0x120 net/core/net_namespace.c:142 cleanup_net+0x39d/0x7f0 net/core/net_namespace.c:484 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! -> #0 IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready ( batman_adv: batadv0: Interface activated: batadv_slave_0 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+0x32e8/0x42d0 kernel/locking/lockdep.c:3491 lock_acquire+0x17e/0x3e0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xed/0x1490 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:1630 tee_tg_destroy+0x52/0xa0 net/netfilter/xt_TEE.c:123 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 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:2994 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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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.2/7179: #0: ( batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 &xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x37/0x370 net/netfilter/x_tables.c:1092 stack backtrace: CPU: 0 PID: 7179 Comm: syz-executor.2 Not tainted 4.14.213-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 print_circular_bug.isra.17.cold.40+0x2e3/0x41e kernel/locking/lockdep.c:1258 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+0x32e8/0x42d0 kernel/locking/lockdep.c:3491 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! lock_acquire+0x17e/0x3e0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xed/0x1490 kernel/locking/mutex.c:893 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 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:1630 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! tee_tg_destroy+0x52/0xa0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x159/0x210 net/ipv4/netfilter/ip_tables.c:666 IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready __do_replace+0x38b/0x5d0 net/ipv4/netfilter/ip_tables.c:1086 batman_adv: batadv0: Interface activated: batadv_slave_1 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:2994 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:0x45d5b9 RSP: 002b:00007fb08333ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000002dd80 RCX: 000000000045d5b9 RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000118cf90 R08: 0000000000000408 R09: 0000000000000000 R10: 0000000020000080 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffe5495b73f R14: 00007fb08333b9c0 R15: 000000000118cf4c 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): 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): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready 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 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 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: 32 callbacks suppressed 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 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: 57 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