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-2,10.128.0.50' (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: [ 40.984401] ================================================================== [ 40.991848] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.998569] Write of size 8 at addr ffff8801bfceb740 by task syzkaller590625/2990 [ 41.006155] [ 41.007760] CPU: 1 PID: 2990 Comm: syzkaller590625 Not tainted 4.14.0-rc3+ #23 [ 41.015089] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.024411] Call Trace: [ 41.026970] dump_stack+0x194/0x257 [ 41.030571] ? arch_local_irq_restore+0x53/0x53 [ 41.035210] ? show_regs_print_info+0x65/0x65 [ 41.039676] ? lock_timer_base+0x1a3/0x2b0 [ 41.043883] ? detach_if_pending+0x557/0x610 [ 41.048265] print_address_description+0x73/0x250 [ 41.053076] ? detach_if_pending+0x557/0x610 [ 41.057458] kasan_report+0x25b/0x340 [ 41.061240] __asan_report_store8_noabort+0x17/0x20 [ 41.066235] detach_if_pending+0x557/0x610 [ 41.070450] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.075616] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.080254] ? lock_timer_base+0x1a3/0x2b0 [ 41.084460] ? lock_timer_base+0x1eb/0x2b0 [ 41.088668] ? __internal_add_timer+0x2d0/0x2d0 [ 41.093311] ? trace_hardirqs_on+0xd/0x10 [ 41.097436] try_to_del_timer_sync+0xa2/0x120 [ 41.101901] ? del_timer+0x130/0x130 [ 41.105585] ? del_timer_sync+0xeb/0x240 [ 41.109623] del_timer_sync+0x18a/0x240 [ 41.113572] tun_free_netdev+0x105/0x1b0 [ 41.117604] ? tun_xdp+0x410/0x410 [ 41.121114] ? cpumask_next+0x24/0x30 [ 41.124890] ? netdev_refcnt_read+0xed/0x150 [ 41.129272] ? tun_xdp+0x410/0x410 [ 41.132782] netdev_run_todo+0x870/0xca0 [ 41.136814] ? do_group_exit+0x149/0x400 [ 41.140849] ? register_netdev+0x30/0x30 [ 41.144883] ? lock_downgrade+0x990/0x990 [ 41.149000] ? trace_hardirqs_on+0xd/0x10 [ 41.153137] ? refcount_sub_and_test+0x115/0x1b0 [ 41.157868] ? refcount_inc+0x50/0x50 [ 41.161637] ? refcount_inc+0x50/0x50 [ 41.165412] ? sk_destruct+0x4c/0x80 [ 41.169096] ? __sk_free+0x5c/0x230 [ 41.172694] ? sk_free+0x2f/0x40 [ 41.176030] ? __tun_detach+0x176/0x1390 [ 41.180071] ? tun_attach+0xf90/0xf90 [ 41.183845] ? do_raw_spin_trylock+0x190/0x190 [ 41.188410] ? locks_remove_file+0x3fa/0x5a0 [ 41.192790] ? fcntl_setlk+0x10d0/0x10d0 [ 41.196824] ? __fsnotify_parent+0xb4/0x3a0 [ 41.201118] ? fsnotify+0x1af0/0x1af0 [ 41.204894] ? __tun_detach+0x1390/0x1390 [ 41.209013] ? __tun_detach+0x1390/0x1390 [ 41.213131] rtnl_unlock+0xe/0x10 [ 41.216556] tun_chr_close+0x49/0x60 [ 41.220239] __fput+0x333/0x7f0 [ 41.223497] ? fput+0x140/0x140 [ 41.226749] ? check_same_owner+0x320/0x320 [ 41.231039] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.235510] ____fput+0x15/0x20 [ 41.238761] task_work_run+0x199/0x270 [ 41.242629] ? task_work_cancel+0x210/0x210 [ 41.246923] ? _raw_spin_unlock+0x22/0x30 [ 41.251043] ? switch_task_namespaces+0x87/0xc0 [ 41.255687] do_exit+0x9d2/0x1af0 [ 41.259112] ? __handle_mm_fault+0xf07/0x39c0 [ 41.263582] ? mm_update_next_owner+0x930/0x930 [ 41.268221] ? lock_release+0xd70/0xd70 [ 41.272165] ? check_noncircular+0x20/0x20 [ 41.276369] ? kfree+0xe4/0x250 [ 41.279619] ? kvfree+0x36/0x60 [ 41.282879] ? check_noncircular+0x20/0x20 [ 41.287087] ? __handle_mm_fault+0x587/0x39c0 [ 41.291560] ? __pmd_alloc+0x4e0/0x4e0 [ 41.295427] ? find_held_lock+0x39/0x1d0 [ 41.299469] ? lock_downgrade+0x990/0x990 [ 41.303609] ? handle_mm_fault+0x410/0x8d0 [ 41.307812] ? down_read_trylock+0xdb/0x170 [ 41.312103] ? __do_page_fault+0x31e/0xd60 [ 41.316308] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.320873] ? vmacache_find+0x5f/0x280 [ 41.324831] ? vmacache_update+0xfe/0x130 [ 41.328957] do_group_exit+0x149/0x400 [ 41.332815] ? __do_page_fault+0x3d6/0xd60 [ 41.337028] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 41.341406] ? SyS_exit+0x30/0x30 [ 41.344837] ? do_fast_syscall_32+0x158/0xf05 [ 41.349303] ? do_group_exit+0x400/0x400 [ 41.353334] SyS_exit_group+0x1d/0x20 [ 41.357104] do_fast_syscall_32+0x3f2/0xf05 [ 41.361404] ? do_int80_syscall_32+0x940/0x940 [ 41.365960] ? kasan_check_read+0x11/0x20 [ 41.370079] ? syscall_return_slowpath+0x510/0x510 [ 41.374982] ? SyS_rt_sigaction+0x94/0x1b0 [ 41.379194] ? lockdep_sys_exit+0x47/0xf0 [ 41.383315] ? retint_user+0x18/0x20 [ 41.387006] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 41.391823] entry_SYSENTER_compat+0x51/0x60 [ 41.396201] RIP: 0023:0xf7f98c79 [ 41.399533] RSP: 002b:00000000ffe1dddc EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 41.407213] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 41.414452] RDX: 0000000000000000 RSI: 00000000080daa58 RDI: 00000000080f12a0 [ 41.421690] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 41.428931] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 41.436169] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 41.443426] [ 41.445025] Allocated by task 2990: [ 41.448623] save_stack_trace+0x16/0x20 [ 41.452566] save_stack+0x43/0xd0 [ 41.455989] kasan_kmalloc+0xad/0xe0 [ 41.459671] __kmalloc_node+0x47/0x70 [ 41.463441] kvmalloc_node+0x64/0xd0 [ 41.467128] alloc_netdev_mqs+0x16e/0xed0 [ 41.471244] __tun_chr_ioctl+0x12be/0x3d20 [ 41.475446] tun_chr_compat_ioctl+0x29/0x30 [ 41.479739] compat_SyS_ioctl+0x1d7/0x3290 [ 41.483945] do_fast_syscall_32+0x3f2/0xf05 [ 41.488234] entry_SYSENTER_compat+0x51/0x60 [ 41.492610] [ 41.494207] Freed by task 2990: [ 41.497454] save_stack_trace+0x16/0x20 [ 41.501395] save_stack+0x43/0xd0 [ 41.504816] kasan_slab_free+0x71/0xc0 [ 41.508670] kfree+0xca/0x250 [ 41.511743] kvfree+0x36/0x60 [ 41.514816] free_netdev+0x2cf/0x360 [ 41.518497] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.522699] tun_chr_compat_ioctl+0x29/0x30 [ 41.526989] compat_SyS_ioctl+0x1d7/0x3290 [ 41.531191] do_fast_syscall_32+0x3f2/0xf05 [ 41.535478] entry_SYSENTER_compat+0x51/0x60 [ 41.539852] [ 41.541450] The buggy address belongs to the object at ffff8801bfce8340 [ 41.541450] which belongs to the cache kmalloc-16384 of size 16384 [ 41.554419] The buggy address is located 13312 bytes inside of [ 41.554419] 16384-byte region [ffff8801bfce8340, ffff8801bfcec340) [ 41.566605] The buggy address belongs to the page: [ 41.571502] page:ffffea0006ff3a00 count:1 mapcount:0 mapping:ffff8801bfce8340 index:0x0 compound_mapcount: 0 [ 41.581445] flags: 0x200000000008100(slab|head) [ 41.586084] raw: 0200000000008100 ffff8801bfce8340 0000000000000000 0000000100000001 [ 41.593932] raw: ffffea0007341620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.601778] page dumped because: kasan: bad access detected [ 41.607452] [ 41.609048] Memory state around the buggy address: [ 41.613945] ffff8801bfceb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.621270] ffff8801bfceb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.628596] >ffff8801bfceb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.635921] ^ [ 41.641337] ffff8801bfceb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.648663] ffff8801bfceb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.655987] ================================================================== [ 41.663309] Disabling lock debugging due to kernel taint [ 41.668721] Kernel panic - not syncing: panic_on_warn set ... [ 41.668721] [ 41.676047] CPU: 1 PID: 2990 Comm: syzkaller590625 Tainted: G B 4.14.0-rc3+ #23 [ 41.684582] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.693896] Call Trace: [ 41.696449] dump_stack+0x194/0x257 [ 41.700041] ? arch_local_irq_restore+0x53/0x53 [ 41.704674] ? vprintk_default+0x28/0x30 [ 41.708702] ? detach_if_pending+0x500/0x610 [ 41.713078] panic+0x1e4/0x417 [ 41.716234] ? __warn+0x1d9/0x1d9 [ 41.719657] ? detach_if_pending+0x557/0x610 [ 41.724028] kasan_end_report+0x50/0x50 [ 41.727967] kasan_report+0x144/0x340 [ 41.731731] __asan_report_store8_noabort+0x17/0x20 [ 41.736709] detach_if_pending+0x557/0x610 [ 41.740908] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.746061] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.750692] ? lock_timer_base+0x1a3/0x2b0 [ 41.754892] ? lock_timer_base+0x1eb/0x2b0 [ 41.759092] ? __internal_add_timer+0x2d0/0x2d0 [ 41.763728] ? trace_hardirqs_on+0xd/0x10 [ 41.767842] try_to_del_timer_sync+0xa2/0x120 [ 41.772301] ? del_timer+0x130/0x130 [ 41.775978] ? del_timer_sync+0xeb/0x240 [ 41.780006] del_timer_sync+0x18a/0x240 [ 41.783946] tun_free_netdev+0x105/0x1b0 [ 41.787971] ? tun_xdp+0x410/0x410 [ 41.791474] ? cpumask_next+0x24/0x30 [ 41.795239] ? netdev_refcnt_read+0xed/0x150 [ 41.799613] ? tun_xdp+0x410/0x410 [ 41.803119] netdev_run_todo+0x870/0xca0 [ 41.807143] ? do_group_exit+0x149/0x400 [ 41.811256] ? register_netdev+0x30/0x30 [ 41.815282] ? lock_downgrade+0x990/0x990 [ 41.819397] ? trace_hardirqs_on+0xd/0x10 [ 41.823521] ? refcount_sub_and_test+0x115/0x1b0 [ 41.828243] ? refcount_inc+0x50/0x50 [ 41.832012] ? refcount_inc+0x50/0x50 [ 41.835780] ? sk_destruct+0x4c/0x80 [ 41.839456] ? __sk_free+0x5c/0x230 [ 41.843049] ? sk_free+0x2f/0x40 [ 41.846378] ? __tun_detach+0x176/0x1390 [ 41.850408] ? tun_attach+0xf90/0xf90 [ 41.854176] ? do_raw_spin_trylock+0x190/0x190 [ 41.858723] ? locks_remove_file+0x3fa/0x5a0 [ 41.863097] ? fcntl_setlk+0x10d0/0x10d0 [ 41.867126] ? __fsnotify_parent+0xb4/0x3a0 [ 41.871412] ? fsnotify+0x1af0/0x1af0 [ 41.875178] ? __tun_detach+0x1390/0x1390 [ 41.879290] ? __tun_detach+0x1390/0x1390 [ 41.883404] rtnl_unlock+0xe/0x10 [ 41.886821] tun_chr_close+0x49/0x60 [ 41.890499] __fput+0x333/0x7f0 [ 41.893744] ? fput+0x140/0x140 [ 41.896989] ? check_same_owner+0x320/0x320 [ 41.901274] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.905734] ____fput+0x15/0x20 [ 41.908981] task_work_run+0x199/0x270 [ 41.912833] ? task_work_cancel+0x210/0x210 [ 41.917119] ? _raw_spin_unlock+0x22/0x30 [ 41.921232] ? switch_task_namespaces+0x87/0xc0 [ 41.925866] do_exit+0x9d2/0x1af0 [ 41.929284] ? __handle_mm_fault+0xf07/0x39c0 [ 41.933743] ? mm_update_next_owner+0x930/0x930 [ 41.938374] ? lock_release+0xd70/0xd70 [ 41.942315] ? check_noncircular+0x20/0x20 [ 41.946514] ? kfree+0xe4/0x250 [ 41.949757] ? kvfree+0x36/0x60 [ 41.953005] ? check_noncircular+0x20/0x20 [ 41.957203] ? __handle_mm_fault+0x587/0x39c0 [ 41.961665] ? __pmd_alloc+0x4e0/0x4e0 [ 41.965521] ? find_held_lock+0x39/0x1d0 [ 41.969550] ? lock_downgrade+0x990/0x990 [ 41.973671] ? handle_mm_fault+0x410/0x8d0 [ 41.977868] ? down_read_trylock+0xdb/0x170 [ 41.982156] ? __do_page_fault+0x31e/0xd60