[ OK ] Reached target Login Prompts. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.87' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 28.929439] IPVS: ftp: loaded support on port[0] = 21 [ 28.967189] ip6_tables: ip6tables: counters copy to user failed while replacing table [ 28.976608] ip6_tables: ip6tables: counters copy to user failed while replacing table [ 28.991322] [ 28.992960] ====================================================== [ 28.999249] WARNING: possible circular locking dependency detected [ 29.005576] 4.14.231-syzkaller #0 Not tainted [ 29.010043] ------------------------------------------------------ [ 29.016331] syz-executor732/7985 is trying to acquire lock: [ 29.022012] (&table[i].mutex){+.+.}, at: [] nf_tables_netdev_event+0x10d/0x4d0 [ 29.031005] [ 29.031005] but task is already holding lock: [ 29.036986] (rtnl_mutex){+.+.}, at: [] tun_chr_close+0x34/0x60 [ 29.044597] [ 29.044597] which lock already depends on the new lock. [ 29.044597] [ 29.052927] [ 29.052927] the existing dependency chain (in reverse order) is: [ 29.060521] [ 29.060521] -> #2 (rtnl_mutex){+.+.}: [ 29.065791] __mutex_lock+0xc4/0x1310 [ 29.070124] unregister_netdevice_notifier+0x5e/0x2b0 [ 29.075824] tee_tg_destroy+0x5c/0xb0 [ 29.080119] cleanup_entry+0x232/0x310 [ 29.084499] __do_replace+0x38d/0x580 [ 29.088895] do_ip6t_set_ctl+0x256/0x3b0 [ 29.093448] nf_setsockopt+0x5f/0xb0 [ 29.097744] ipv6_setsockopt+0xc0/0x120 [ 29.102212] tcp_setsockopt+0x7b/0xc0 [ 29.106520] SyS_setsockopt+0x110/0x1e0 [ 29.110990] do_syscall_64+0x1d5/0x640 [ 29.115374] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.121074] [ 29.121074] -> #1 (&xt[i].mutex){+.+.}: [ 29.126505] __mutex_lock+0xc4/0x1310 [ 29.130815] target_revfn+0x43/0x210 [ 29.135021] xt_find_revision+0x15e/0x1d0 [ 29.139678] nfnl_compat_get+0x1f7/0x870 [ 29.144233] nfnetlink_rcv_msg+0x9bb/0xc00 [ 29.148963] netlink_rcv_skb+0x125/0x390 [ 29.153517] nfnetlink_rcv+0x1ab/0x1da0 [ 29.158001] netlink_unicast+0x437/0x610 [ 29.162558] netlink_sendmsg+0x62e/0xb80 [ 29.167111] sock_sendmsg+0xb5/0x100 [ 29.171320] ___sys_sendmsg+0x6c8/0x800 [ 29.175786] __sys_sendmsg+0xa3/0x120 [ 29.180097] SyS_sendmsg+0x27/0x40 [ 29.184133] do_syscall_64+0x1d5/0x640 [ 29.197473] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.203227] [ 29.203227] -> #0 (&table[i].mutex){+.+.}: [ 29.208963] lock_acquire+0x170/0x3f0 [ 29.213264] __mutex_lock+0xc4/0x1310 [ 29.217564] nf_tables_netdev_event+0x10d/0x4d0 [ 29.222748] notifier_call_chain+0x108/0x1a0 [ 29.227660] rollback_registered_many+0x765/0xba0 [ 29.232995] rollback_registered+0xca/0x170 [ 29.237854] unregister_netdevice_queue+0x1b4/0x360 [ 29.243613] __tun_detach+0xca2/0xf60 [ 29.247908] tun_chr_close+0x41/0x60 [ 29.252115] __fput+0x25f/0x7a0 [ 29.255919] task_work_run+0x11f/0x190 [ 29.260357] do_exit+0xa44/0x2850 [ 29.264315] do_group_exit+0x100/0x2e0 [ 29.268703] get_signal+0x38d/0x1ca0 [ 29.273102] do_signal+0x7c/0x1550 [ 29.277235] exit_to_usermode_loop+0x160/0x200 [ 29.282311] do_syscall_64+0x4a3/0x640 [ 29.286703] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.292399] [ 29.292399] other info that might help us debug this: [ 29.292399] [ 29.300534] Chain exists of: [ 29.300534] &table[i].mutex --> &xt[i].mutex --> rtnl_mutex [ 29.300534] [ 29.310753] Possible unsafe locking scenario: [ 29.310753] [ 29.316794] CPU0 CPU1 [ 29.321433] ---- ---- [ 29.326071] lock(rtnl_mutex); [ 29.329342] lock(&xt[i].mutex); [ 29.335287] lock(rtnl_mutex); [ 29.341070] lock(&table[i].mutex); [ 29.344756] [ 29.344756] *** DEADLOCK *** [ 29.344756] [ 29.350787] 1 lock held by syz-executor732/7985: [ 29.355512] #0: (rtnl_mutex){+.+.}, at: [] tun_chr_close+0x34/0x60 [ 29.363545] [ 29.363545] stack backtrace: [ 29.368029] CPU: 1 PID: 7985 Comm: syz-executor732 Not tainted 4.14.231-syzkaller #0 [ 29.375902] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.385242] Call Trace: [ 29.387824] dump_stack+0x1b2/0x281 [ 29.391428] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 29.397202] __lock_acquire+0x2e0e/0x3f20 [ 29.401410] ? lock_downgrade+0x740/0x740 [ 29.405532] ? unwind_next_frame+0xe54/0x17d0 [ 29.410001] ? trace_hardirqs_on+0x10/0x10 [ 29.414211] ? kernel_text_address+0xbd/0xf0 [ 29.418592] ? __kernel_text_address+0x9/0x30 [ 29.423061] ? unwind_get_return_address+0x51/0x90 [ 29.428012] lock_acquire+0x170/0x3f0 [ 29.431801] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.436626] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.441449] __mutex_lock+0xc4/0x1310 [ 29.445223] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.450076] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.454892] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 29.460356] ? trace_hardirqs_on+0x10/0x10 [ 29.464566] ? trace_hardirqs_on_caller+0x3a8/0x580 [ 29.469694] ? lock_downgrade+0x740/0x740 [ 29.473817] nf_tables_netdev_event+0x10d/0x4d0 [ 29.478490] ? mirred_device_event+0x12f/0x170 [ 29.483045] ? nf_tables_netdev_init_net+0x140/0x140 [ 29.488123] ? mirred_device_event+0x12f/0x170 [ 29.492679] ? __local_bh_enable_ip+0xc1/0x170 [ 29.497235] notifier_call_chain+0x108/0x1a0 [ 29.501619] rollback_registered_many+0x765/0xba0 [ 29.506441] ? netdev_state_change+0xf0/0xf0 [ 29.510824] ? queue_delayed_work_on+0x114/0x1d0 [ 29.515554] rollback_registered+0xca/0x170 [ 29.519850] ? rollback_registered_many+0xba0/0xba0 [ 29.524840] ? linkwatch_schedule_work+0xe5/0x110 [ 29.529656] unregister_netdevice_queue+0x1b4/0x360 [ 29.534644] __tun_detach+0xca2/0xf60 [ 29.538419] ? tun_recvmsg+0x3b0/0x3b0 [ 29.542291] tun_chr_close+0x41/0x60 [ 29.545998] __fput+0x25f/0x7a0 [ 29.549256] task_work_run+0x11f/0x190 [ 29.553119] do_exit+0xa44/0x2850 [ 29.556568] ? futex_lock_pi_atomic+0x2e0/0x2e0 [ 29.561224] ? kernel_recvmsg+0x210/0x210 [ 29.565349] ? hash_futex+0x12/0x200 [ 29.569037] ? mm_update_next_owner+0x5b0/0x5b0 [ 29.573679] ? get_signal+0x323/0x1ca0 [ 29.577543] ? lock_acquire+0x170/0x3f0 [ 29.581512] ? lock_downgrade+0x740/0x740 [ 29.585636] do_group_exit+0x100/0x2e0 [ 29.589496] get_signal+0x38d/0x1ca0 [ 29.593209] ? do_futex+0x12b/0x1570 [ 29.596912] ? __fget+0x1fe/0x360 [ 29.600341] do_signal+0x7c/0x1550 [ 29.603863] ? __fget+0x225/0x360 [ 29.607291] ? setup_sigcontext+0x820/0x820 [ 29.611586] ? __fdget+0x196/0x1f0 [ 29.615273] ? sockfd_lookup_light+0xb2/0x160 [ 29.619766] ? fput+0xb/0x140 [ 29.622843] ? __sys_sendmsg+0xb6/0x120 [ 29.626792] ? SyS_futex+0x1da/0x290 [ 29.630489] ? SyS_futex+0x1e3/0x290 [ 29.634177] ? exit_to_usermode_loop+0x41/0x200 [ 29.638820] exit_to_usermode_loop+0x160/0x200 [ 29.643483] do_syscall_64+0x4a3/0x640 [ 29.647345] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.652524] RIP: 0033:0x4471c9 [ 29.655703] RSP: 002b:00007f610d0212f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca [ 29.663394] RAX: fffffffffffffe00 RBX: 00000000004cc4f0 RCX: 00000000004471c9 [ 29.670647] RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000004cc4f8 [ 29.678001] RBP: 00000000004cc4fc R08: 00000000000000