[ 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.162' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 26.979392] ip_tables: iptables: counters copy to user failed while replacing table executing program [ 27.072542] [ 27.074182] ====================================================== [ 27.080482] WARNING: possible circular locking dependency detected [ 27.086788] 4.14.264-syzkaller #0 Not tainted [ 27.091265] ------------------------------------------------------ [ 27.097571] syz-executor179/7961 is trying to acquire lock: [ 27.103275] (rtnl_mutex){+.+.}, at: [] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.112381] [ 27.112381] but task is already holding lock: [ 27.118336] (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 27.126654] [ 27.126654] which lock already depends on the new lock. [ 27.126654] [ 27.134955] [ 27.134955] the existing dependency chain (in reverse order) is: [ 27.142546] [ 27.142546] -> #2 (&xt[i].mutex){+.+.}: [ 27.147978] __mutex_lock+0xc4/0x1310 [ 27.152274] match_revfn+0x43/0x210 [ 27.156390] xt_find_revision+0x8d/0x1d0 [ 27.160941] nfnl_compat_get+0x1f7/0x870 [ 27.165494] nfnetlink_rcv_msg+0x9bb/0xc00 [ 27.170218] netlink_rcv_skb+0x125/0x390 [ 27.174769] nfnetlink_rcv+0x1ab/0x1da0 [ 27.179253] netlink_unicast+0x437/0x610 [ 27.183804] netlink_sendmsg+0x648/0xbc0 [ 27.188406] sock_sendmsg+0xb5/0x100 [ 27.192614] ___sys_sendmsg+0x6c8/0x800 [ 27.197095] __sys_sendmsg+0xa3/0x120 [ 27.201409] SyS_sendmsg+0x27/0x40 [ 27.205445] do_syscall_64+0x1d5/0x640 [ 27.209830] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.215506] [ 27.215506] -> #1 (&table[i].mutex){+.+.}: [ 27.221202] __mutex_lock+0xc4/0x1310 [ 27.225498] nf_tables_netdev_event+0x10d/0x4d0 [ 27.230658] notifier_call_chain+0x108/0x1a0 [ 27.235571] rollback_registered_many+0x765/0xba0 [ 27.240906] rollback_registered+0xca/0x170 [ 27.245729] register_netdevice+0xbb5/0xe40 [ 27.250545] ip_tunnel_newlink+0x368/0x820 [ 27.255294] ipgre_newlink+0xe7/0x130 [ 27.259598] rtnl_newlink+0xfab/0x1860 [ 27.263990] rtnetlink_rcv_msg+0x3be/0xb10 [ 27.268730] netlink_rcv_skb+0x125/0x390 [ 27.273305] netlink_unicast+0x437/0x610 [ 27.277861] netlink_sendmsg+0x648/0xbc0 [ 27.282432] sock_sendmsg+0xb5/0x100 [ 27.286640] ___sys_sendmsg+0x6c8/0x800 [ 27.291110] __sys_sendmsg+0xa3/0x120 [ 27.295422] SyS_sendmsg+0x27/0x40 [ 27.299459] do_syscall_64+0x1d5/0x640 [ 27.303843] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.309523] [ 27.309523] -> #0 (rtnl_mutex){+.+.}: [ 27.314783] lock_acquire+0x170/0x3f0 [ 27.319078] __mutex_lock+0xc4/0x1310 [ 27.323373] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.329068] tee_tg_destroy+0x5c/0xb0 [ 27.333362] cleanup_entry+0x1fd/0x2d0 [ 27.337741] __do_replace+0x38d/0x570 [ 27.342038] do_ipt_set_ctl+0x256/0x3a0 [ 27.346517] nf_setsockopt+0x5f/0xb0 [ 27.350721] ip_setsockopt+0x94/0xb0 [ 27.354926] udp_setsockopt+0x45/0x80 [ 27.359221] SyS_setsockopt+0x110/0x1e0 [ 27.363686] do_syscall_64+0x1d5/0x640 [ 27.368065] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.373741] [ 27.373741] other info that might help us debug this: [ 27.373741] [ 27.381869] Chain exists of: [ 27.381869] rtnl_mutex --> &table[i].mutex --> &xt[i].mutex [ 27.381869] [ 27.392069] Possible unsafe locking scenario: [ 27.392069] [ 27.398096] CPU0 CPU1 [ 27.402731] ---- ---- [ 27.407364] lock(&xt[i].mutex); [ 27.410787] lock(&table[i].mutex); [ 27.416989] lock(&xt[i].mutex); [ 27.422934] lock(rtnl_mutex); [ 27.426192] [ 27.426192] *** DEADLOCK *** [ 27.426192] [ 27.432229] 1 lock held by syz-executor179/7961: [ 27.436955] #0: (&xt[i].mutex){+.+.}, at: [] xt_find_table_lock+0x38/0x3d0 [ 27.445697] [ 27.445697] stack backtrace: [ 27.450164] CPU: 1 PID: 7961 Comm: syz-executor179 Not tainted 4.14.264-syzkaller #0 [ 27.458026] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 27.467349] Call Trace: [ 27.469914] dump_stack+0x1b2/0x281 [ 27.473528] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 27.479300] __lock_acquire+0x2e0e/0x3f20 [ 27.483422] ? trace_hardirqs_on+0x10/0x10 [ 27.487630] ? kernel_text_address+0xbd/0xf0 [ 27.492010] ? __lock_acquire+0x5fc/0x3f20 [ 27.496226] lock_acquire+0x170/0x3f0 [ 27.499998] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 27.505340] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 27.510674] __mutex_lock+0xc4/0x1310 [ 27.514447] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 27.519781] ? lock_acquire+0x170/0x3f0 [ 27.523740] ? recent_mt_destroy+0x163/0x5d0 [ 27.528120] ? unregister_netdevice_notifier+0x5e/0x2b0 [ 27.533455] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 27.538884] ? __mutex_lock+0x360/0x1310 [ 27.542917] ? cleanup_entry+0x117/0x2d0 [ 27.546949] ? lock_downgrade+0x740/0x740 [ 27.551067] unregister_netdevice_notifier+0x5e/0x2b0 [ 27.556233] ? __mutex_unlock_slowpath+0x75/0x770 [ 27.561048] ? register_netdevice_notifier+0x4d0/0x4d0 [ 27.566296] ? wait_for_completion_io+0x10/0x10 [ 27.570937] tee_tg_destroy+0x5c/0xb0 [ 27.574711] ? tee_tg6+0x160/0x160 [ 27.578226] cleanup_entry+0x1fd/0x2d0 [ 27.582100] ? compat_do_ipt_get_ctl+0x7b0/0x7b0 [ 27.586826] __do_replace+0x38d/0x570 [ 27.590598] ? ipt_unregister_table+0x60/0x60 [ 27.595065] do_ipt_set_ctl+0x256/0x3a0 [ 27.599022] ? compat_do_ipt_set_ctl+0x140/0x140 [ 27.603760] ? nf_sockopt_find.constprop.0+0x1ad/0x220 [ 27.609009] nf_setsockopt+0x5f/0xb0 [ 27.612693] ip_setsockopt+0x94/0xb0 [ 27.616380] udp_setsockopt+0x45/0x80 [ 27.620153] SyS_setsockopt+0x110/0x1e0 [ 27.624099] ? SyS_recv+0x40/0x40 [ 27.627526] ? up_read+0x17/0x30 [ 27.630952] ? __do_page_fault+0x159/0xad0 [ 27.635156] ? do_syscall_64+0x4c/0x640 [ 27.639099] ? SyS_recv+0x40/0x40 [ 27.642525] do_syscall_64+0x1d5/0x640 [ 27.646385] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 27.651546] RIP: 0033:0x7f85ebbf0739 [ 27.655229] RSP: 002b:00007ffe317e2078 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 [ 27.662909] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f85ebbf0739 executing program [ 27.670171] RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003 [ 27.677413] RBP: 00007ffe317e20a0 R08: 0000000000000538 R09: 0000000000000000 [ 27.684652] R10: 0000000020000f00 R11: 0000000000000246 R12: 00007ffe317e208c [ 27.691892] R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 [ 27.700160] ip_tables: iptables: counters copy to user failed while replacing table executing program [ 27.738873] ip_tables: iptables: counters copy to user failed while replacing table [ 27.781095] ip_tables: iptables: counters copy to user failed while replacing table [ 27.848663] ip_tables: iptables: counters copy to user failed while replacing table [ 27.908106] ip_tables: iptables: counters copy to user failed while replacing table [ 27.938165] ip_tables: iptables: counters copy to user failed while replacing table [ 28.010705] ip_tables: iptables: counters copy to user failed while replacing table [ 28.068943] ip_tables: iptables: counters copy to user failed while replacing table [ 28.119055] ip_tables: iptables: counters copy to user failed while replacing table [ 32.017687] net_ratelimit: 70 callbacks suppressed [ 32.017691] ip_tables: iptables: counters copy to user failed while replacing table [ 32.076729] ip_tables: iptables: counters copy to user failed while replacing table [ 32.127552] ip_tables: iptables: counters copy to user failed while replacing table [ 32.207430] ip_tables: iptables: counters copy to user failed while replacing table [ 32.276977] ip_tables: iptables: counters copy to user failed while replacing table [ 32.326724] ip_tables: iptables: counters copy to user failed while replacing table [ 32.421784] ip_tables: iptables: counters copy to user failed while replacing table [ 32.476072] ip_tables: iptables: counters copy to user failed while replacing table [ 32.535383] ip_tables: iptables: counters copy to user failed while replacing table [ 32.578508] ip_tables: iptables: counters copy to user failed while replacing table [ 37.058948] net_ratelimit: 83 callbacks suppressed [ 37.058951] ip_tables: iptables: counters copy to user failed while replacing table