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-0,10.128.15.192' (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: [ 61.070453] ================================================================== [ 61.077866] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 61.084591] Write of size 8 at addr ffff8801ce23b780 by task syzkaller698181/2983 [ 61.092180] [ 61.093787] CPU: 0 PID: 2983 Comm: syzkaller698181 Not tainted 4.14.0-rc4+ #39 [ 61.101118] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 61.110443] Call Trace: [ 61.113002] dump_stack+0x194/0x257 [ 61.116611] ? arch_local_irq_restore+0x53/0x53 [ 61.121253] ? show_regs_print_info+0x65/0x65 [ 61.125722] ? lock_timer_base+0x1a3/0x2b0 [ 61.129932] ? detach_if_pending+0x557/0x610 [ 61.134316] print_address_description+0x73/0x250 [ 61.139130] ? detach_if_pending+0x557/0x610 [ 61.143511] kasan_report+0x25b/0x340 [ 61.147288] __asan_report_store8_noabort+0x17/0x20 [ 61.152273] detach_if_pending+0x557/0x610 [ 61.156479] ? trace_raw_output_tick_stop+0x130/0x130 [ 61.161640] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 61.166279] ? lock_timer_base+0x1a3/0x2b0 [ 61.170485] ? lock_timer_base+0x1eb/0x2b0 [ 61.174694] ? __internal_add_timer+0x2d0/0x2d0 [ 61.179336] ? trace_hardirqs_on+0xd/0x10 [ 61.183461] try_to_del_timer_sync+0xa2/0x120 [ 61.187926] ? del_timer+0x130/0x130 [ 61.191612] ? del_timer_sync+0xeb/0x240 [ 61.195651] del_timer_sync+0x18a/0x240 [ 61.199599] tun_free_netdev+0x105/0x1b0 [ 61.203633] ? tun_xdp+0x410/0x410 [ 61.207142] ? cpumask_next+0x24/0x30 [ 61.210915] ? netdev_refcnt_read+0xed/0x150 [ 61.215296] ? tun_xdp+0x410/0x410 [ 61.218807] netdev_run_todo+0x870/0xca0 [ 61.222839] ? do_group_exit+0x149/0x400 [ 61.226876] ? register_netdev+0x30/0x30 [ 61.230910] ? lock_downgrade+0x990/0x990 [ 61.235026] ? trace_hardirqs_on+0xd/0x10 [ 61.239162] ? refcount_sub_and_test+0x115/0x1b0 [ 61.243887] ? refcount_inc+0x50/0x50 [ 61.247658] ? refcount_inc+0x50/0x50 [ 61.251434] ? sk_destruct+0x4c/0x80 [ 61.255118] ? __sk_free+0x5c/0x230 [ 61.258718] ? sk_free+0x2f/0x40 [ 61.262053] ? __tun_detach+0x176/0x1390 [ 61.266095] ? tun_attach+0xf90/0xf90 [ 61.269878] ? locks_remove_file+0x3fa/0x5a0 [ 61.274258] ? fcntl_setlk+0x10d0/0x10d0 [ 61.278293] ? __fsnotify_parent+0xb4/0x3a0 [ 61.282587] ? fsnotify+0x1af0/0x1af0 [ 61.286362] ? __tun_detach+0x1390/0x1390 [ 61.290479] ? __tun_detach+0x1390/0x1390 [ 61.294599] rtnl_unlock+0xe/0x10 [ 61.298024] tun_chr_close+0x49/0x60 [ 61.301707] __fput+0x333/0x7f0 [ 61.304964] ? fput+0x140/0x140 [ 61.308216] ? check_same_owner+0x320/0x320 [ 61.312514] ____fput+0x15/0x20 [ 61.315763] task_work_run+0x199/0x270 [ 61.319626] ? task_work_cancel+0x210/0x210 [ 61.323924] ? free_nsproxy+0x185/0x1f0 [ 61.327872] ? switch_task_namespaces+0xa2/0xc0 [ 61.332519] do_exit+0x9d2/0x1af0 [ 61.335945] ? __handle_mm_fault+0xf07/0x39c0 [ 61.340414] ? mm_update_next_owner+0x930/0x930 [ 61.345053] ? lock_release+0xd70/0xd70 [ 61.348998] ? check_noncircular+0x20/0x20 [ 61.353204] ? kfree+0xe4/0x250 [ 61.356454] ? kvfree+0x36/0x60 [ 61.359708] ? trace_hardirqs_on+0xd/0x10 [ 61.363829] ? check_noncircular+0x20/0x20 [ 61.368036] ? __handle_mm_fault+0x587/0x39c0 [ 61.372509] ? __pmd_alloc+0x4e0/0x4e0 [ 61.376376] ? find_held_lock+0x39/0x1d0 [ 61.380418] ? lock_downgrade+0x990/0x990 [ 61.384566] ? handle_mm_fault+0x410/0x8d0 [ 61.388769] ? down_read_trylock+0xdb/0x170 [ 61.393060] ? __do_page_fault+0x31e/0xd60 [ 61.397267] ? __handle_mm_fault+0x39c0/0x39c0 [ 61.401818] ? vmacache_find+0x5f/0x280 [ 61.405771] do_group_exit+0x149/0x400 [ 61.409634] ? __do_page_fault+0x3d6/0xd60 [ 61.413837] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 61.418214] ? SyS_exit+0x30/0x30 [ 61.421644] ? do_fast_syscall_32+0x158/0xf05 [ 61.426112] ? do_group_exit+0x400/0x400 [ 61.430145] SyS_exit_group+0x1d/0x20 [ 61.433917] do_fast_syscall_32+0x3f2/0xf05 [ 61.438215] ? do_int80_syscall_32+0x940/0x940 [ 61.442771] ? lockdep_sys_exit+0x47/0xf0 [ 61.446890] ? syscall_return_slowpath+0x2b3/0x510 [ 61.451788] ? finish_task_switch+0x1aa/0x740 [ 61.456256] ? lockdep_sys_exit+0x47/0xf0 [ 61.460381] ? retint_user+0x18/0x20 [ 61.464070] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 61.468890] entry_SYSENTER_compat+0x51/0x60 [ 61.473269] RIP: 0023:0xf7ff2c79 [ 61.476603] RSP: 002b:000000000820fe3c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 61.484287] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 000000000820ff6c [ 61.491526] RDX: 0000000008049247 RSI: 0000000000000036 RDI: 0000000000000005 [ 61.498766] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 61.506005] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 61.513244] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 61.520501] [ 61.522098] Allocated by task 2983: [ 61.525696] save_stack_trace+0x16/0x20 [ 61.529639] save_stack+0x43/0xd0 [ 61.533061] kasan_kmalloc+0xad/0xe0 [ 61.536743] __kmalloc_node+0x47/0x70 [ 61.540512] kvmalloc_node+0x64/0xd0 [ 61.544196] alloc_netdev_mqs+0x16e/0xed0 [ 61.548314] __tun_chr_ioctl+0x12be/0x3d20 [ 61.552518] tun_chr_compat_ioctl+0x29/0x30 [ 61.556808] compat_SyS_ioctl+0x1d7/0x3290 [ 61.561010] do_fast_syscall_32+0x3f2/0xf05 [ 61.565297] entry_SYSENTER_compat+0x51/0x60 [ 61.569672] [ 61.571270] Freed by task 2983: [ 61.574523] save_stack_trace+0x16/0x20 [ 61.578467] save_stack+0x43/0xd0 [ 61.581887] kasan_slab_free+0x71/0xc0 [ 61.585743] kfree+0xca/0x250 [ 61.588816] kvfree+0x36/0x60 [ 61.591890] free_netdev+0x2cf/0x360 [ 61.595575] __tun_chr_ioctl+0x2cf6/0x3d20 [ 61.599775] tun_chr_compat_ioctl+0x29/0x30 [ 61.604064] compat_SyS_ioctl+0x1d7/0x3290 [ 61.608266] do_fast_syscall_32+0x3f2/0xf05 [ 61.612559] entry_SYSENTER_compat+0x51/0x60 [ 61.616938] [ 61.618538] The buggy address belongs to the object at ffff8801ce238380 [ 61.618538] which belongs to the cache kmalloc-16384 of size 16384 [ 61.631509] The buggy address is located 13312 bytes inside of [ 61.631509] 16384-byte region [ffff8801ce238380, ffff8801ce23c380) [ 61.643697] The buggy address belongs to the page: [ 61.648594] page:ffffea0007388e00 count:1 mapcount:0 mapping:ffff8801ce238380 index:0x0 compound_mapcount: 0 [ 61.658538] flags: 0x200000000008100(slab|head) [ 61.663180] raw: 0200000000008100 ffff8801ce238380 0000000000000000 0000000100000001 [ 61.671029] raw: ffffea0007373020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 61.678876] page dumped because: kasan: bad access detected [ 61.684551] [ 61.686145] Memory state around the buggy address: [ 61.691045] ffff8801ce23b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.698374] ffff8801ce23b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.706033] >ffff8801ce23b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.713366] ^ [ 61.716701] ffff8801ce23b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.724029] ffff8801ce23b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.731354] ================================================================== [ 61.738680] Disabling lock debugging due to kernel taint [ 61.744092] Kernel panic - not syncing: panic_on_warn set ... [ 61.744092] [ 61.751422] CPU: 0 PID: 2983 Comm: syzkaller698181 Tainted: G B 4.14.0-rc4+ #39 [ 61.759959] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 61.769277] Call Trace: [ 61.771833] dump_stack+0x194/0x257 [ 61.775430] ? arch_local_irq_restore+0x53/0x53 [ 61.780067] ? vprintk_default+0x28/0x30 [ 61.784094] ? detach_if_pending+0x540/0x610 [ 61.788469] panic+0x1e4/0x417 [ 61.791625] ? __warn+0x1d9/0x1d9 [ 61.795049] ? detach_if_pending+0x557/0x610 [ 61.799422] kasan_end_report+0x50/0x50 [ 61.803358] kasan_report+0x144/0x340 [ 61.807124] __asan_report_store8_noabort+0x17/0x20 [ 61.812106] detach_if_pending+0x557/0x610 [ 61.816306] ? trace_raw_output_tick_stop+0x130/0x130 [ 61.821461] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 61.826091] ? lock_timer_base+0x1a3/0x2b0 [ 61.830290] ? lock_timer_base+0x1eb/0x2b0 [ 61.834502] ? __internal_add_timer+0x2d0/0x2d0 [ 61.839134] ? trace_hardirqs_on+0xd/0x10 [ 61.843247] try_to_del_timer_sync+0xa2/0x120 [ 61.847705] ? del_timer+0x130/0x130 [ 61.851382] ? del_timer_sync+0xeb/0x240 [ 61.855408] del_timer_sync+0x18a/0x240 [ 61.859347] tun_free_netdev+0x105/0x1b0 [ 61.863370] ? tun_xdp+0x410/0x410 [ 61.866872] ? cpumask_next+0x24/0x30 [ 61.870639] ? netdev_refcnt_read+0xed/0x150 [ 61.875013] ? tun_xdp+0x410/0x410 [ 61.878524] netdev_run_todo+0x870/0xca0 [ 61.882548] ? do_group_exit+0x149/0x400 [ 61.886577] ? register_netdev+0x30/0x30 [ 61.890603] ? lock_downgrade+0x990/0x990 [ 61.894715] ? trace_hardirqs_on+0xd/0x10 [ 61.898837] ? refcount_sub_and_test+0x115/0x1b0 [ 61.903560] ? refcount_inc+0x50/0x50 [ 61.907326] ? refcount_inc+0x50/0x50 [ 61.911093] ? sk_destruct+0x4c/0x80 [ 61.914773] ? __sk_free+0x5c/0x230 [ 61.918363] ? sk_free+0x2f/0x40 [ 61.921693] ? __tun_detach+0x176/0x1390 [ 61.925725] ? tun_attach+0xf90/0xf90 [ 61.929495] ? locks_remove_file+0x3fa/0x5a0 [ 61.933869] ? fcntl_setlk+0x10d0/0x10d0 [ 61.937895] ? __fsnotify_parent+0xb4/0x3a0 [ 61.942180] ? fsnotify+0x1af0/0x1af0 [ 61.945945] ? __tun_detach+0x1390/0x1390 [ 61.950057] ? __tun_detach+0x1390/0x1390 [ 61.954168] rtnl_unlock+0xe/0x10 [ 61.957585] tun_chr_close+0x49/0x60 [ 61.961262] __fput+0x333/0x7f0 [ 61.964508] ? fput+0x140/0x140 [ 61.967753] ? check_same_owner+0x320/0x320 [ 61.972040] ____fput+0x15/0x20 [ 61.975285] task_work_run+0x199/0x270 [ 61.979138] ? task_work_cancel+0x210/0x210 [ 61.983424] ? free_nsproxy+0x185/0x1f0 [ 61.987361] ? switch_task_namespaces+0xa2/0xc0 [ 61.991996] do_exit+0x9d2/0x1af0 [ 61.995413] ? __handle_mm_fault+0xf07/0x39c0 [ 61.999874] ? mm_update_next_owner+0x930/0x930 [ 62.004506] ? lock_release+0xd70/0xd70 [ 62.008443] ? check_noncircular+0x20/0x20 [ 62.012640] ? kfree+0xe4/0x250 [ 62.015885] ? kvfree+0x36/0x60 [ 62.019128] ? trace_hardirqs_on+0xd/0x10 [ 62.023242] ? check_noncircular+0x20/0x20 [ 62.027441] ? __handle_mm_fault+0x587/0x39c0 [ 62.031901] ? __pmd_alloc+0x4e0/0x4e0 [ 62.035756] ? find_held_lock+0x39/0x1d0 [ 62.039785] ? lock_downgrade+0x990/0x990 [ 62.043906] ? handle_mm_fault+0x410/0x8d0 [ 62.048104] ? down_read_trylock+0xdb/0x170 [ 62.052390] ? __do_page_fault+0x31e/0xd60 [ 62.056596] ? __handle_mm_fault+0x39c0/0x39c0 [ 62.061141] ? vmacache_find+0x5f/0x280 [ 62.065082] do_group_exit+0x149/0x400 [ 62.068933] ? __do_page_fault+0x3d6/0xd60