Warning: Permanently added '10.128.1.47' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 27.625980] ip_tables: iptables: counters copy to user failed while replacing table [ 27.721923] [ 27.723640] ====================================================== [ 27.729931] WARNING: possible circular locking dependency detected [ 27.736228] 4.14.274-syzkaller #0 Not tainted [ 27.740741] ------------------------------------------------------ [ 27.747290] syz-executor391/7985 is trying to acquire lock: [ 27.752972] (rtnl_mutex){+.+.}, at: [] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.762066] [ 27.762066] but task is already holding lock: [ 27.768021] (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 27.776319] [ 27.776319] which lock already depends on the new lock. [ 27.776319] [ 27.784617] [ 27.784617] the existing dependency chain (in reverse order) is: [ 27.792209] [ 27.792209] -> #2 (&xt[i].mutex){+.+.}: [ 27.798091] __mutex_lock+0xc4/0x1310 [ 27.802394] match_revfn+0x43/0x210 [ 27.806514] xt_find_revision+0x8d/0x1d0 [ 27.811068] nfnl_compat_get+0x1f7/0x870 [ 27.815624] nfnetlink_rcv_msg+0x9bb/0xc00 [ 27.820353] netlink_rcv_skb+0x125/0x390 [ 27.824916] nfnetlink_rcv+0x1ab/0x1da0 [ 27.829397] netlink_unicast+0x437/0x610 [ 27.833954] netlink_sendmsg+0x648/0xbc0 [ 27.838527] sock_sendmsg+0xb5/0x100 [ 27.842776] ___sys_sendmsg+0x6c8/0x800 [ 27.847277] __sys_sendmsg+0xa3/0x120 [ 27.851579] SyS_sendmsg+0x27/0x40 [ 27.855638] do_syscall_64+0x1d5/0x640 [ 27.860024] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.865706] [ 27.865706] -> #1 (&table[i].mutex){+.+.}: [ 27.871401] __mutex_lock+0xc4/0x1310 [ 27.875699] nf_tables_netdev_event+0x10d/0x4d0 [ 27.880871] notifier_call_chain+0x108/0x1a0 [ 27.885775] rollback_registered_many+0x765/0xba0 [ 27.891110] rollback_registered+0xca/0x170 [ 27.895927] unregister_netdevice_queue+0x1b4/0x360 [ 27.901439] ppp_release+0x177/0x1a0 [ 27.905663] __fput+0x25f/0x7a0 [ 27.909440] task_work_run+0x11f/0x190 [ 27.913822] do_exit+0xa44/0x2850 [ 27.917785] do_group_exit+0x100/0x2e0 [ 27.922182] SyS_exit_group+0x19/0x20 [ 27.926498] do_syscall_64+0x1d5/0x640 [ 27.930901] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.936583] [ 27.936583] -> #0 (rtnl_mutex){+.+.}: [ 27.941844] lock_acquire+0x170/0x3f0 [ 27.946141] __mutex_lock+0xc4/0x1310 [ 27.950436] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.956232] tee_tg_destroy+0x5c/0xb0 [ 27.960549] cleanup_entry+0x1fd/0x2d0 [ 27.964934] __do_replace+0x38d/0x570 [ 27.969247] do_ipt_set_ctl+0x256/0x3a0 [ 27.973714] nf_setsockopt+0x5f/0xb0 [ 27.977922] ip_setsockopt+0x94/0xb0 [ 27.982137] udp_setsockopt+0x45/0x80 [ 27.986436] SyS_setsockopt+0x110/0x1e0 [ 27.990907] do_syscall_64+0x1d5/0x640 [ 27.995305] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.001003] [ 28.001003] other info that might help us debug this: [ 28.001003] [ 28.009134] Chain exists of: [ 28.009134] rtnl_mutex --> &table[i].mutex --> &xt[i].mutex [ 28.009134] [ 28.019339] Possible unsafe locking scenario: [ 28.019339] [ 28.025369] CPU0 CPU1 [ 28.030028] ---- ---- [ 28.034665] lock(&xt[i].mutex); [ 28.038091] lock(&table[i].mutex); [ 28.044298] lock(&xt[i].mutex); [ 28.050240] lock(rtnl_mutex); [ 28.053492] [ 28.053492] *** DEADLOCK *** [ 28.053492] [ 28.059523] 1 lock held by syz-executor391/7985: [ 28.064266] #0: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 28.072997] [ 28.072997] stack backtrace: [ 28.077467] CPU: 0 PID: 7985 Comm: syz-executor391 Not tainted 4.14.274-syzkaller #0 [ 28.085318] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.094665] Call Trace: [ 28.097408] dump_stack+0x1b2/0x281 [ 28.101014] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 28.106786] __lock_acquire+0x2e0e/0x3f20 [ 28.110909] ? lock_downgrade+0x740/0x740 [ 28.115131] ? trace_hardirqs_on+0x10/0x10 [ 28.119340] ? kernel_text_address+0xbd/0xf0 [ 28.123723] ? __lock_acquire+0x5fc/0x3f20 [ 28.127930] ? __kernel_text_address+0x9/0x30 [ 28.132418] lock_acquire+0x170/0x3f0 [ 28.136213] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.141562] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.146902] __mutex_lock+0xc4/0x1310 [ 28.150678] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.156027] ? __lock_acquire+0x5fc/0x3f20 [ 28.160241] ? trace_hardirqs_on+0x10/0x10 [ 28.164455] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.169803] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 28.175228] ? pcpu_next_fit_region.constprop.0+0x3a0/0x3a0 [ 28.180915] ? trace_hardirqs_on+0x10/0x10 [ 28.185121] ? free_percpu+0x23e/0x730 [ 28.188983] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.194151] ? register_netdevice_notifier+0x4d0/0x4d0 [ 28.199749] ? _raw_spin_unlock_irqrestore+0x66/0xe0 [ 28.204824] ? free_percpu+0x23e/0x730 [ 28.208689] tee_tg_destroy+0x5c/0xb0 [ 28.212469] ? tee_tg6+0x160/0x160 [ 28.215982] cleanup_entry+0x1fd/0x2d0 [ 28.219862] ? cpumask_next+0x30/0x40 [ 28.223638] ? compat_do_ipt_get_ctl+0x7b0/0x7b0 [ 28.228384] __do_replace+0x38d/0x570 [ 28.232163] ? ipt_unregister_table+0x60/0x60 [ 28.236630] do_ipt_set_ctl+0x256/0x3a0 [ 28.240576] ? compat_do_ipt_set_ctl+0x140/0x140 [ 28.245308] ? nf_sockopt_find.constprop.0+0x1ad/0x220 [ 28.250559] nf_setsockopt+0x5f/0xb0 [ 28.254249] ip_setsockopt+0x94/0xb0 [ 28.257937] udp_setsockopt+0x45/0x80 [ 28.261736] SyS_setsockopt+0x110/0x1e0 [ 28.265685] ? SyS_recv+0x40/0x40 [ 28.269114] ? up_read+0x17/0x30 [ 28.272465] ? __do_page_fault+0x159/0xad0 [ 28.276678] ? do_syscall_64+0x4c/0x640 [ 28.280688] ? SyS_recv+0x40/0x40 [ 28.284116] do_syscall_64+0x1d5/0x640 [ 28.287979] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.293159] RIP: 0033:0x7f3609362449 [ 28.296866] RSP: 002b:00007ffec842a358 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 [ 28.304548] RAX: ffffffffffffffda RBX: 0000003065736f72 RCX: 00007f3609362449 [ 28.311792] RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003 [ 28.319035] RBP: 0000000000000000 R08: 00000000000002e0 R09: 00007ffec842a4f8 [ 28.326279] R10: 0000000020000100 R11: 0000000000000246 R12: 00007ffec842a36c [ 28.333521] R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 [ 28.341640] ip_tables: iptables: counters copy to user failed while replacing table [ 28.409641] ip_tables: iptables: counters copy to user failed while replacing table [ 28.450277] ip_tables: iptables: counters copy to user failed while replacing table [ 28.499869] ip_tables: iptables: counters copy to user failed while replacing table [ 28.569326] ip_tables: iptables: counters copy to user failed while replacing table [ 28.619925] ip_tables: iptables: counters copy to user failed while replacing table [ 28.669675] ip_tables: iptables: counters copy to user failed while replacing table [ 28.729319] ip_tables: iptables: counters copy to user failed while replacing table [ 28.799028] ip_tables: iptables: counters copy to user failed while replacing table [ 32.625593] net_ratelimit: 66 callbacks suppressed [ 32.625595] ip_tables: iptables: counters copy to user failed while replacing table [ 32.705782] ip_tables: iptables: counters copy to user failed while replacing table [ 32.755838] ip_tables: iptables: counters copy to user failed while replacing table [ 32.826100] ip_tables: iptables: counters copy to user failed while replacing table [ 32.885715] ip_tables: iptables: counters copy to user failed while replacing table [ 32.935960] ip_tables: iptables: counters copy to user failed while replacing table [ 32.985354] ip_tables: iptables: counters copy to user failed while replacing table [ 33.045990] ip_tables: iptables: counters copy to user failed while replacing table [ 33.106410] ip_tables: iptables: counters copy to user failed while replacing table [ 33.186015] ip_tables: iptables: counters copy to user failed while replacing table [ 37.692100] net_ratelimit: 85 callbacks suppressed [ 37.692102] ip_tables: iptables: counters copy to user failed while replacing table