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.0.30' (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: [ 50.208284] ================================================================== [ 50.215698] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 50.222421] Write of size 8 at addr ffff8801ce1eb740 by task syzkaller134582/2986 [ 50.230006] [ 50.231606] CPU: 1 PID: 2986 Comm: syzkaller134582 Not tainted 4.14.0-rc2+ #20 [ 50.238935] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.248271] Call Trace: [ 50.250833] dump_stack+0x194/0x257 [ 50.254434] ? arch_local_irq_restore+0x53/0x53 [ 50.259071] ? show_regs_print_info+0x65/0x65 [ 50.263538] ? lock_timer_base+0x1a3/0x2b0 [ 50.267744] ? detach_if_pending+0x557/0x610 [ 50.272123] print_address_description+0x73/0x250 [ 50.276942] ? detach_if_pending+0x557/0x610 [ 50.281321] kasan_report+0x25b/0x340 [ 50.285094] __asan_report_store8_noabort+0x17/0x20 [ 50.290076] detach_if_pending+0x557/0x610 [ 50.294281] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.299441] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.304077] ? lock_timer_base+0x1a3/0x2b0 [ 50.308282] ? lock_timer_base+0x1eb/0x2b0 [ 50.312489] ? __internal_add_timer+0x2d0/0x2d0 [ 50.317130] ? trace_hardirqs_on+0xd/0x10 [ 50.321255] try_to_del_timer_sync+0xa2/0x120 [ 50.325718] ? del_timer+0x130/0x130 [ 50.329402] ? del_timer_sync+0xeb/0x240 [ 50.333437] del_timer_sync+0x18a/0x240 [ 50.337383] tun_free_netdev+0x105/0x1b0 [ 50.341416] ? tun_xdp+0x410/0x410 [ 50.344922] ? cpumask_next+0x24/0x30 [ 50.348697] ? netdev_refcnt_read+0xed/0x150 [ 50.353082] ? tun_xdp+0x410/0x410 [ 50.356591] netdev_run_todo+0x870/0xca0 [ 50.360620] ? do_group_exit+0x149/0x400 [ 50.364657] ? register_netdev+0x30/0x30 [ 50.368692] ? lock_downgrade+0x990/0x990 [ 50.372808] ? trace_hardirqs_on+0xd/0x10 [ 50.376941] ? refcount_sub_and_test+0x115/0x1b0 [ 50.381668] ? refcount_inc+0x50/0x50 [ 50.385438] ? refcount_inc+0x50/0x50 [ 50.389214] ? sk_destruct+0x4c/0x80 [ 50.392900] ? __sk_free+0x5c/0x230 [ 50.396496] ? sk_free+0x2f/0x40 [ 50.399830] ? __tun_detach+0x176/0x1390 [ 50.403873] ? tun_attach+0xf90/0xf90 [ 50.407655] ? locks_remove_file+0x3fa/0x5a0 [ 50.412034] ? fcntl_setlk+0x10d0/0x10d0 [ 50.416070] ? __fsnotify_parent+0xb4/0x3a0 [ 50.420361] ? fsnotify+0x1af0/0x1af0 [ 50.424133] ? __tun_detach+0x1390/0x1390 [ 50.428251] ? __tun_detach+0x1390/0x1390 [ 50.432369] rtnl_unlock+0xe/0x10 [ 50.435790] tun_chr_close+0x49/0x60 [ 50.439481] __fput+0x333/0x7f0 [ 50.442740] ? fput+0x140/0x140 [ 50.445991] ? check_same_owner+0x320/0x320 [ 50.450289] ____fput+0x15/0x20 [ 50.453538] task_work_run+0x199/0x270 [ 50.457402] ? task_work_cancel+0x210/0x210 [ 50.461697] ? free_nsproxy+0x185/0x1f0 [ 50.465640] ? switch_task_namespaces+0xa2/0xc0 [ 50.470287] do_exit+0x9d2/0x1af0 [ 50.473711] ? trace_hardirqs_on+0xd/0x10 [ 50.477834] ? mm_update_next_owner+0x930/0x930 [ 50.482474] ? lock_acquire+0x1d5/0x580 [ 50.486418] ? __handle_mm_fault+0xf07/0x39c0 [ 50.490891] ? lock_release+0xd70/0xd70 [ 50.494833] ? check_noncircular+0x20/0x20 [ 50.499039] ? kvfree+0x3b/0x60 [ 50.502292] ? rtnl_unlock+0xe/0x10 [ 50.505889] ? check_noncircular+0x20/0x20 [ 50.510096] ? __handle_mm_fault+0x587/0x39c0 [ 50.514565] ? __pmd_alloc+0x4e0/0x4e0 [ 50.518435] ? find_held_lock+0x39/0x1d0 [ 50.522476] ? lock_downgrade+0x990/0x990 [ 50.526626] do_group_exit+0x149/0x400 [ 50.530483] ? __handle_mm_fault+0x39c0/0x39c0 [ 50.535034] ? vmacache_find+0x5f/0x280 [ 50.538979] ? SyS_exit+0x30/0x30 [ 50.542406] ? do_fast_syscall_32+0x158/0xf05 [ 50.546869] ? do_group_exit+0x400/0x400 [ 50.550898] SyS_exit_group+0x1d/0x20 [ 50.554668] do_fast_syscall_32+0x3f2/0xf05 [ 50.558967] ? do_int80_syscall_32+0x940/0x940 [ 50.563519] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 50.568249] ? lockdep_sys_exit+0x47/0xf0 [ 50.572366] ? syscall_return_slowpath+0x2b3/0x510 [ 50.577268] ? lockdep_sys_exit+0x47/0xf0 [ 50.581386] ? retint_user+0x18/0x20 [ 50.585075] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.589896] entry_SYSENTER_compat+0x51/0x60 [ 50.594274] RIP: 0023:0xf7f89c79 [ 50.597606] RSP: 002b:00000000ffb0452c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 50.605283] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 50.612521] RDX: 0000000000000000 RSI: 0000000020fbb000 RDI: 00000000400454ca [ 50.619760] RBP: 0000000008072a76 R08: 0000000000000000 R09: 0000000000000000 [ 50.627000] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 50.634240] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 50.641499] [ 50.643098] Allocated by task 2986: [ 50.646697] save_stack_trace+0x16/0x20 [ 50.650642] save_stack+0x43/0xd0 [ 50.654063] kasan_kmalloc+0xad/0xe0 [ 50.657744] __kmalloc_node+0x47/0x70 [ 50.661513] kvmalloc_node+0x64/0xd0 [ 50.665200] alloc_netdev_mqs+0x16e/0xed0 [ 50.669316] __tun_chr_ioctl+0x12be/0x3d20 [ 50.673519] tun_chr_compat_ioctl+0x29/0x30 [ 50.677809] compat_SyS_ioctl+0x1d7/0x3290 [ 50.682012] do_fast_syscall_32+0x3f2/0xf05 [ 50.686301] entry_SYSENTER_compat+0x51/0x60 [ 50.690674] [ 50.692274] Freed by task 2986: [ 50.695522] save_stack_trace+0x16/0x20 [ 50.699463] save_stack+0x43/0xd0 [ 50.702883] kasan_slab_free+0x71/0xc0 [ 50.706737] kfree+0xca/0x250 [ 50.709810] kvfree+0x36/0x60 [ 50.712882] free_netdev+0x2cf/0x360 [ 50.716563] __tun_chr_ioctl+0x2cf6/0x3d20 [ 50.720764] tun_chr_compat_ioctl+0x29/0x30 [ 50.725051] compat_SyS_ioctl+0x1d7/0x3290 [ 50.729254] do_fast_syscall_32+0x3f2/0xf05 [ 50.733542] entry_SYSENTER_compat+0x51/0x60 [ 50.737915] [ 50.739514] The buggy address belongs to the object at ffff8801ce1e8340 [ 50.739514] which belongs to the cache kmalloc-16384 of size 16384 [ 50.752484] The buggy address is located 13312 bytes inside of [ 50.752484] 16384-byte region [ffff8801ce1e8340, ffff8801ce1ec340) [ 50.764671] The buggy address belongs to the page: [ 50.769568] page:ffffea0007387a00 count:1 mapcount:0 mapping:ffff8801ce1e8340 index:0x0 compound_mapcount: 0 [ 50.779510] flags: 0x200000000008100(slab|head) [ 50.784147] raw: 0200000000008100 ffff8801ce1e8340 0000000000000000 0000000100000001 [ 50.791995] raw: ffffea0007392a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 50.799840] page dumped because: kasan: bad access detected [ 50.805525] [ 50.807119] Memory state around the buggy address: [ 50.812014] ffff8801ce1eb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.819339] ffff8801ce1eb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.826667] >ffff8801ce1eb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.833991] ^ [ 50.839406] ffff8801ce1eb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.846732] ffff8801ce1eb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.854056] ================================================================== [ 50.861379] Disabling lock debugging due to kernel taint [ 50.866840] Kernel panic - not syncing: panic_on_warn set ... [ 50.866840] [ 50.874171] CPU: 1 PID: 2986 Comm: syzkaller134582 Tainted: G B 4.14.0-rc2+ #20 [ 50.882708] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.892023] Call Trace: [ 50.894574] dump_stack+0x194/0x257 [ 50.898167] ? arch_local_irq_restore+0x53/0x53 [ 50.902799] ? vprintk_default+0x28/0x30 [ 50.906824] ? detach_if_pending+0x4d0/0x610 [ 50.911200] panic+0x1e4/0x417 [ 50.914355] ? __warn+0x1d9/0x1d9 [ 50.917778] ? detach_if_pending+0x557/0x610 [ 50.922149] kasan_end_report+0x50/0x50 [ 50.926085] kasan_report+0x144/0x340 [ 50.929851] __asan_report_store8_noabort+0x17/0x20 [ 50.934828] detach_if_pending+0x557/0x610 [ 50.939026] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.944178] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.948810] ? lock_timer_base+0x1a3/0x2b0 [ 50.953008] ? lock_timer_base+0x1eb/0x2b0 [ 50.957205] ? __internal_add_timer+0x2d0/0x2d0 [ 50.961839] ? trace_hardirqs_on+0xd/0x10 [ 50.965951] try_to_del_timer_sync+0xa2/0x120 [ 50.970408] ? del_timer+0x130/0x130 [ 50.974086] ? del_timer_sync+0xeb/0x240 [ 50.978112] del_timer_sync+0x18a/0x240 [ 50.982050] tun_free_netdev+0x105/0x1b0 [ 50.986074] ? tun_xdp+0x410/0x410 [ 50.989575] ? cpumask_next+0x24/0x30 [ 50.993339] ? netdev_refcnt_read+0xed/0x150 [ 50.997714] ? tun_xdp+0x410/0x410 [ 51.001219] netdev_run_todo+0x870/0xca0 [ 51.005242] ? do_group_exit+0x149/0x400 [ 51.009267] ? register_netdev+0x30/0x30 [ 51.013291] ? lock_downgrade+0x990/0x990 [ 51.017403] ? trace_hardirqs_on+0xd/0x10 [ 51.021523] ? refcount_sub_and_test+0x115/0x1b0 [ 51.026240] ? refcount_inc+0x50/0x50 [ 51.030002] ? refcount_inc+0x50/0x50 [ 51.033767] ? sk_destruct+0x4c/0x80 [ 51.037445] ? __sk_free+0x5c/0x230 [ 51.041036] ? sk_free+0x2f/0x40 [ 51.044367] ? __tun_detach+0x176/0x1390 [ 51.048397] ? tun_attach+0xf90/0xf90 [ 51.052165] ? locks_remove_file+0x3fa/0x5a0 [ 51.056538] ? fcntl_setlk+0x10d0/0x10d0 [ 51.060564] ? __fsnotify_parent+0xb4/0x3a0 [ 51.064852] ? fsnotify+0x1af0/0x1af0 [ 51.068616] ? __tun_detach+0x1390/0x1390 [ 51.072726] ? __tun_detach+0x1390/0x1390 [ 51.076836] rtnl_unlock+0xe/0x10 [ 51.080252] tun_chr_close+0x49/0x60 [ 51.083928] __fput+0x333/0x7f0 [ 51.087173] ? fput+0x140/0x140 [ 51.090420] ? check_same_owner+0x320/0x320 [ 51.094708] ____fput+0x15/0x20 [ 51.097951] task_work_run+0x199/0x270 [ 51.101802] ? task_work_cancel+0x210/0x210 [ 51.106086] ? free_nsproxy+0x185/0x1f0 [ 51.110024] ? switch_task_namespaces+0xa2/0xc0 [ 51.114656] do_exit+0x9d2/0x1af0 [ 51.118071] ? trace_hardirqs_on+0xd/0x10 [ 51.122182] ? mm_update_next_owner+0x930/0x930 [ 51.126812] ? lock_acquire+0x1d5/0x580 [ 51.130750] ? __handle_mm_fault+0xf07/0x39c0 [ 51.135211] ? lock_release+0xd70/0xd70 [ 51.139148] ? check_noncircular+0x20/0x20 [ 51.143345] ? kvfree+0x3b/0x60 [ 51.146591] ? rtnl_unlock+0xe/0x10 [ 51.150181] ? check_noncircular+0x20/0x20 [ 51.154381] ? __handle_mm_fault+0x587/0x39c0 [ 51.158840] ? __pmd_alloc+0x4e0/0x4e0 [ 51.162694] ? find_held_lock+0x39/0x1d0 [ 51.166722] ? lock_downgrade+0x990/0x990 [ 51.170848] do_group_exit+0x149/0x400 [ 51.174698] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.179241] ? vmacache_find+0x5f/0x280 [ 51.183178] ? SyS_exit+0x30/0x30 [ 51.186601] ? do_fast_syscall_32+0x158/0xf05 [ 51.191060] ? do_group_exit+0x400/0x400 [ 51.195086] SyS_exit_group+0x1d/0x20 [ 51.198851] do_fast_syscall_32+0x3f2/0xf05 [ 51.203137] ? do_int80_syscall_32+0x940/0x940 [ 51.207691] ? trace_hardirqs_on_thunk+0x1a/0x1c