Warning: Permanently added '10.128.0.212' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 28.184127] ip_tables: iptables: counters copy to user failed while replacing table [ 28.279431] [ 28.281097] ====================================================== [ 28.287400] WARNING: possible circular locking dependency detected [ 28.293705] 4.14.232-syzkaller #0 Not tainted [ 28.298183] ------------------------------------------------------ [ 28.304495] syz-executor788/7974 is trying to acquire lock: [ 28.310188] (rtnl_mutex){+.+.}, at: [] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.319289] [ 28.319289] but task is already holding lock: [ 28.325248] (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 28.333560] [ 28.333560] which lock already depends on the new lock. [ 28.333560] [ 28.341850] [ 28.341850] the existing dependency chain (in reverse order) is: [ 28.349442] [ 28.349442] -> #2 (&xt[i].mutex){+.+.}: [ 28.354983] __mutex_lock+0xc4/0x1310 [ 28.359279] target_revfn+0x43/0x210 [ 28.363491] xt_find_revision+0x15e/0x1d0 [ 28.368134] nfnl_compat_get+0x1f7/0x870 [ 28.372694] nfnetlink_rcv_msg+0x9bb/0xc00 [ 28.377424] netlink_rcv_skb+0x125/0x390 [ 28.381977] nfnetlink_rcv+0x1ab/0x1da0 [ 28.386448] netlink_unicast+0x437/0x610 [ 28.391026] netlink_sendmsg+0x62e/0xb80 [ 28.395624] sock_sendmsg+0xb5/0x100 [ 28.399833] ___sys_sendmsg+0x6c8/0x800 [ 28.404302] __sys_sendmsg+0xa3/0x120 [ 28.408597] SyS_sendmsg+0x27/0x40 [ 28.412636] do_syscall_64+0x1d5/0x640 [ 28.417020] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.422706] [ 28.422706] -> #1 (&table[i].mutex){+.+.}: [ 28.428416] __mutex_lock+0xc4/0x1310 [ 28.432717] nf_tables_netdev_event+0x10d/0x4d0 [ 28.437882] notifier_call_chain+0x108/0x1a0 [ 28.442913] rollback_registered_many+0x765/0xba0 [ 28.448254] rollback_registered+0xca/0x170 [ 28.453069] unregister_netdevice_queue+0x1b4/0x360 [ 28.458608] __tun_detach+0xca2/0xf60 [ 28.462904] tun_chr_close+0x41/0x60 [ 28.467116] __fput+0x25f/0x7a0 [ 28.470889] task_work_run+0x11f/0x190 [ 28.475288] do_exit+0xa44/0x2850 [ 28.479235] do_group_exit+0x100/0x2e0 [ 28.483636] SyS_exit_group+0x19/0x20 [ 28.487940] do_syscall_64+0x1d5/0x640 [ 28.492331] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.498021] [ 28.498021] -> #0 (rtnl_mutex){+.+.}: [ 28.503290] lock_acquire+0x170/0x3f0 [ 28.507587] __mutex_lock+0xc4/0x1310 [ 28.511903] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.517607] tee_tg_destroy+0x5c/0xb0 [ 28.521907] cleanup_entry+0x1fd/0x2d0 [ 28.526304] __do_replace+0x38d/0x570 [ 28.530613] do_ipt_set_ctl+0x256/0x3a0 [ 28.535083] nf_setsockopt+0x5f/0xb0 [ 28.539291] ip_setsockopt+0x94/0xb0 [ 28.543520] sctp_setsockopt+0x12b/0x3d50 [ 28.548165] SyS_setsockopt+0x110/0x1e0 [ 28.552635] do_syscall_64+0x1d5/0x640 [ 28.557017] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.562698] [ 28.562698] other info that might help us debug this: [ 28.562698] [ 28.570812] Chain exists of: [ 28.570812] rtnl_mutex --> &table[i].mutex --> &xt[i].mutex [ 28.570812] [ 28.581017] Possible unsafe locking scenario: [ 28.581017] [ 28.587087] CPU0 CPU1 [ 28.591727] ---- ---- [ 28.596365] lock(&xt[i].mutex); [ 28.599808] lock(&table[i].mutex); [ 28.606115] lock(&xt[i].mutex); [ 28.612057] lock(rtnl_mutex); [ 28.615311] [ 28.615311] *** DEADLOCK *** [ 28.615311] [ 28.621344] 1 lock held by syz-executor788/7974: [ 28.626086] #0: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 28.634818] [ 28.634818] stack backtrace: [ 28.639325] CPU: 0 PID: 7974 Comm: syz-executor788 Not tainted 4.14.232-syzkaller #0 [ 28.647189] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.656536] Call Trace: [ 28.659111] dump_stack+0x1b2/0x281 [ 28.662716] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 28.668506] __lock_acquire+0x2e0e/0x3f20 [ 28.672632] ? lock_downgrade+0x740/0x740 [ 28.676756] ? trace_hardirqs_on+0x10/0x10 [ 28.680966] ? kernel_text_address+0xbd/0xf0 [ 28.685347] ? kernel_text_address+0xbd/0xf0 [ 28.689729] ? __kernel_text_address+0x9/0x30 [ 28.694201] ? unwind_get_return_address+0x51/0x90 [ 28.699106] lock_acquire+0x170/0x3f0 [ 28.702889] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.708229] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.713581] __mutex_lock+0xc4/0x1310 [ 28.717468] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.722808] ? __lock_acquire+0x5fc/0x3f20 [ 28.727017] ? trace_hardirqs_on+0x10/0x10 [ 28.731228] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.736579] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 28.742006] ? pcpu_next_fit_region.constprop.0+0x3a0/0x3a0 [ 28.747692] ? trace_hardirqs_on+0x10/0x10 [ 28.751903] ? free_percpu+0x23e/0x730 [ 28.755784] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.760950] ? register_netdevice_notifier+0x4d0/0x4d0 [ 28.766202] ? _raw_spin_unlock_irqrestore+0x66/0xe0 [ 28.771280] ? free_percpu+0x23e/0x730 [ 28.775144] tee_tg_destroy+0x5c/0xb0 [ 28.778920] ? tee_tg6+0x160/0x160 [ 28.782440] cleanup_entry+0x1fd/0x2d0 [ 28.786303] ? compat_do_ipt_get_ctl+0x7b0/0x7b0 [ 28.791051] __do_replace+0x38d/0x570 [ 28.794827] ? ipt_unregister_table+0x60/0x60 [ 28.799316] do_ipt_set_ctl+0x256/0x3a0 [ 28.803264] ? compat_do_ipt_set_ctl+0x140/0x140 [ 28.808027] ? trace_hardirqs_on+0x10/0x10 [ 28.812243] ? nf_sockopt_find.constprop.0+0x1ad/0x220 [ 28.817496] nf_setsockopt+0x5f/0xb0 [ 28.821302] ip_setsockopt+0x94/0xb0 [ 28.824994] sctp_setsockopt+0x12b/0x3d50 [ 28.829126] ? __fd_install+0x1ec/0x5c0 [ 28.833177] ? sctp_setsockopt_paddr_thresholds+0x390/0x390 [ 28.838862] ? lock_acquire+0x170/0x3f0 [ 28.842810] ? lock_downgrade+0x740/0x740 [ 28.846933] ? __fd_install+0x227/0x5c0 [ 28.850881] ? get_unused_fd_flags+0xc0/0xc0 [ 28.855268] ? sock_alloc_file+0x1ae/0x2e0 [ 28.859479] ? __fdget+0x167/0x1f0 [ 28.862993] ? sock_common_setsockopt+0x1e/0xb0 [ 28.867636] SyS_setsockopt+0x110/0x1e0 [ 28.871585] ? SyS_recv+0x40/0x40 [ 28.875015] ? do_syscall_64+0x4c/0x640 [ 28.878963] ? SyS_recv+0x40/0x40 [ 28.882391] do_syscall_64+0x1d5/0x640 [ 28.886273] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.891454] RIP: 0033:0x440199 [ 28.894620] RSP: 002b:00007fffeacaa118 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 [ 28.902300] RAX: ffffffffffffffda RBX: 00000030646e6f62 RCX: 0000000000440199 [ 28.909544] RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004 [ 28.916787] RBP: 0000000000000000 R08: 0000000000000358 R09: 00007fffeacaa2b8 [ 28.924034] R10: 0000000020000640 R11: 0000000000000246 R12: 00007fffeacaa12c [ 28.931279] R13: 431bde82d7b634db R14: 00000000004ae018 R15: 0000000000400488 [ 28.939094] ip_tables: iptables: counters copy to user failed while replacing table [ 29.006600] ip_tables: iptables: counters copy to user failed while replacing table [ 29.055809] ip_tables: iptables: counters copy to user failed while replacing table [ 29.126898] ip_tables: iptables: counters copy to user failed while replacing table [ 29.185858] ip_tables: iptables: counters copy to user failed while replacing table [ 29.236270] ip_tables: iptables: counters copy to user failed while replacing table [ 29.279411] ip_tables: iptables: counters copy to user failed while replacing table [ 29.326373] ip_tables: iptables: counters copy to user failed while replacing table [ 29.395774] ip_tables: iptables: counters copy to user failed while replacing table [ 33.222261] net_ratelimit: 73 callbacks suppressed [ 33.222264] ip_tables: iptables: counters copy to user failed while replacing table [ 33.292002] ip_tables: iptables: counters copy to user failed while replacing table [ 33.341385] ip_tables: iptables: counters copy to user failed while replacing table [ 33.391905] ip_tables: iptables: counters copy to user failed while replacing table [ 33.433688] ip_tables: iptables: counters copy to user failed while replacing table [ 33.491587] ip_tables: iptables: counters copy to user failed while replacing table [ 33.541954] ip_tables: iptables: counters copy to user failed while replacing table [ 33.601494] ip_tables: iptables: counters copy to user failed while replacing table [ 33.662619] ip_tables: iptables: counters copy to user failed while replacing table [ 33.721746] ip_tables: iptables: counters copy to user failed while replacing table