INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] Starting enhanced syslogd: rsyslogd[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting periodic command scheduler: cron[?25l[?1c7[ ok 8[?25h[?0c. [....] Starting OpenBSD Secure Shell server: sshd[?25l[?1c7[ ok 8[?25h[?0c. Debian GNU/Linux 7 syzkaller ttyS0 Warning: Permanently added 'ci-upstream-kasan-gce-386-3,10.128.0.61' (ECDSA) to the list of known hosts. net.ipv6.conf.syz0.accept_dad = 0 net.ipv6.conf.syz0.router_solicitations = 0 executing program syzkaller login: [ 30.526293] ================================================================== [ 30.533704] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 30.540424] Write of size 8 at addr ffff8801ce78b740 by task syzkaller204049/2985 [ 30.548015] [ 30.549616] CPU: 0 PID: 2985 Comm: syzkaller204049 Not tainted 4.14.0-rc3+ #22 [ 30.556942] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.566263] Call Trace: [ 30.568825] dump_stack+0x194/0x257 [ 30.572430] ? arch_local_irq_restore+0x53/0x53 [ 30.577073] ? show_regs_print_info+0x65/0x65 [ 30.581538] ? lock_timer_base+0x1a3/0x2b0 [ 30.585746] ? detach_if_pending+0x557/0x610 [ 30.590126] print_address_description+0x73/0x250 [ 30.594938] ? detach_if_pending+0x557/0x610 [ 30.599315] kasan_report+0x25b/0x340 [ 30.603091] __asan_report_store8_noabort+0x17/0x20 [ 30.608079] detach_if_pending+0x557/0x610 [ 30.612288] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.617452] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.622106] ? lock_timer_base+0x1a3/0x2b0 [ 30.626312] ? lock_timer_base+0x1eb/0x2b0 [ 30.630522] ? __internal_add_timer+0x2d0/0x2d0 [ 30.635164] ? trace_hardirqs_on+0xd/0x10 [ 30.639289] try_to_del_timer_sync+0xa2/0x120 [ 30.643752] ? del_timer+0x130/0x130 [ 30.647441] ? del_timer_sync+0xeb/0x240 [ 30.651480] del_timer_sync+0x18a/0x240 [ 30.655433] tun_free_netdev+0x105/0x1b0 [ 30.659464] ? tun_xdp+0x410/0x410 [ 30.662972] ? cpumask_next+0x24/0x30 [ 30.666748] ? netdev_refcnt_read+0xed/0x150 [ 30.671130] ? tun_xdp+0x410/0x410 [ 30.674640] netdev_run_todo+0x870/0xca0 [ 30.678671] ? do_group_exit+0x149/0x400 [ 30.682717] ? register_netdev+0x30/0x30 [ 30.686755] ? lock_downgrade+0x990/0x990 [ 30.690875] ? trace_hardirqs_on+0xd/0x10 [ 30.695009] ? refcount_sub_and_test+0x115/0x1b0 [ 30.699734] ? refcount_inc+0x50/0x50 [ 30.703504] ? refcount_inc+0x50/0x50 [ 30.707278] ? sk_destruct+0x4c/0x80 [ 30.710961] ? __sk_free+0x5c/0x230 [ 30.714561] ? sk_free+0x2f/0x40 [ 30.717897] ? __tun_detach+0x176/0x1390 [ 30.721939] ? tun_attach+0xf90/0xf90 [ 30.725714] ? do_raw_spin_trylock+0x190/0x190 [ 30.730269] ? locks_remove_file+0x3fa/0x5a0 [ 30.734648] ? fcntl_setlk+0x10d0/0x10d0 [ 30.738683] ? __fsnotify_parent+0xb4/0x3a0 [ 30.742979] ? fsnotify+0x1af0/0x1af0 [ 30.746753] ? __tun_detach+0x1390/0x1390 [ 30.750871] ? __tun_detach+0x1390/0x1390 [ 30.754989] rtnl_unlock+0xe/0x10 [ 30.758414] tun_chr_close+0x49/0x60 [ 30.762101] __fput+0x333/0x7f0 [ 30.765356] ? fput+0x140/0x140 [ 30.768611] ? check_same_owner+0x320/0x320 [ 30.772901] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.777373] ____fput+0x15/0x20 [ 30.780624] task_work_run+0x199/0x270 [ 30.784483] ? task_work_cancel+0x210/0x210 [ 30.788775] ? _raw_spin_unlock+0x22/0x30 [ 30.792893] ? switch_task_namespaces+0x87/0xc0 [ 30.797537] do_exit+0x9d2/0x1af0 [ 30.800958] ? __handle_mm_fault+0xf07/0x39c0 [ 30.805430] ? mm_update_next_owner+0x930/0x930 [ 30.810068] ? lock_release+0xd70/0xd70 [ 30.814011] ? check_noncircular+0x20/0x20 [ 30.818216] ? kfree+0xe4/0x250 [ 30.821464] ? kvfree+0x36/0x60 [ 30.824723] ? check_noncircular+0x20/0x20 [ 30.828934] ? __handle_mm_fault+0x587/0x39c0 [ 30.833404] ? __pmd_alloc+0x4e0/0x4e0 [ 30.837273] ? find_held_lock+0x39/0x1d0 [ 30.841317] ? lock_downgrade+0x990/0x990 [ 30.845458] ? handle_mm_fault+0x410/0x8d0 [ 30.849663] ? down_read_trylock+0xdb/0x170 [ 30.853954] ? __do_page_fault+0x31e/0xd60 [ 30.858157] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.862708] ? vmacache_find+0x5f/0x280 [ 30.866652] ? vmacache_update+0xfe/0x130 [ 30.870777] do_group_exit+0x149/0x400 [ 30.874632] ? __do_page_fault+0x3d6/0xd60 [ 30.878834] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 30.883210] ? SyS_exit+0x30/0x30 [ 30.886637] ? do_fast_syscall_32+0x158/0xf05 [ 30.891101] ? do_group_exit+0x400/0x400 [ 30.895132] SyS_exit_group+0x1d/0x20 [ 30.898901] do_fast_syscall_32+0x3f2/0xf05 [ 30.903200] ? do_int80_syscall_32+0x940/0x940 [ 30.907751] ? kasan_check_read+0x11/0x20 [ 30.911873] ? syscall_return_slowpath+0x510/0x510 [ 30.916774] ? SyS_rt_sigaction+0x94/0x1b0 [ 30.920984] ? lockdep_sys_exit+0x47/0xf0 [ 30.925102] ? retint_user+0x18/0x20 [ 30.928790] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.933609] entry_SYSENTER_compat+0x51/0x60 [ 30.937984] RIP: 0023:0xf7f54c79 [ 30.941315] RSP: 002b:00000000ffd7c9fc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 30.948994] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 30.956232] RDX: 0000000000000000 RSI: 00000000080db4f8 RDI: 00000000080f22a0 [ 30.963469] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 30.970706] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 30.977945] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 30.985200] [ 30.986796] Allocated by task 2985: [ 30.990391] save_stack_trace+0x16/0x20 [ 30.994335] save_stack+0x43/0xd0 [ 30.997758] kasan_kmalloc+0xad/0xe0 [ 31.001438] __kmalloc_node+0x47/0x70 [ 31.005205] kvmalloc_node+0x64/0xd0 [ 31.008888] alloc_netdev_mqs+0x16e/0xed0 [ 31.013013] __tun_chr_ioctl+0x12be/0x3d20 [ 31.017214] tun_chr_compat_ioctl+0x29/0x30 [ 31.021503] compat_SyS_ioctl+0x1d7/0x3290 [ 31.025707] do_fast_syscall_32+0x3f2/0xf05 [ 31.029997] entry_SYSENTER_compat+0x51/0x60 [ 31.034373] [ 31.035969] Freed by task 2985: [ 31.039219] save_stack_trace+0x16/0x20 [ 31.043161] save_stack+0x43/0xd0 [ 31.046583] kasan_slab_free+0x71/0xc0 [ 31.050438] kfree+0xca/0x250 [ 31.053511] kvfree+0x36/0x60 [ 31.056598] free_netdev+0x2cf/0x360 [ 31.060278] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.064479] tun_chr_compat_ioctl+0x29/0x30 [ 31.068768] compat_SyS_ioctl+0x1d7/0x3290 [ 31.072970] do_fast_syscall_32+0x3f2/0xf05 [ 31.077258] entry_SYSENTER_compat+0x51/0x60 [ 31.081629] [ 31.083226] The buggy address belongs to the object at ffff8801ce788340 [ 31.083226] which belongs to the cache kmalloc-16384 of size 16384 [ 31.096195] The buggy address is located 13312 bytes inside of [ 31.096195] 16384-byte region [ffff8801ce788340, ffff8801ce78c340) [ 31.108380] The buggy address belongs to the page: [ 31.113278] page:ffffea000739e200 count:1 mapcount:0 mapping:ffff8801ce788340 index:0x0 compound_mapcount: 0 [ 31.123219] flags: 0x200000000008100(slab|head) [ 31.127858] raw: 0200000000008100 ffff8801ce788340 0000000000000000 0000000100000001 [ 31.135705] raw: ffffea0007391c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.143550] page dumped because: kasan: bad access detected [ 31.149224] [ 31.150819] Memory state around the buggy address: [ 31.155715] ffff8801ce78b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.163039] ffff8801ce78b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.170368] >ffff8801ce78b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.177698] ^ [ 31.183116] ffff8801ce78b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.190445] ffff8801ce78b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.197771] ================================================================== [ 31.205095] Disabling lock debugging due to kernel taint [ 31.210505] Kernel panic - not syncing: panic_on_warn set ... [ 31.210505] [ 31.217831] CPU: 0 PID: 2985 Comm: syzkaller204049 Tainted: G B 4.14.0-rc3+ #22 [ 31.226367] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.235684] Call Trace: [ 31.238238] dump_stack+0x194/0x257 [ 31.241830] ? arch_local_irq_restore+0x53/0x53 [ 31.246465] ? vprintk_default+0x28/0x30 [ 31.250491] ? detach_if_pending+0x500/0x610 [ 31.254867] panic+0x1e4/0x417 [ 31.258023] ? __warn+0x1d9/0x1d9 [ 31.261448] ? detach_if_pending+0x557/0x610 [ 31.265818] kasan_end_report+0x50/0x50 [ 31.269757] kasan_report+0x144/0x340 [ 31.273523] __asan_report_store8_noabort+0x17/0x20 [ 31.278501] detach_if_pending+0x557/0x610 [ 31.282698] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.287854] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.292486] ? lock_timer_base+0x1a3/0x2b0 [ 31.296683] ? lock_timer_base+0x1eb/0x2b0 [ 31.300883] ? __internal_add_timer+0x2d0/0x2d0 [ 31.305518] ? trace_hardirqs_on+0xd/0x10 [ 31.309633] try_to_del_timer_sync+0xa2/0x120 [ 31.314090] ? del_timer+0x130/0x130 [ 31.317768] ? del_timer_sync+0xeb/0x240 [ 31.321794] del_timer_sync+0x18a/0x240 [ 31.325733] tun_free_netdev+0x105/0x1b0 [ 31.329756] ? tun_xdp+0x410/0x410 [ 31.333258] ? cpumask_next+0x24/0x30 [ 31.337024] ? netdev_refcnt_read+0xed/0x150 [ 31.341397] ? tun_xdp+0x410/0x410 [ 31.344899] netdev_run_todo+0x870/0xca0 [ 31.348922] ? do_group_exit+0x149/0x400 [ 31.352948] ? register_netdev+0x30/0x30 [ 31.356975] ? lock_downgrade+0x990/0x990 [ 31.361085] ? trace_hardirqs_on+0xd/0x10 [ 31.365209] ? refcount_sub_and_test+0x115/0x1b0 [ 31.369927] ? refcount_inc+0x50/0x50 [ 31.373690] ? refcount_inc+0x50/0x50 [ 31.377458] ? sk_destruct+0x4c/0x80 [ 31.381133] ? __sk_free+0x5c/0x230 [ 31.384726] ? sk_free+0x2f/0x40 [ 31.388057] ? __tun_detach+0x176/0x1390 [ 31.392085] ? tun_attach+0xf90/0xf90 [ 31.395851] ? do_raw_spin_trylock+0x190/0x190 [ 31.400401] ? locks_remove_file+0x3fa/0x5a0 [ 31.404774] ? fcntl_setlk+0x10d0/0x10d0 [ 31.408802] ? __fsnotify_parent+0xb4/0x3a0 [ 31.413087] ? fsnotify+0x1af0/0x1af0 [ 31.416852] ? __tun_detach+0x1390/0x1390 [ 31.420962] ? __tun_detach+0x1390/0x1390 [ 31.425074] rtnl_unlock+0xe/0x10 [ 31.428491] tun_chr_close+0x49/0x60 [ 31.432169] __fput+0x333/0x7f0 [ 31.435416] ? fput+0x140/0x140 [ 31.438662] ? check_same_owner+0x320/0x320 [ 31.442944] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.447404] ____fput+0x15/0x20 [ 31.450652] task_work_run+0x199/0x270 [ 31.454505] ? task_work_cancel+0x210/0x210 [ 31.458792] ? _raw_spin_unlock+0x22/0x30 [ 31.462904] ? switch_task_namespaces+0x87/0xc0 [ 31.467537] do_exit+0x9d2/0x1af0 [ 31.470953] ? __handle_mm_fault+0xf07/0x39c0 [ 31.475415] ? mm_update_next_owner+0x930/0x930 [ 31.480047] ? lock_release+0xd70/0xd70 [ 31.483990] ? check_noncircular+0x20/0x20 [ 31.488187] ? kfree+0xe4/0x250 [ 31.491431] ? kvfree+0x36/0x60 [ 31.494679] ? check_noncircular+0x20/0x20 [ 31.498879] ? __handle_mm_fault+0x587/0x39c0 [ 31.503342] ? __pmd_alloc+0x4e0/0x4e0 [ 31.507200] ? find_held_lock+0x39/0x1d0 [ 31.511229] ? lock_downgrade+0x990/0x990 [ 31.515351] ? handle_mm_fault+0x410/0x8d0 [ 31.519552] ? down_read_trylock+0xdb/0x170 [ 31.523837] ? __do_page_fault+0x31e/0xd60