[ OK ] Started Getty on tty2. [ OK ] Started Getty on tty1. [ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... Starting Load/Save RF Kill Switch Status... [ OK ] Started Load/Save RF Kill Switch Status. [ OK ] Started Update UTMP about System Runlevel Changes. Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.241' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 27.637679] ip_tables: iptables: counters copy to user failed while replacing table executing program [ 27.719520] [ 27.721156] ====================================================== [ 27.727453] WARNING: possible circular locking dependency detected [ 27.733758] 4.14.259-syzkaller #0 Not tainted [ 27.738231] ------------------------------------------------------ [ 27.744528] syz-executor086/8035 is trying to acquire lock: [ 27.750216] (rtnl_mutex){+.+.}, at: [] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.759315] [ 27.759315] but task is already holding lock: [ 27.765269] (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 27.773665] [ 27.773665] which lock already depends on the new lock. [ 27.773665] [ 27.781952] [ 27.781952] the existing dependency chain (in reverse order) is: [ 27.789543] [ 27.789543] -> #2 (&xt[i].mutex){+.+.}: [ 27.794997] __mutex_lock+0xc4/0x1310 [ 27.799289] match_revfn+0x43/0x210 [ 27.803406] xt_find_revision+0x8d/0x1d0 [ 27.807962] nfnl_compat_get+0x1f7/0x870 [ 27.812515] nfnetlink_rcv_msg+0x9bb/0xc00 [ 27.817243] netlink_rcv_skb+0x125/0x390 [ 27.821795] nfnetlink_rcv+0x1ab/0x1da0 [ 27.826260] netlink_unicast+0x437/0x610 [ 27.830812] netlink_sendmsg+0x648/0xbc0 [ 27.835370] sock_sendmsg+0xb5/0x100 [ 27.839572] ___sys_sendmsg+0x6c8/0x800 [ 27.844041] __sys_sendmsg+0xa3/0x120 [ 27.848335] SyS_sendmsg+0x27/0x40 [ 27.852368] do_syscall_64+0x1d5/0x640 [ 27.856754] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.862434] [ 27.862434] -> #1 (&table[i].mutex){+.+.}: [ 27.868126] __mutex_lock+0xc4/0x1310 [ 27.872421] nf_tables_netdev_event+0x10d/0x4d0 [ 27.877585] notifier_call_chain+0x108/0x1a0 [ 27.882493] rollback_registered_many+0x765/0xba0 [ 27.887832] rollback_registered+0xca/0x170 [ 27.892911] unregister_netdevice_queue+0x1b4/0x360 [ 27.898506] __tun_detach+0xca2/0xf60 [ 27.902799] tun_chr_close+0x41/0x60 [ 27.907006] __fput+0x25f/0x7a0 [ 27.910779] task_work_run+0x11f/0x190 [ 27.915158] do_exit+0xa44/0x2850 [ 27.919101] do_group_exit+0x100/0x2e0 [ 27.923479] SyS_exit_group+0x19/0x20 [ 27.927780] do_syscall_64+0x1d5/0x640 [ 27.932250] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.937930] [ 27.937930] -> #0 (rtnl_mutex){+.+.}: [ 27.943185] lock_acquire+0x170/0x3f0 [ 27.947477] __mutex_lock+0xc4/0x1310 [ 27.951773] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.957572] tee_tg_destroy+0x5c/0xb0 [ 27.961870] cleanup_entry+0x1fd/0x2d0 [ 27.966249] __do_replace+0x38d/0x570 [ 27.970545] do_ipt_set_ctl+0x256/0x3a0 [ 27.975009] nf_setsockopt+0x5f/0xb0 [ 27.979212] ip_setsockopt+0x94/0xb0 [ 27.983419] udp_setsockopt+0x45/0x80 [ 27.987711] SyS_setsockopt+0x110/0x1e0 [ 27.992178] do_syscall_64+0x1d5/0x640 [ 27.996556] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.002232] [ 28.002232] other info that might help us debug this: [ 28.002232] [ 28.010344] Chain exists of: [ 28.010344] rtnl_mutex --> &table[i].mutex --> &xt[i].mutex [ 28.010344] [ 28.020551] Possible unsafe locking scenario: [ 28.020551] [ 28.026577] CPU0 CPU1 [ 28.031217] ---- ---- [ 28.035852] lock(&xt[i].mutex); [ 28.039277] lock(&table[i].mutex); [ 28.045478] lock(&xt[i].mutex); [ 28.051422] lock(rtnl_mutex); [ 28.054677] [ 28.054677] *** DEADLOCK *** [ 28.054677] [ 28.060706] 1 lock held by syz-executor086/8035: [ 28.065429] #0: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 28.074157] [ 28.074157] stack backtrace: [ 28.078715] CPU: 1 PID: 8035 Comm: syz-executor086 Not tainted 4.14.259-syzkaller #0 [ 28.086566] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.095892] Call Trace: [ 28.098473] dump_stack+0x1b2/0x281 [ 28.102082] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 28.107857] __lock_acquire+0x2e0e/0x3f20 [ 28.111982] ? trace_hardirqs_on+0x10/0x10 [ 28.116192] ? kernel_text_address+0xbd/0xf0 [ 28.120579] ? __lock_acquire+0x5fc/0x3f20 [ 28.124786] lock_acquire+0x170/0x3f0 [ 28.128563] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.133914] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.139258] __mutex_lock+0xc4/0x1310 [ 28.143042] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.148383] ? lock_acquire+0x170/0x3f0 [ 28.152328] ? recent_mt_destroy+0x163/0x5d0 [ 28.156710] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 28.162047] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 28.167472] ? __mutex_lock+0x360/0x1310 [ 28.171509] ? cleanup_entry+0x117/0x2d0 [ 28.175544] ? lock_downgrade+0x740/0x740 [ 28.179666] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.184829] ? __mutex_unlock_slowpath+0x75/0x770 [ 28.189643] ? register_netdevice_notifier+0x4d0/0x4d0 [ 28.194894] ? wait_for_completion_io+0x10/0x10 [ 28.199546] tee_tg_destroy+0x5c/0xb0 [ 28.203385] ? tee_tg6+0x160/0x160 [ 28.206898] cleanup_entry+0x1fd/0x2d0 [ 28.210761] ? compat_do_ipt_get_ctl+0x7b0/0x7b0 [ 28.215489] __do_replace+0x38d/0x570 [ 28.219264] ? ipt_unregister_table+0x60/0x60 [ 28.223733] do_ipt_set_ctl+0x256/0x3a0 [ 28.227682] ? compat_do_ipt_set_ctl+0x140/0x140 [ 28.232412] ? nf_sockopt_find.constprop.0+0x1ad/0x220 [ 28.237657] nf_setsockopt+0x5f/0xb0 [ 28.241348] ip_setsockopt+0x94/0xb0 [ 28.245043] udp_setsockopt+0x45/0x80 [ 28.248817] SyS_setsockopt+0x110/0x1e0 [ 28.252768] ? SyS_recv+0x40/0x40 [ 28.256196] ? do_syscall_64+0x4c/0x640 [ 28.260143] ? SyS_recv+0x40/0x40 [ 28.263573] do_syscall_64+0x1d5/0x640 [ 28.267437] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 28.272598] RIP: 0033:0x7fcbc08c8449 [ 28.276280] RSP: 002b:00007ffe10a75988 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 [ 28.283967] RAX: ffffffffffffffda RBX: 306e616c7663616d RCX: 00007fcbc08c8449 [ 28.291216] RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000004 [ 28.298460] RBP: 0000000000000000 R08: 0000000000000570 R09: 00007ffe10a75b28 [ 28.305707] R10: 00000000200000c0 R11: 0000000000000246 R12: 00007ffe10a7599c [ 28.312951] R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 [ 28.322366] ip_tables: iptables: counters copy to user failed while replacing table [ 28.396229] ip_tables: iptables: counters copy to user failed while replacing table [ 28.456362] ip_tables: iptables: counters copy to user failed while replacing table [ 28.506398] ip_tables: iptables: counters copy to user failed while replacing table [ 28.547316] ip_tables: iptables: counters copy to user failed while replacing table [ 28.605934] ip_tables: iptables: counters copy to user failed while replacing table [ 28.666097] ip_tables: iptables: counters copy to user failed while replacing table [ 28.746024] ip_tables: iptables: counters copy to user failed while replacing table [ 28.806042] ip_tables: iptables: counters copy to user failed while replacing table [ 32.664586] net_ratelimit: 77 callbacks suppressed [ 32.664589] ip_tables: iptables: counters copy to user failed while replacing table [ 32.734570] ip_tables: iptables: counters copy to user failed while replacing table [ 32.804183] ip_tables: iptables: counters copy to user failed while replacing table [ 32.863971] ip_tables: iptables: counters copy to user failed while replacing table [ 32.933987] ip_tables: iptables: counters copy to user failed while replacing table [ 32.993774] ip_tables: iptables: counters copy to user failed while replacing table [ 33.073113] ip_tables: iptables: counters copy to user failed while replacing table [ 33.143920] ip_tables: iptables: counters copy to user failed while replacing table [ 33.233649] ip_tables: iptables: counters copy to user failed while replacing table [ 33.302778] ip_tables: iptables: counters copy to user failed while replacing table [ 37.672124] net_ratelimit: 86 callbacks suppressed [ 37.672127] ip_tables: iptables: counters copy to user failed while replacing table