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-4,10.128.0.5' (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.150372] ================================================================== [ 30.151488] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 30.152380] Write of size 8 at addr ffff8801ce7bb740 by task syzkaller176347/2982 [ 30.153379] [ 30.153616] CPU: 1 PID: 2982 Comm: syzkaller176347 Not tainted 4.14.0-rc2+ #21 [ 30.154584] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.155828] Call Trace: [ 30.156194] dump_stack+0x194/0x257 [ 30.156691] ? arch_local_irq_restore+0x53/0x53 [ 30.157317] ? show_regs_print_info+0x65/0x65 [ 30.157922] ? lock_timer_base+0x1a3/0x2b0 [ 30.158494] ? detach_if_pending+0x557/0x610 [ 30.159090] print_address_description+0x73/0x250 [ 30.159743] ? detach_if_pending+0x557/0x610 [ 30.160337] kasan_report+0x25b/0x340 [ 30.160868] __asan_report_store8_noabort+0x17/0x20 [ 30.161537] detach_if_pending+0x557/0x610 [ 30.162111] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.162869] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.163512] ? lock_timer_base+0x1a3/0x2b0 [ 30.164082] ? lock_timer_base+0x1eb/0x2b0 [ 30.164656] ? __internal_add_timer+0x2d0/0x2d0 [ 30.165284] ? trace_hardirqs_on+0xd/0x10 [ 30.165853] try_to_del_timer_sync+0xa2/0x120 [ 30.166459] ? del_timer+0x130/0x130 [ 30.166966] ? del_timer_sync+0xeb/0x240 [ 30.167521] del_timer_sync+0x18a/0x240 [ 30.168062] tun_free_netdev+0x105/0x1b0 [ 30.168609] ? tun_xdp+0x410/0x410 [ 30.169089] ? cpumask_next+0x24/0x30 [ 30.169660] ? netdev_refcnt_read+0xed/0x150 [ 30.170273] ? tun_xdp+0x410/0x410 [ 30.172398] netdev_run_todo+0x870/0xca0 [ 30.176432] ? do_group_exit+0x149/0x400 [ 30.180472] ? register_netdev+0x30/0x30 [ 30.184505] ? lock_downgrade+0x990/0x990 [ 30.188622] ? trace_hardirqs_on+0xd/0x10 [ 30.192757] ? refcount_sub_and_test+0x115/0x1b0 [ 30.197483] ? refcount_inc+0x50/0x50 [ 30.201251] ? refcount_inc+0x50/0x50 [ 30.205029] ? sk_destruct+0x4c/0x80 [ 30.208711] ? __sk_free+0x5c/0x230 [ 30.212310] ? sk_free+0x2f/0x40 [ 30.215645] ? __tun_detach+0x176/0x1390 [ 30.219689] ? tun_attach+0xf90/0xf90 [ 30.223469] ? locks_remove_file+0x3fa/0x5a0 [ 30.227851] ? fcntl_setlk+0x10d0/0x10d0 [ 30.231888] ? __fsnotify_parent+0xb4/0x3a0 [ 30.236182] ? fsnotify+0x1af0/0x1af0 [ 30.239960] ? __tun_detach+0x1390/0x1390 [ 30.244078] ? __tun_detach+0x1390/0x1390 [ 30.248200] rtnl_unlock+0xe/0x10 [ 30.251621] tun_chr_close+0x49/0x60 [ 30.255303] __fput+0x333/0x7f0 [ 30.258557] ? fput+0x140/0x140 [ 30.261811] ? check_same_owner+0x320/0x320 [ 30.266108] ____fput+0x15/0x20 [ 30.269357] task_work_run+0x199/0x270 [ 30.273220] ? task_work_cancel+0x210/0x210 [ 30.277518] ? free_nsproxy+0x185/0x1f0 [ 30.281465] ? switch_task_namespaces+0xa2/0xc0 [ 30.286106] do_exit+0x9d2/0x1af0 [ 30.289528] ? __handle_mm_fault+0xf07/0x39c0 [ 30.294000] ? mm_update_next_owner+0x930/0x930 [ 30.298647] ? lock_release+0xd70/0xd70 [ 30.302592] ? check_noncircular+0x20/0x20 [ 30.306797] ? kfree+0xe4/0x250 [ 30.310046] ? kvfree+0x36/0x60 [ 30.313315] ? trace_hardirqs_on+0xd/0x10 [ 30.317437] ? check_noncircular+0x20/0x20 [ 30.321644] ? __handle_mm_fault+0x587/0x39c0 [ 30.326113] ? __pmd_alloc+0x4e0/0x4e0 [ 30.329993] ? find_held_lock+0x39/0x1d0 [ 30.334035] ? lock_downgrade+0x990/0x990 [ 30.338176] ? handle_mm_fault+0x410/0x8d0 [ 30.342380] ? down_read_trylock+0xdb/0x170 [ 30.346673] ? __do_page_fault+0x31e/0xd60 [ 30.350880] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.355433] ? vmacache_find+0x5f/0x280 [ 30.359375] ? vmacache_update+0xfe/0x130 [ 30.363499] do_group_exit+0x149/0x400 [ 30.367364] ? __do_page_fault+0x3d6/0xd60 [ 30.371569] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 30.375948] ? SyS_exit+0x30/0x30 [ 30.379376] ? do_fast_syscall_32+0x158/0xf05 [ 30.383840] ? do_group_exit+0x400/0x400 [ 30.387870] SyS_exit_group+0x1d/0x20 [ 30.391644] do_fast_syscall_32+0x3f2/0xf05 [ 30.395954] ? do_int80_syscall_32+0x940/0x940 [ 30.400506] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 30.405234] ? lockdep_sys_exit+0x47/0xf0 [ 30.409351] ? syscall_return_slowpath+0x2b3/0x510 [ 30.414253] ? lockdep_sys_exit+0x47/0xf0 [ 30.418372] ? retint_user+0x18/0x20 [ 30.422063] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.426886] entry_SYSENTER_compat+0x51/0x60 [ 30.431265] RIP: 0023:0xf7fa4c79 [ 30.434600] RSP: 002b:00000000ffd6701c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 30.442280] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 30.449520] RDX: 0000000000000000 RSI: 0000000020d8bfd8 RDI: 00000000400454ca [ 30.456756] RBP: 0000000008072976 R08: 0000000000000000 R09: 0000000000000000 [ 30.463995] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 30.471232] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 30.478490] [ 30.480089] Allocated by task 2982: [ 30.483685] save_stack_trace+0x16/0x20 [ 30.487629] save_stack+0x43/0xd0 [ 30.491050] kasan_kmalloc+0xad/0xe0 [ 30.494732] __kmalloc_node+0x47/0x70 [ 30.498503] kvmalloc_node+0x64/0xd0 [ 30.502185] alloc_netdev_mqs+0x16e/0xed0 [ 30.506304] __tun_chr_ioctl+0x12be/0x3d20 [ 30.510507] tun_chr_compat_ioctl+0x29/0x30 [ 30.514801] compat_SyS_ioctl+0x1d7/0x3290 [ 30.519006] do_fast_syscall_32+0x3f2/0xf05 [ 30.523295] entry_SYSENTER_compat+0x51/0x60 [ 30.527668] [ 30.529264] Freed by task 2982: [ 30.532509] save_stack_trace+0x16/0x20 [ 30.536450] save_stack+0x43/0xd0 [ 30.539869] kasan_slab_free+0x71/0xc0 [ 30.543725] kfree+0xca/0x250 [ 30.546799] kvfree+0x36/0x60 [ 30.549874] free_netdev+0x2cf/0x360 [ 30.553561] __tun_chr_ioctl+0x2cf6/0x3d20 [ 30.557764] tun_chr_compat_ioctl+0x29/0x30 [ 30.562055] compat_SyS_ioctl+0x1d7/0x3290 [ 30.566255] do_fast_syscall_32+0x3f2/0xf05 [ 30.570544] entry_SYSENTER_compat+0x51/0x60 [ 30.574919] [ 30.576518] The buggy address belongs to the object at ffff8801ce7b8340 [ 30.576518] which belongs to the cache kmalloc-16384 of size 16384 [ 30.589488] The buggy address is located 13312 bytes inside of [ 30.589488] 16384-byte region [ffff8801ce7b8340, ffff8801ce7bc340) [ 30.601677] The buggy address belongs to the page: [ 30.606574] page:ffffea000739ee00 count:1 mapcount:0 mapping:ffff8801ce7b8340 index:0x0 compound_mapcount: 0 [ 30.616516] flags: 0x200000000008100(slab|head) [ 30.621153] raw: 0200000000008100 ffff8801ce7b8340 0000000000000000 0000000100000001 [ 30.629010] raw: ffffea0007024420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 30.636864] page dumped because: kasan: bad access detected [ 30.642544] [ 30.644142] Memory state around the buggy address: [ 30.649037] ffff8801ce7bb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.656372] ffff8801ce7bb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.663700] >ffff8801ce7bb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.671025] ^ [ 30.676442] ffff8801ce7bb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.683769] ffff8801ce7bb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.691095] ================================================================== [ 30.698419] Disabling lock debugging due to kernel taint [ 30.703831] Kernel panic - not syncing: panic_on_warn set ... [ 30.703831] [ 30.711155] CPU: 1 PID: 2982 Comm: syzkaller176347 Tainted: G B 4.14.0-rc2+ #21 [ 30.719691] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.729007] Call Trace: [ 30.731560] dump_stack+0x194/0x257 [ 30.735240] ? arch_local_irq_restore+0x53/0x53 [ 30.739873] ? vprintk_default+0x28/0x30 [ 30.743903] ? detach_if_pending+0x500/0x610 [ 30.748276] panic+0x1e4/0x417 [ 30.751432] ? __warn+0x1d9/0x1d9 [ 30.754856] ? detach_if_pending+0x557/0x610 [ 30.759228] kasan_end_report+0x50/0x50 [ 30.763166] kasan_report+0x144/0x340 [ 30.766933] __asan_report_store8_noabort+0x17/0x20 [ 30.771914] detach_if_pending+0x557/0x610 [ 30.776127] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.781285] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.785916] ? lock_timer_base+0x1a3/0x2b0 [ 30.790115] ? lock_timer_base+0x1eb/0x2b0 [ 30.794316] ? __internal_add_timer+0x2d0/0x2d0 [ 30.798955] ? trace_hardirqs_on+0xd/0x10 [ 30.803069] try_to_del_timer_sync+0xa2/0x120 [ 30.807527] ? del_timer+0x130/0x130 [ 30.811205] ? del_timer_sync+0xeb/0x240 [ 30.815235] del_timer_sync+0x18a/0x240 [ 30.819174] tun_free_netdev+0x105/0x1b0 [ 30.823197] ? tun_xdp+0x410/0x410 [ 30.826699] ? cpumask_next+0x24/0x30 [ 30.830465] ? netdev_refcnt_read+0xed/0x150 [ 30.834848] ? tun_xdp+0x410/0x410 [ 30.838353] netdev_run_todo+0x870/0xca0 [ 30.842375] ? do_group_exit+0x149/0x400 [ 30.846402] ? register_netdev+0x30/0x30 [ 30.850426] ? lock_downgrade+0x990/0x990 [ 30.854538] ? trace_hardirqs_on+0xd/0x10 [ 30.858657] ? refcount_sub_and_test+0x115/0x1b0 [ 30.863377] ? refcount_inc+0x50/0x50 [ 30.867143] ? refcount_inc+0x50/0x50 [ 30.870911] ? sk_destruct+0x4c/0x80 [ 30.874588] ? __sk_free+0x5c/0x230 [ 30.878186] ? sk_free+0x2f/0x40 [ 30.881515] ? __tun_detach+0x176/0x1390 [ 30.885543] ? tun_attach+0xf90/0xf90 [ 30.889312] ? locks_remove_file+0x3fa/0x5a0 [ 30.893698] ? fcntl_setlk+0x10d0/0x10d0 [ 30.897734] ? __fsnotify_parent+0xb4/0x3a0 [ 30.902018] ? fsnotify+0x1af0/0x1af0 [ 30.905783] ? __tun_detach+0x1390/0x1390 [ 30.909895] ? __tun_detach+0x1390/0x1390 [ 30.914007] rtnl_unlock+0xe/0x10 [ 30.917424] tun_chr_close+0x49/0x60 [ 30.921108] __fput+0x333/0x7f0 [ 30.924352] ? fput+0x140/0x140 [ 30.927598] ? check_same_owner+0x320/0x320 [ 30.931888] ____fput+0x15/0x20 [ 30.935132] task_work_run+0x199/0x270 [ 30.938984] ? task_work_cancel+0x210/0x210 [ 30.943270] ? free_nsproxy+0x185/0x1f0 [ 30.947207] ? switch_task_namespaces+0xa2/0xc0 [ 30.951842] do_exit+0x9d2/0x1af0 [ 30.955258] ? __handle_mm_fault+0xf07/0x39c0 [ 30.959719] ? mm_update_next_owner+0x930/0x930 [ 30.964351] ? lock_release+0xd70/0xd70 [ 30.968287] ? check_noncircular+0x20/0x20 [ 30.972484] ? kfree+0xe4/0x250 [ 30.975729] ? kvfree+0x36/0x60 [ 30.978973] ? trace_hardirqs_on+0xd/0x10 [ 30.983088] ? check_noncircular+0x20/0x20 [ 30.987287] ? __handle_mm_fault+0x587/0x39c0 [ 30.991748] ? __pmd_alloc+0x4e0/0x4e0 [ 30.995604] ? find_held_lock+0x39/0x1d0 [ 30.999633] ? lock_downgrade+0x990/0x990 [ 31.003757] ? handle_mm_fault+0x410/0x8d0 [ 31.007953] ? down_read_trylock+0xdb/0x170 [ 31.012238] ? __do_page_fault+0x31e/0xd60 [ 31.016435] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.020978] ? vmacache_find+0x5f/0x280 [ 31.024916] ? vmacache_update+0xfe/0x130 [ 31.029030] do_group_exit+0x149/0x400 [ 31.032880] ? __do_page_fault+0x3d6/0xd60 [ 31.037076] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 31.041445] ? SyS_exit+0x30/0x30 [ 31.044874] ? do_fast_syscall_32+0x158/0xf05 [ 31.049334] ? do_group_exit+0x400/0x400 [ 31.053360] SyS_exit_group+0x1d/0x20 [ 31.057125] do_fast_syscall_32+0x3f2/0xf05 [ 31.061413] ? do_int80_syscall_32+0x940/0x940 [ 31.065959] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.070679] ? lockdep_sys_exit+0x47/0xf0 [ 31.074795] ? syscall_return_slowpath+0x2b3/0x510 [ 31.079706] ? lockdep_sys_exit+0x47/0xf0 [ 31.083828] ? retint_user+0x18/0x20 [ 31.087509] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 31.092319] entry_SYSENTER_compat+0x51/0x60 [ 31.096691] RIP: 0023:0xf7fa4c79 [ 31.100018] RSP: 002b:00000000ffd6701c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 31.107688] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 31.114921] RDX: 0000000000000000 RSI: 0000000020d8bfd8 RDI: 00000000400454ca [ 31.122153] RBP: 0000000008072976 R08: 0000000000000000 R09: 0000000000000000 [ 31.129387] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 31.136619] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000