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.12' (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: [ 44.808451] ================================================================== [ 44.809558] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 44.810453] Write of size 8 at addr ffff8801ce71b780 by task syzkaller670154/2984 [ 44.811451] [ 44.811690] CPU: 0 PID: 2984 Comm: syzkaller670154 Not tainted 4.14.0-rc2+ #20 [ 44.812657] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 44.813879] Call Trace: [ 44.814253] dump_stack+0x194/0x257 [ 44.814750] ? arch_local_irq_restore+0x53/0x53 [ 44.815420] ? show_regs_print_info+0x65/0x65 [ 44.816027] ? lock_timer_base+0x1a3/0x2b0 [ 44.816601] ? detach_if_pending+0x557/0x610 [ 44.817197] print_address_description+0x73/0x250 [ 44.817844] ? detach_if_pending+0x557/0x610 [ 44.818437] kasan_report+0x25b/0x340 [ 44.818957] __asan_report_store8_noabort+0x17/0x20 [ 44.819626] detach_if_pending+0x557/0x610 [ 44.820197] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.820891] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.821513] ? lock_timer_base+0x1a3/0x2b0 [ 44.822083] ? lock_timer_base+0x1eb/0x2b0 [ 44.822657] ? __internal_add_timer+0x2d0/0x2d0 [ 44.823287] ? trace_hardirqs_on+0xd/0x10 [ 44.823855] try_to_del_timer_sync+0xa2/0x120 [ 44.824458] ? del_timer+0x130/0x130 [ 44.824962] ? del_timer_sync+0xeb/0x240 [ 44.825515] del_timer_sync+0x18a/0x240 [ 44.826055] tun_free_netdev+0x105/0x1b0 [ 44.826736] ? tun_xdp+0x410/0x410 [ 44.827218] ? cpumask_next+0x24/0x30 [ 44.827753] ? netdev_refcnt_read+0xed/0x150 [ 44.828348] ? tun_xdp+0x410/0x410 [ 44.828829] netdev_run_todo+0x870/0xca0 [ 44.832860] ? do_group_exit+0x149/0x400 [ 44.836895] ? register_netdev+0x30/0x30 [ 44.840927] ? lock_downgrade+0x990/0x990 [ 44.845046] ? trace_hardirqs_on+0xd/0x10 [ 44.849193] ? refcount_sub_and_test+0x115/0x1b0 [ 44.853921] ? refcount_inc+0x50/0x50 [ 44.857689] ? refcount_inc+0x50/0x50 [ 44.861465] ? sk_destruct+0x4c/0x80 [ 44.865148] ? __sk_free+0x5c/0x230 [ 44.868744] ? sk_free+0x2f/0x40 [ 44.872078] ? __tun_detach+0x176/0x1390 [ 44.876120] ? tun_attach+0xf90/0xf90 [ 44.879900] ? locks_remove_file+0x3fa/0x5a0 [ 44.884281] ? fcntl_setlk+0x10d0/0x10d0 [ 44.888315] ? __fsnotify_parent+0xb4/0x3a0 [ 44.892608] ? fsnotify+0x1af0/0x1af0 [ 44.896381] ? __tun_detach+0x1390/0x1390 [ 44.900499] ? __tun_detach+0x1390/0x1390 [ 44.904617] rtnl_unlock+0xe/0x10 [ 44.908039] tun_chr_close+0x49/0x60 [ 44.911722] __fput+0x333/0x7f0 [ 44.914978] ? fput+0x140/0x140 [ 44.918231] ? check_same_owner+0x320/0x320 [ 44.922529] ____fput+0x15/0x20 [ 44.925779] task_work_run+0x199/0x270 [ 44.929641] ? task_work_cancel+0x210/0x210 [ 44.933934] ? free_nsproxy+0x185/0x1f0 [ 44.937880] ? switch_task_namespaces+0xa2/0xc0 [ 44.942525] do_exit+0x9d2/0x1af0 [ 44.945947] ? trace_hardirqs_on+0xd/0x10 [ 44.950070] ? mm_update_next_owner+0x930/0x930 [ 44.954709] ? lock_acquire+0x1d5/0x580 [ 44.958651] ? __handle_mm_fault+0xf07/0x39c0 [ 44.963125] ? lock_release+0xd70/0xd70 [ 44.967069] ? check_noncircular+0x20/0x20 [ 44.971274] ? kvfree+0x3b/0x60 [ 44.974526] ? rtnl_unlock+0xe/0x10 [ 44.978127] ? check_noncircular+0x20/0x20 [ 44.982333] ? __handle_mm_fault+0x587/0x39c0 [ 44.986800] ? __pmd_alloc+0x4e0/0x4e0 [ 44.990666] ? find_held_lock+0x39/0x1d0 [ 44.994705] ? lock_downgrade+0x990/0x990 [ 44.998847] do_group_exit+0x149/0x400 [ 45.002700] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.007252] ? vmacache_find+0x5f/0x280 [ 45.011194] ? SyS_exit+0x30/0x30 [ 45.014620] ? do_fast_syscall_32+0x158/0xf05 [ 45.019083] ? do_group_exit+0x400/0x400 [ 45.023113] SyS_exit_group+0x1d/0x20 [ 45.026881] do_fast_syscall_32+0x3f2/0xf05 [ 45.031181] ? do_int80_syscall_32+0x940/0x940 [ 45.035736] ? lockdep_sys_exit+0x47/0xf0 [ 45.039852] ? syscall_return_slowpath+0x2b3/0x510 [ 45.044747] ? finish_task_switch+0x1aa/0x740 [ 45.049214] ? lockdep_sys_exit+0x47/0xf0 [ 45.053332] ? retint_user+0x18/0x20 [ 45.057019] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 45.061837] entry_SYSENTER_compat+0x51/0x60 [ 45.066213] RIP: 0023:0xf7f8bc79 [ 45.069544] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 45.077225] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 45.084475] RDX: 0000000000000001 RSI: 0000000020115000 RDI: 00000000400454ca [ 45.091715] RBP: 0000000008072cc6 R08: 0000000000000000 R09: 0000000000000000 [ 45.098953] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 45.106192] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 45.113449] [ 45.115044] Allocated by task 2984: [ 45.118640] save_stack_trace+0x16/0x20 [ 45.122583] save_stack+0x43/0xd0 [ 45.126006] kasan_kmalloc+0xad/0xe0 [ 45.129687] __kmalloc_node+0x47/0x70 [ 45.133455] kvmalloc_node+0x64/0xd0 [ 45.137137] alloc_netdev_mqs+0x16e/0xed0 [ 45.141253] __tun_chr_ioctl+0x12be/0x3d20 [ 45.145453] tun_chr_compat_ioctl+0x29/0x30 [ 45.149742] compat_SyS_ioctl+0x1d7/0x3290 [ 45.153943] do_fast_syscall_32+0x3f2/0xf05 [ 45.158231] entry_SYSENTER_compat+0x51/0x60 [ 45.162604] [ 45.164200] Freed by task 2984: [ 45.167447] save_stack_trace+0x16/0x20 [ 45.171389] save_stack+0x43/0xd0 [ 45.174808] kasan_slab_free+0x71/0xc0 [ 45.178661] kfree+0xca/0x250 [ 45.181732] kvfree+0x36/0x60 [ 45.184804] free_netdev+0x2cf/0x360 [ 45.188483] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.192683] tun_chr_compat_ioctl+0x29/0x30 [ 45.196972] compat_SyS_ioctl+0x1d7/0x3290 [ 45.201176] do_fast_syscall_32+0x3f2/0xf05 [ 45.205465] entry_SYSENTER_compat+0x51/0x60 [ 45.209836] [ 45.211433] The buggy address belongs to the object at ffff8801ce718380 [ 45.211433] which belongs to the cache kmalloc-16384 of size 16384 [ 45.224401] The buggy address is located 13312 bytes inside of [ 45.224401] 16384-byte region [ffff8801ce718380, ffff8801ce71c380) [ 45.236585] The buggy address belongs to the page: [ 45.241482] page:ffffea000739c600 count:1 mapcount:0 mapping:ffff8801ce718380 index:0x0 compound_mapcount: 0 [ 45.251423] flags: 0x200000000008100(slab|head) [ 45.256061] raw: 0200000000008100 ffff8801ce718380 0000000000000000 0000000100000001 [ 45.263909] raw: ffffea000738da20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.271753] page dumped because: kasan: bad access detected [ 45.277428] [ 45.279023] Memory state around the buggy address: [ 45.283918] ffff8801ce71b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.291245] ffff8801ce71b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.298571] >ffff8801ce71b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.305896] ^ [ 45.309228] ffff8801ce71b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.316552] ffff8801ce71b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.323877] ================================================================== [ 45.331209] Disabling lock debugging due to kernel taint [ 45.336618] Kernel panic - not syncing: panic_on_warn set ... [ 45.336618] [ 45.343946] CPU: 0 PID: 2984 Comm: syzkaller670154 Tainted: G B 4.14.0-rc2+ #20 [ 45.352480] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.361796] Call Trace: [ 45.364347] dump_stack+0x194/0x257 [ 45.367937] ? arch_local_irq_restore+0x53/0x53 [ 45.372571] ? vprintk_default+0x28/0x30 [ 45.376596] ? detach_if_pending+0x4d0/0x610 [ 45.380967] panic+0x1e4/0x417 [ 45.384122] ? __warn+0x1d9/0x1d9 [ 45.387544] ? detach_if_pending+0x557/0x610 [ 45.391914] kasan_end_report+0x50/0x50 [ 45.395850] kasan_report+0x144/0x340 [ 45.399616] __asan_report_store8_noabort+0x17/0x20 [ 45.404592] detach_if_pending+0x557/0x610 [ 45.408793] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.413947] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.418577] ? lock_timer_base+0x1a3/0x2b0 [ 45.422773] ? lock_timer_base+0x1eb/0x2b0 [ 45.426971] ? __internal_add_timer+0x2d0/0x2d0 [ 45.431602] ? trace_hardirqs_on+0xd/0x10 [ 45.435717] try_to_del_timer_sync+0xa2/0x120 [ 45.440175] ? del_timer+0x130/0x130 [ 45.443851] ? del_timer_sync+0xeb/0x240 [ 45.447878] del_timer_sync+0x18a/0x240 [ 45.451815] tun_free_netdev+0x105/0x1b0 [ 45.455840] ? tun_xdp+0x410/0x410 [ 45.459341] ? cpumask_next+0x24/0x30 [ 45.463104] ? netdev_refcnt_read+0xed/0x150 [ 45.467477] ? tun_xdp+0x410/0x410 [ 45.470979] netdev_run_todo+0x870/0xca0 [ 45.475001] ? do_group_exit+0x149/0x400 [ 45.479029] ? register_netdev+0x30/0x30 [ 45.483057] ? lock_downgrade+0x990/0x990 [ 45.487169] ? trace_hardirqs_on+0xd/0x10 [ 45.491289] ? refcount_sub_and_test+0x115/0x1b0 [ 45.496007] ? refcount_inc+0x50/0x50 [ 45.499770] ? refcount_inc+0x50/0x50 [ 45.503535] ? sk_destruct+0x4c/0x80 [ 45.507212] ? __sk_free+0x5c/0x230 [ 45.510803] ? sk_free+0x2f/0x40 [ 45.514131] ? __tun_detach+0x176/0x1390 [ 45.518168] ? tun_attach+0xf90/0xf90 [ 45.521936] ? locks_remove_file+0x3fa/0x5a0 [ 45.526703] ? fcntl_setlk+0x10d0/0x10d0 [ 45.530729] ? __fsnotify_parent+0xb4/0x3a0 [ 45.535014] ? fsnotify+0x1af0/0x1af0 [ 45.538780] ? __tun_detach+0x1390/0x1390 [ 45.542890] ? __tun_detach+0x1390/0x1390 [ 45.547003] rtnl_unlock+0xe/0x10 [ 45.550421] tun_chr_close+0x49/0x60 [ 45.554097] __fput+0x333/0x7f0 [ 45.557343] ? fput+0x140/0x140 [ 45.560588] ? check_same_owner+0x320/0x320 [ 45.564875] ____fput+0x15/0x20 [ 45.568120] task_work_run+0x199/0x270 [ 45.571971] ? task_work_cancel+0x210/0x210 [ 45.576256] ? free_nsproxy+0x185/0x1f0 [ 45.580193] ? switch_task_namespaces+0xa2/0xc0 [ 45.584825] do_exit+0x9d2/0x1af0 [ 45.588241] ? trace_hardirqs_on+0xd/0x10 [ 45.592352] ? mm_update_next_owner+0x930/0x930 [ 45.596984] ? lock_acquire+0x1d5/0x580 [ 45.600919] ? __handle_mm_fault+0xf07/0x39c0 [ 45.605380] ? lock_release+0xd70/0xd70 [ 45.609318] ? check_noncircular+0x20/0x20 [ 45.613515] ? kvfree+0x3b/0x60 [ 45.616758] ? rtnl_unlock+0xe/0x10 [ 45.620348] ? check_noncircular+0x20/0x20 [ 45.624545] ? __handle_mm_fault+0x587/0x39c0 [ 45.629004] ? __pmd_alloc+0x4e0/0x4e0 [ 45.632860] ? find_held_lock+0x39/0x1d0 [ 45.636888] ? lock_downgrade+0x990/0x990 [ 45.641010] do_group_exit+0x149/0x400 [ 45.644857] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.649401] ? vmacache_find+0x5f/0x280 [ 45.653339] ? SyS_exit+0x30/0x30 [ 45.656760] ? do_fast_syscall_32+0x158/0xf05 [ 45.661217] ? do_group_exit+0x400/0x400 [ 45.665240] SyS_exit_group+0x1d/0x20 [ 45.669003] do_fast_syscall_32+0x3f2/0xf05 [ 45.673291] ? do_int80_syscall_32+0x940/0x940 [ 45.677838] ? lockdep_sys_exit+0x47/0xf0 [ 45.681947] ? syscall_return_slowpath+0x2b3/0x510 [ 45.686839] ? finish_task_switch+0x1aa/0x740 [ 45.691300] ? lockdep_sys_exit+0x47/0xf0 [ 45.695411] ? retint_user+0x18/0x20 [ 45.699093] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 45.703906] entry_SYSENTER_compat+0x51/0x60 [ 45.708275] RIP: 0023:0xf7f8bc79 [ 45.711601] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 45.719272] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 45.726504] RDX: 0000000000000001 RSI: 0000000020115000 RDI: 00000000400454ca [ 45.733737] RBP: 0000000008072cc6 R08: 0000000000000000 R09: 0000000000000000 [ 45.740969] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 45.748201] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000