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-1,10.128.15.199' (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: [ 32.957615] ================================================================== [ 32.958809] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.959718] Write of size 8 at addr ffff8801d13736b8 by task syzkaller145339/2983 [ 32.960714] [ 32.960947] CPU: 0 PID: 2983 Comm: syzkaller145339 Not tainted 4.14.0-rc5+ #51 [ 32.962007] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.963245] Call Trace: [ 32.963605] dump_stack+0x194/0x257 [ 32.964100] ? arch_local_irq_restore+0x53/0x53 [ 32.964723] ? show_regs_print_info+0x65/0x65 [ 32.965337] ? lock_acquire+0x1d5/0x580 [ 32.965871] ? lock_timer_base+0x1a3/0x2b0 [ 32.966455] ? detach_if_pending+0x557/0x610 [ 32.967047] print_address_description+0x73/0x250 [ 32.967691] ? detach_if_pending+0x557/0x610 [ 32.968312] kasan_report+0x25b/0x340 [ 32.968827] __asan_report_store8_noabort+0x17/0x20 [ 32.969494] detach_if_pending+0x557/0x610 [ 32.970065] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.970758] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.971401] ? lock_timer_base+0x1a3/0x2b0 [ 32.971968] ? lock_timer_base+0x1eb/0x2b0 [ 32.972538] ? __internal_add_timer+0x2d0/0x2d0 [ 32.973162] ? lock_downgrade+0x990/0x990 [ 32.973720] ? trace_hardirqs_on+0xd/0x10 [ 32.974300] try_to_del_timer_sync+0xa2/0x120 [ 32.974901] ? del_timer+0x130/0x130 [ 32.975406] ? del_timer_sync+0xeb/0x240 [ 32.975974] del_timer_sync+0x18a/0x240 [ 32.976516] tun_free_netdev+0x105/0x1b0 [ 32.977062] ? tun_xdp+0x410/0x410 [ 32.977539] ? cpumask_next+0x24/0x30 [ 32.978054] ? netdev_refcnt_read+0xed/0x150 [ 32.982434] ? tun_xdp+0x410/0x410 [ 32.985944] netdev_run_todo+0x870/0xca0 [ 32.989975] ? do_group_exit+0x149/0x400 [ 32.994004] ? mark_held_locks+0xaf/0x100 [ 32.998120] ? register_netdev+0x30/0x30 [ 33.002151] ? find_held_lock+0x35/0x1d0 [ 33.006188] ? lock_downgrade+0x990/0x990 [ 33.010310] ? refcount_sub_and_test+0x115/0x1b0 [ 33.015032] ? refcount_inc+0x50/0x50 [ 33.018798] ? refcount_inc+0x50/0x50 [ 33.022569] ? sk_destruct+0x4c/0x80 [ 33.026250] ? __sk_free+0x5c/0x230 [ 33.029846] ? sk_free+0x2f/0x40 [ 33.033178] ? __tun_detach+0x176/0x1390 [ 33.037216] ? tun_attach+0xfa0/0xfa0 [ 33.040987] ? lock_downgrade+0x990/0x990 [ 33.045102] ? locks_remove_file+0x3fa/0x5a0 [ 33.049478] ? fcntl_setlk+0x10c0/0x10c0 [ 33.053510] ? __fsnotify_parent+0xb4/0x3a0 [ 33.057798] ? fsnotify+0x1af0/0x1af0 [ 33.061569] ? __tun_detach+0x1390/0x1390 [ 33.065684] ? __tun_detach+0x1390/0x1390 [ 33.069810] rtnl_unlock+0xe/0x10 [ 33.073229] tun_chr_close+0x49/0x60 [ 33.076910] __fput+0x327/0x7e0 [ 33.080164] ? fput+0x140/0x140 [ 33.083412] ? check_same_owner+0x320/0x320 [ 33.087698] ? _raw_spin_unlock_irq+0x27/0x70 [ 33.092165] ____fput+0x15/0x20 [ 33.095414] task_work_run+0x199/0x270 [ 33.099271] ? task_work_cancel+0x210/0x210 [ 33.103558] ? _raw_spin_unlock+0x22/0x30 [ 33.107672] ? switch_task_namespaces+0x87/0xc0 [ 33.112311] do_exit+0x9b5/0x1ad0 [ 33.115731] ? __handle_mm_fault+0xf07/0x39c0 [ 33.120197] ? mm_update_next_owner+0x930/0x930 [ 33.124835] ? lock_release+0xa40/0xa40 [ 33.128775] ? do_raw_spin_trylock+0x190/0x190 [ 33.133325] ? kfree+0xe4/0x250 [ 33.136570] ? kvfree+0x36/0x60 [ 33.139831] ? __handle_mm_fault+0x587/0x39c0 [ 33.144298] ? check_noncircular+0x20/0x20 [ 33.148502] ? __pmd_alloc+0x4e0/0x4e0 [ 33.152363] ? find_held_lock+0x35/0x1d0 [ 33.156404] ? handle_mm_fault+0x248/0x8d0 [ 33.160609] ? find_held_lock+0x35/0x1d0 [ 33.164645] ? __do_page_fault+0x64c/0xd60 [ 33.168847] ? lock_downgrade+0x990/0x990 [ 33.172968] ? handle_mm_fault+0x410/0x8d0 [ 33.177169] ? down_read_trylock+0xdb/0x170 [ 33.181454] ? __do_page_fault+0x31e/0xd60 [ 33.185656] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.190207] ? vmacache_find+0x5f/0x280 [ 33.194147] ? vmacache_update+0xfe/0x130 [ 33.198268] do_group_exit+0x149/0x400 [ 33.202121] ? __do_page_fault+0x3d6/0xd60 [ 33.206321] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 33.210695] ? SyS_exit+0x30/0x30 [ 33.214121] ? do_fast_syscall_32+0x158/0xf05 [ 33.218582] ? do_group_exit+0x400/0x400 [ 33.222610] SyS_exit_group+0x1d/0x20 [ 33.226378] do_fast_syscall_32+0x3f2/0xf05 [ 33.230673] ? do_int80_syscall_32+0x940/0x940 [ 33.235220] ? kasan_check_read+0x11/0x20 [ 33.239335] ? syscall_return_slowpath+0x510/0x510 [ 33.244230] ? SyS_rt_sigaction+0x94/0x1b0 [ 33.248434] ? SyS_sigprocmask+0x4b0/0x4b0 [ 33.252635] ? SyS_read+0x184/0x220 [ 33.256228] ? retint_user+0x18/0x20 [ 33.259913] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 33.264736] entry_SYSENTER_compat+0x51/0x60 [ 33.269110] RIP: 0023:0xf7f15c79 [ 33.272441] RSP: 002b:00000000ff85a5ec EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 33.280115] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 33.287348] RDX: 0000000000000000 RSI: 00000000080dae78 RDI: 00000000080f12a0 [ 33.294585] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 33.301820] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 33.309056] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 33.316310] [ 33.317906] Allocated by task 2983: [ 33.321502] save_stack_trace+0x16/0x20 [ 33.325440] save_stack+0x43/0xd0 [ 33.328858] kasan_kmalloc+0xad/0xe0 [ 33.332535] __kmalloc_node+0x47/0x70 [ 33.336301] kvmalloc_node+0x64/0xd0 [ 33.339982] alloc_netdev_mqs+0x16e/0xed0 [ 33.344094] __tun_chr_ioctl+0x12b2/0x3d20 [ 33.348295] tun_chr_compat_ioctl+0x29/0x30 [ 33.352601] compat_SyS_ioctl+0x1d7/0x3290 [ 33.356800] do_fast_syscall_32+0x3f2/0xf05 [ 33.361094] entry_SYSENTER_compat+0x51/0x60 [ 33.365465] [ 33.367058] Freed by task 2983: [ 33.370302] save_stack_trace+0x16/0x20 [ 33.374241] save_stack+0x43/0xd0 [ 33.377658] kasan_slab_free+0x71/0xc0 [ 33.381508] kfree+0xca/0x250 [ 33.384579] kvfree+0x36/0x60 [ 33.387650] free_netdev+0x2cf/0x360 [ 33.391327] __tun_chr_ioctl+0x2cea/0x3d20 [ 33.395528] tun_chr_compat_ioctl+0x29/0x30 [ 33.399815] compat_SyS_ioctl+0x1d7/0x3290 [ 33.404015] do_fast_syscall_32+0x3f2/0xf05 [ 33.408309] entry_SYSENTER_compat+0x51/0x60 [ 33.412680] [ 33.414276] The buggy address belongs to the object at ffff8801d1370380 [ 33.414276] which belongs to the cache kmalloc-16384 of size 16384 [ 33.427246] The buggy address is located 13112 bytes inside of [ 33.427246] 16384-byte region [ffff8801d1370380, ffff8801d1374380) [ 33.439431] The buggy address belongs to the page: [ 33.444328] page:ffffea000744dc00 count:1 mapcount:0 mapping:ffff8801d1370380 index:0x0 compound_mapcount: 0 [ 33.454263] flags: 0x200000000008100(slab|head) [ 33.458898] raw: 0200000000008100 ffff8801d1370380 0000000000000000 0000000100000001 [ 33.466744] raw: ffffea000747e220 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 33.474587] page dumped because: kasan: bad access detected [ 33.480258] [ 33.481850] Memory state around the buggy address: [ 33.486741] ffff8801d1373580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.494064] ffff8801d1373600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.501387] >ffff8801d1373680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.508711] ^ [ 33.513863] ffff8801d1373700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.521187] ffff8801d1373780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.528509] ================================================================== [ 33.535831] Disabling lock debugging due to kernel taint [ 33.541243] Kernel panic - not syncing: panic_on_warn set ... [ 33.541243] [ 33.548568] CPU: 0 PID: 2983 Comm: syzkaller145339 Tainted: G B 4.14.0-rc5+ #51 [ 33.557105] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.566962] Call Trace: [ 33.569527] dump_stack+0x194/0x257 [ 33.573123] ? arch_local_irq_restore+0x53/0x53 [ 33.577761] ? kasan_end_report+0x32/0x50 [ 33.581880] ? lock_downgrade+0x990/0x990 [ 33.585998] ? detach_if_pending+0x540/0x610 [ 33.590373] panic+0x1e4/0x417 [ 33.593530] ? __warn+0x1d9/0x1d9 [ 33.596954] ? detach_if_pending+0x557/0x610 [ 33.601325] kasan_end_report+0x50/0x50 [ 33.605263] kasan_report+0x144/0x340 [ 33.609034] __asan_report_store8_noabort+0x17/0x20 [ 33.614014] detach_if_pending+0x557/0x610 [ 33.618222] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.623377] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.628010] ? lock_timer_base+0x1a3/0x2b0 [ 33.632213] ? lock_timer_base+0x1eb/0x2b0 [ 33.636414] ? __internal_add_timer+0x2d0/0x2d0 [ 33.641046] ? lock_downgrade+0x990/0x990 [ 33.645157] ? trace_hardirqs_on+0xd/0x10 [ 33.649272] try_to_del_timer_sync+0xa2/0x120 [ 33.653731] ? del_timer+0x130/0x130 [ 33.657409] ? del_timer_sync+0xeb/0x240 [ 33.661438] del_timer_sync+0x18a/0x240 [ 33.665378] tun_free_netdev+0x105/0x1b0 [ 33.669404] ? tun_xdp+0x410/0x410 [ 33.672908] ? cpumask_next+0x24/0x30 [ 33.676677] ? netdev_refcnt_read+0xed/0x150 [ 33.681052] ? tun_xdp+0x410/0x410 [ 33.684556] netdev_run_todo+0x870/0xca0 [ 33.688583] ? do_group_exit+0x149/0x400 [ 33.692611] ? mark_held_locks+0xaf/0x100 [ 33.696723] ? register_netdev+0x30/0x30 [ 33.700749] ? find_held_lock+0x35/0x1d0 [ 33.704781] ? lock_downgrade+0x990/0x990 [ 33.708898] ? refcount_sub_and_test+0x115/0x1b0 [ 33.713616] ? refcount_inc+0x50/0x50 [ 33.717381] ? refcount_inc+0x50/0x50 [ 33.721147] ? sk_destruct+0x4c/0x80 [ 33.724824] ? __sk_free+0x5c/0x230 [ 33.728414] ? sk_free+0x2f/0x40 [ 33.731745] ? __tun_detach+0x176/0x1390 [ 33.735776] ? tun_attach+0xfa0/0xfa0 [ 33.739544] ? lock_downgrade+0x990/0x990 [ 33.743658] ? locks_remove_file+0x3fa/0x5a0 [ 33.748031] ? fcntl_setlk+0x10c0/0x10c0 [ 33.752061] ? __fsnotify_parent+0xb4/0x3a0 [ 33.756352] ? fsnotify+0x1af0/0x1af0 [ 33.760118] ? __tun_detach+0x1390/0x1390 [ 33.764228] ? __tun_detach+0x1390/0x1390 [ 33.768347] rtnl_unlock+0xe/0x10 [ 33.771764] tun_chr_close+0x49/0x60 [ 33.775441] __fput+0x327/0x7e0 [ 33.778686] ? fput+0x140/0x140 [ 33.781933] ? check_same_owner+0x320/0x320 [ 33.786218] ? _raw_spin_unlock_irq+0x27/0x70 [ 33.790680] ____fput+0x15/0x20 [ 33.793923] task_work_run+0x199/0x270 [ 33.797776] ? task_work_cancel+0x210/0x210 [ 33.802062] ? _raw_spin_unlock+0x22/0x30 [ 33.806176] ? switch_task_namespaces+0x87/0xc0 [ 33.810811] do_exit+0x9b5/0x1ad0 [ 33.814228] ? __handle_mm_fault+0xf07/0x39c0 [ 33.818687] ? mm_update_next_owner+0x930/0x930 [ 33.823320] ? lock_release+0xa40/0xa40 [ 33.827261] ? do_raw_spin_trylock+0x190/0x190 [ 33.831808] ? kfree+0xe4/0x250 [ 33.835053] ? kvfree+0x36/0x60 [ 33.838304] ? __handle_mm_fault+0x587/0x39c0 [ 33.842766] ? check_noncircular+0x20/0x20 [ 33.846963] ? __pmd_alloc+0x4e0/0x4e0 [ 33.850817] ? find_held_lock+0x35/0x1d0 [ 33.854845] ? handle_mm_fault+0x248/0x8d0 [ 33.859047] ? find_held_lock+0x35/0x1d0 [ 33.863079] ? __do_page_fault+0x64c/0xd60 [ 33.867277] ? lock_downgrade+0x990/0x990 [ 33.871403] ? handle_mm_fault+0x410/0x8d0 [ 33.875601] ? down_read_trylock+0xdb/0x170 [ 33.879886] ? __do_page_fault+0x31e/0xd60 [ 33.884084] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.888633] ? vmacache_find+0x5f/0x280 [ 33.892570] ? vmacache_update+0xfe/0x130 [ 33.896685] do_group_exit+0x149/0x400 [ 33.900537] ? __do_page_fault+0x3d6/0xd60 [ 33.904735] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 33.909106] ? SyS_exit+0x30/0x30 [ 33.912529] ? do_fast_syscall_32+0x158/0xf05 [ 33.916986] ? do_group_exit+0x400/0x400 [ 33.921012] SyS_exit_group+0x1d/0x20 [ 33.924777] do_fast_syscall_32+0x3f2/0xf05 [ 33.929067] ? do_int80_syscall_32+0x940/0x940 [ 33.933613] ? kasan_check_read+0x11/0x20 [ 33.937728] ? syscall_return_slowpath+0x510/0x510 [ 33.942622] ? SyS_rt_sigaction+0x94/0x1b0 [ 33.946821] ? SyS_sigprocmask+0x4b0/0x4b0 [ 33.951022] ? SyS_read+0x184/0x220 [ 33.954612] ? retint_user+0x18/0x20