Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.1.16' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 28.842010] IPVS: ftp: loaded support on port[0] = 21 [ 28.879758] ip6_tables: ip6tables: counters copy to user failed while replacing table [ 28.889009] ip6_tables: ip6tables: counters copy to user failed while replacing table [ 28.904516] [ 28.906162] ====================================================== [ 28.912450] WARNING: possible circular locking dependency detected [ 28.918737] 4.14.226-syzkaller #0 Not tainted [ 28.923223] ------------------------------------------------------ [ 28.929510] syz-executor294/7997 is trying to acquire lock: [ 28.935188] (&table[i].mutex){+.+.}, at: [] nf_tables_netdev_event+0x10d/0x4d0 [ 28.944176] [ 28.944176] but task is already holding lock: [ 28.950131] (rtnl_mutex){+.+.}, at: [] tun_chr_close+0x34/0x60 [ 28.957743] [ 28.957743] which lock already depends on the new lock. [ 28.957743] [ 28.966032] [ 28.966032] the existing dependency chain (in reverse order) is: [ 28.973626] [ 28.973626] -> #2 (rtnl_mutex){+.+.}: [ 28.978888] __mutex_lock+0xc4/0x1310 [ 28.983188] unregister_netdevice_notifier+0x5e/0x2b0 [ 28.988872] tee_tg_destroy+0x5c/0xb0 [ 28.993180] cleanup_entry+0x232/0x310 [ 28.997559] __do_replace+0x38d/0x580 [ 29.001858] do_ip6t_set_ctl+0x256/0x3b0 [ 29.006426] nf_setsockopt+0x5f/0xb0 [ 29.010634] ipv6_setsockopt+0xc0/0x120 [ 29.015099] tcp_setsockopt+0x7b/0xc0 [ 29.019394] SyS_setsockopt+0x110/0x1e0 [ 29.023863] do_syscall_64+0x1d5/0x640 [ 29.028272] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.033954] [ 29.033954] -> #1 (&xt[i].mutex){+.+.}: [ 29.039386] __mutex_lock+0xc4/0x1310 [ 29.043679] target_revfn+0x43/0x210 [ 29.047899] xt_find_revision+0x15e/0x1d0 [ 29.052552] nfnl_compat_get+0x1f7/0x870 [ 29.057105] nfnetlink_rcv_msg+0x9bb/0xc00 [ 29.061834] netlink_rcv_skb+0x125/0x390 [ 29.066409] nfnetlink_rcv+0x1ab/0x1da0 [ 29.070875] netlink_unicast+0x437/0x610 [ 29.075427] netlink_sendmsg+0x62e/0xb80 [ 29.079983] sock_sendmsg+0xb5/0x100 [ 29.084203] ___sys_sendmsg+0x6c8/0x800 [ 29.088671] __sys_sendmsg+0xa3/0x120 [ 29.092965] SyS_sendmsg+0x27/0x40 [ 29.097015] do_syscall_64+0x1d5/0x640 [ 29.101399] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.107077] [ 29.107077] -> #0 (&table[i].mutex){+.+.}: [ 29.112781] lock_acquire+0x170/0x3f0 [ 29.117074] __mutex_lock+0xc4/0x1310 [ 29.121380] nf_tables_netdev_event+0x10d/0x4d0 [ 29.126558] notifier_call_chain+0x108/0x1a0 [ 29.131460] rollback_registered_many+0x765/0xba0 [ 29.136809] rollback_registered+0xca/0x170 [ 29.141640] unregister_netdevice_queue+0x1b4/0x360 [ 29.147162] __tun_detach+0xca2/0xf60 [ 29.151456] tun_chr_close+0x41/0x60 [ 29.155664] __fput+0x25f/0x7a0 [ 29.159452] task_work_run+0x11f/0x190 [ 29.163856] do_exit+0xa44/0x2850 [ 29.167801] do_group_exit+0x100/0x2e0 [ 29.172195] get_signal+0x38d/0x1ca0 [ 29.176400] do_signal+0x7c/0x1550 [ 29.180434] exit_to_usermode_loop+0x160/0x200 [ 29.185507] do_syscall_64+0x4a3/0x640 [ 29.189891] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.195585] [ 29.195585] other info that might help us debug this: [ 29.195585] [ 29.203696] Chain exists of: [ 29.203696] &table[i].mutex --> &xt[i].mutex --> rtnl_mutex [ 29.203696] [ 29.213899] Possible unsafe locking scenario: [ 29.213899] [ 29.219927] CPU0 CPU1 [ 29.224577] ---- ---- [ 29.229227] lock(rtnl_mutex); [ 29.232475] lock(&xt[i].mutex); [ 29.238416] lock(rtnl_mutex); [ 29.244183] lock(&table[i].mutex); [ 29.247867] [ 29.247867] *** DEADLOCK *** [ 29.247867] [ 29.253897] 1 lock held by syz-executor294/7997: [ 29.258618] #0: (rtnl_mutex){+.+.}, at: [] tun_chr_close+0x34/0x60 [ 29.266655] [ 29.266655] stack backtrace: [ 29.271125] CPU: 0 PID: 7997 Comm: syz-executor294 Not tainted 4.14.226-syzkaller #0 [ 29.278976] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.288318] Call Trace: [ 29.290883] dump_stack+0x1b2/0x281 [ 29.294489] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 29.300277] __lock_acquire+0x2e0e/0x3f20 [ 29.304415] ? lock_downgrade+0x740/0x740 [ 29.308535] ? unwind_next_frame+0xe54/0x17d0 [ 29.313004] ? trace_hardirqs_on+0x10/0x10 [ 29.317227] ? kernel_text_address+0xbd/0xf0 [ 29.321608] ? __kernel_text_address+0x9/0x30 [ 29.326087] ? unwind_get_return_address+0x51/0x90 [ 29.330991] lock_acquire+0x170/0x3f0 [ 29.334770] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.339588] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.344403] __mutex_lock+0xc4/0x1310 [ 29.348176] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.353007] ? nf_tables_netdev_event+0x10d/0x4d0 [ 29.357829] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 29.363263] ? trace_hardirqs_on+0x10/0x10 [ 29.367473] ? trace_hardirqs_on_caller+0x3a8/0x580 [ 29.372468] ? lock_downgrade+0x740/0x740 [ 29.376595] nf_tables_netdev_event+0x10d/0x4d0 [ 29.381239] ? mirred_device_event+0x12f/0x170 [ 29.385792] ? nf_tables_netdev_init_net+0x140/0x140 [ 29.390868] ? mirred_device_event+0x12f/0x170 [ 29.395423] ? __local_bh_enable_ip+0xc1/0x170 [ 29.399994] notifier_call_chain+0x108/0x1a0 [ 29.404377] rollback_registered_many+0x765/0xba0 [ 29.409195] ? netdev_state_change+0xf0/0xf0 [ 29.413580] ? queue_delayed_work_on+0x114/0x1d0 [ 29.418320] rollback_registered+0xca/0x170 [ 29.422616] ? rollback_registered_many+0xba0/0xba0 [ 29.427621] ? linkwatch_schedule_work+0xe5/0x110 [ 29.432436] unregister_netdevice_queue+0x1b4/0x360 [ 29.437428] __tun_detach+0xca2/0xf60 [ 29.441207] ? tun_recvmsg+0x3b0/0x3b0 [ 29.445066] tun_chr_close+0x41/0x60 [ 29.448759] __fput+0x25f/0x7a0 [ 29.452022] task_work_run+0x11f/0x190 [ 29.455890] do_exit+0xa44/0x2850 [ 29.459385] ? futex_lock_pi_atomic+0x2e0/0x2e0 [ 29.464050] ? hash_futex+0x12/0x200 [ 29.467739] ? mm_update_next_owner+0x5b0/0x5b0 [ 29.472382] ? get_signal+0x323/0x1ca0 [ 29.476241] ? lock_acquire+0x170/0x3f0 [ 29.480205] ? lock_downgrade+0x740/0x740 [ 29.484326] do_group_exit+0x100/0x2e0 [ 29.488202] get_signal+0x38d/0x1ca0 [ 29.491890] ? do_futex+0x12b/0x1570 [ 29.495597] ? ip6t_unregister_table+0x60/0x60 [ 29.500153] do_signal+0x7c/0x1550 [ 29.503666] ? compat_do_ip6t_set_ctl+0x140/0x140 [ 29.508494] ? setup_sigcontext+0x820/0x820 [ 29.512806] ? nf_sockopt_find.constprop.0+0x1ad/0x220 [ 29.518071] ? nf_setsockopt+0x8b/0xb0 [ 29.521945] ? ipv6_setsockopt+0x63/0x120 [ 29.526102] ? SyS_futex+0x1da/0x290 [ 29.529787] ? SyS_futex+0x1e3/0x290 [ 29.533472] ? exit_to_usermode_loop+0x41/0x200 [ 29.538126] exit_to_usermode_loop+0x160/0x200 [ 29.542683] do_syscall_64+0x4a3/0x640 [ 29.546545] entry_SYSCALL_64_after_hwframe+0x46/0xbb [ 29.551719] RIP: 0033:0x4471c9 [ 29.554895] RSP: 002b:00007f6e4e5662f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca [ 29.562576] RAX: fffffffffffffe00 RBX: 00000000004cc4e0 RCX: 00000000004471c9 [ 29.569833] RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000004cc4e8 [ 29.577089] RBP: 00000000004cc4ec R08: 0000000000000000 R09: 0000000000000000 [ 29.584346] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049c004 [ 29.591589] R13: 0030656c69662f2e R14: 0100000000000000 R15: 00000000004cc4e8