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.15.192' (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: [ 36.007278] ================================================================== [ 36.014693] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 36.021416] Write of size 8 at addr ffff8801ce9e3740 by task syzkaller494080/2982 [ 36.029003] [ 36.030603] CPU: 1 PID: 2982 Comm: syzkaller494080 Not tainted 4.14.0-rc2+ #20 [ 36.037931] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.047267] Call Trace: [ 36.049828] dump_stack+0x194/0x257 [ 36.053428] ? arch_local_irq_restore+0x53/0x53 [ 36.058075] ? show_regs_print_info+0x65/0x65 [ 36.062548] ? lock_timer_base+0x1a3/0x2b0 [ 36.066755] ? detach_if_pending+0x557/0x610 [ 36.071137] print_address_description+0x73/0x250 [ 36.075952] ? detach_if_pending+0x557/0x610 [ 36.080332] kasan_report+0x25b/0x340 [ 36.084112] __asan_report_store8_noabort+0x17/0x20 [ 36.089096] detach_if_pending+0x557/0x610 [ 36.093301] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.098461] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.103099] ? lock_timer_base+0x1a3/0x2b0 [ 36.107305] ? lock_timer_base+0x1eb/0x2b0 [ 36.111522] ? __internal_add_timer+0x2d0/0x2d0 [ 36.116164] ? trace_hardirqs_on+0xd/0x10 [ 36.120289] try_to_del_timer_sync+0xa2/0x120 [ 36.124753] ? del_timer+0x130/0x130 [ 36.128438] ? del_timer_sync+0xeb/0x240 [ 36.132982] del_timer_sync+0x18a/0x240 [ 36.136933] tun_free_netdev+0x105/0x1b0 [ 36.140965] ? tun_xdp+0x410/0x410 [ 36.144475] ? cpumask_next+0x24/0x30 [ 36.148247] ? netdev_refcnt_read+0xed/0x150 [ 36.152629] ? tun_xdp+0x410/0x410 [ 36.156145] netdev_run_todo+0x870/0xca0 [ 36.160177] ? do_group_exit+0x149/0x400 [ 36.164215] ? register_netdev+0x30/0x30 [ 36.168252] ? lock_downgrade+0x990/0x990 [ 36.172369] ? trace_hardirqs_on+0xd/0x10 [ 36.176505] ? refcount_sub_and_test+0x115/0x1b0 [ 36.181229] ? refcount_inc+0x50/0x50 [ 36.185000] ? refcount_inc+0x50/0x50 [ 36.188775] ? sk_destruct+0x4c/0x80 [ 36.192458] ? __sk_free+0x5c/0x230 [ 36.196053] ? sk_free+0x2f/0x40 [ 36.199391] ? __tun_detach+0x176/0x1390 [ 36.203431] ? tun_attach+0xf90/0xf90 [ 36.207204] ? do_raw_spin_trylock+0x190/0x190 [ 36.211758] ? locks_remove_file+0x3fa/0x5a0 [ 36.216141] ? fcntl_setlk+0x10d0/0x10d0 [ 36.220182] ? __fsnotify_parent+0xb4/0x3a0 [ 36.224474] ? fsnotify+0x1af0/0x1af0 [ 36.228247] ? __tun_detach+0x1390/0x1390 [ 36.232363] ? __tun_detach+0x1390/0x1390 [ 36.236480] rtnl_unlock+0xe/0x10 [ 36.239902] tun_chr_close+0x49/0x60 [ 36.243593] __fput+0x333/0x7f0 [ 36.246851] ? fput+0x140/0x140 [ 36.250103] ? check_same_owner+0x320/0x320 [ 36.254392] ? _raw_spin_unlock_irq+0x27/0x70 [ 36.258860] ____fput+0x15/0x20 [ 36.262108] task_work_run+0x199/0x270 [ 36.265968] ? task_work_cancel+0x210/0x210 [ 36.270258] ? _raw_spin_unlock+0x22/0x30 [ 36.274384] ? switch_task_namespaces+0x87/0xc0 [ 36.279026] do_exit+0x9d2/0x1af0 [ 36.282457] ? mm_update_next_owner+0x930/0x930 [ 36.287096] ? lock_acquire+0x1d5/0x580 [ 36.291039] ? __handle_mm_fault+0xf07/0x39c0 [ 36.295511] ? lock_release+0xd70/0xd70 [ 36.299461] ? check_noncircular+0x20/0x20 [ 36.303669] ? kvfree+0x3b/0x60 [ 36.306923] ? rtnl_unlock+0xe/0x10 [ 36.310521] ? check_noncircular+0x20/0x20 [ 36.314729] ? __handle_mm_fault+0x587/0x39c0 [ 36.319200] ? __pmd_alloc+0x4e0/0x4e0 [ 36.323071] ? find_held_lock+0x39/0x1d0 [ 36.327111] ? lock_downgrade+0x990/0x990 [ 36.331253] do_group_exit+0x149/0x400 [ 36.335104] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.339655] ? vmacache_find+0x5f/0x280 [ 36.343597] ? SyS_exit+0x30/0x30 [ 36.347027] ? do_fast_syscall_32+0x158/0xf05 [ 36.351492] ? do_group_exit+0x400/0x400 [ 36.355523] SyS_exit_group+0x1d/0x20 [ 36.359291] do_fast_syscall_32+0x3f2/0xf05 [ 36.363589] ? do_int80_syscall_32+0x940/0x940 [ 36.368141] ? kasan_check_read+0x11/0x20 [ 36.372259] ? syscall_return_slowpath+0x510/0x510 [ 36.377166] ? SyS_rt_sigaction+0x94/0x1b0 [ 36.381374] ? lockdep_sys_exit+0x47/0xf0 [ 36.385490] ? retint_user+0x18/0x20 [ 36.389179] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 36.393996] entry_SYSENTER_compat+0x51/0x60 [ 36.398374] RIP: 0023:0xf7f2dc79 [ 36.401707] RSP: 002b:00000000ffa3233c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 36.409385] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 36.416624] RDX: 0000000000000000 RSI: 00000000080dad98 RDI: 00000000080f12a0 [ 36.423861] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 36.431101] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 36.438338] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 36.445596] [ 36.447199] Allocated by task 2982: [ 36.450797] save_stack_trace+0x16/0x20 [ 36.454742] save_stack+0x43/0xd0 [ 36.458163] kasan_kmalloc+0xad/0xe0 [ 36.461844] __kmalloc_node+0x47/0x70 [ 36.465612] kvmalloc_node+0x64/0xd0 [ 36.469296] alloc_netdev_mqs+0x16e/0xed0 [ 36.473412] __tun_chr_ioctl+0x12be/0x3d20 [ 36.477612] tun_chr_compat_ioctl+0x29/0x30 [ 36.481900] compat_SyS_ioctl+0x1d7/0x3290 [ 36.486104] do_fast_syscall_32+0x3f2/0xf05 [ 36.490392] entry_SYSENTER_compat+0x51/0x60 [ 36.494767] [ 36.496361] Freed by task 2982: [ 36.499607] save_stack_trace+0x16/0x20 [ 36.503549] save_stack+0x43/0xd0 [ 36.506968] kasan_slab_free+0x71/0xc0 [ 36.510822] kfree+0xca/0x250 [ 36.513894] kvfree+0x36/0x60 [ 36.516967] free_netdev+0x2cf/0x360 [ 36.520647] __tun_chr_ioctl+0x2cf6/0x3d20 [ 36.524855] tun_chr_compat_ioctl+0x29/0x30 [ 36.529142] compat_SyS_ioctl+0x1d7/0x3290 [ 36.533343] do_fast_syscall_32+0x3f2/0xf05 [ 36.537630] entry_SYSENTER_compat+0x51/0x60 [ 36.542001] [ 36.543601] The buggy address belongs to the object at ffff8801ce9e0340 [ 36.543601] which belongs to the cache kmalloc-16384 of size 16384 [ 36.556569] The buggy address is located 13312 bytes inside of [ 36.556569] 16384-byte region [ffff8801ce9e0340, ffff8801ce9e4340) [ 36.568755] The buggy address belongs to the page: [ 36.573653] page:ffffea00073a7800 count:1 mapcount:0 mapping:ffff8801ce9e0340 index:0x0 compound_mapcount: 0 [ 36.583595] flags: 0x200000000008100(slab|head) [ 36.588235] raw: 0200000000008100 ffff8801ce9e0340 0000000000000000 0000000100000001 [ 36.596083] raw: ffffea0007331420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 36.603928] page dumped because: kasan: bad access detected [ 36.609602] [ 36.611205] Memory state around the buggy address: [ 36.616108] ffff8801ce9e3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.623434] ffff8801ce9e3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.630760] >ffff8801ce9e3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.638085] ^ [ 36.643501] ffff8801ce9e3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.650825] ffff8801ce9e3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.658148] ================================================================== [ 36.665472] Disabling lock debugging due to kernel taint [ 36.670886] Kernel panic - not syncing: panic_on_warn set ... [ 36.670886] [ 36.678209] CPU: 1 PID: 2982 Comm: syzkaller494080 Tainted: G B 4.14.0-rc2+ #20 [ 36.686743] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.696059] Call Trace: [ 36.698614] dump_stack+0x194/0x257 [ 36.702207] ? arch_local_irq_restore+0x53/0x53 [ 36.706841] ? vprintk_default+0x28/0x30 [ 36.710871] ? detach_if_pending+0x4d0/0x610 [ 36.715244] panic+0x1e4/0x417 [ 36.718399] ? __warn+0x1d9/0x1d9 [ 36.721822] ? detach_if_pending+0x557/0x610 [ 36.726190] kasan_end_report+0x50/0x50 [ 36.730127] kasan_report+0x144/0x340 [ 36.733894] __asan_report_store8_noabort+0x17/0x20 [ 36.738872] detach_if_pending+0x557/0x610 [ 36.743072] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.748224] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.752857] ? lock_timer_base+0x1a3/0x2b0 [ 36.757056] ? lock_timer_base+0x1eb/0x2b0 [ 36.761257] ? __internal_add_timer+0x2d0/0x2d0 [ 36.765899] ? trace_hardirqs_on+0xd/0x10 [ 36.770016] try_to_del_timer_sync+0xa2/0x120 [ 36.774474] ? del_timer+0x130/0x130 [ 36.778150] ? del_timer_sync+0xeb/0x240 [ 36.782175] del_timer_sync+0x18a/0x240 [ 36.786116] tun_free_netdev+0x105/0x1b0 [ 36.790139] ? tun_xdp+0x410/0x410 [ 36.793642] ? cpumask_next+0x24/0x30 [ 36.797407] ? netdev_refcnt_read+0xed/0x150 [ 36.801779] ? tun_xdp+0x410/0x410 [ 36.805283] netdev_run_todo+0x870/0xca0 [ 36.809305] ? do_group_exit+0x149/0x400 [ 36.813330] ? register_netdev+0x30/0x30 [ 36.817354] ? lock_downgrade+0x990/0x990 [ 36.821465] ? trace_hardirqs_on+0xd/0x10 [ 36.825584] ? refcount_sub_and_test+0x115/0x1b0 [ 36.830301] ? refcount_inc+0x50/0x50 [ 36.834064] ? refcount_inc+0x50/0x50 [ 36.837828] ? sk_destruct+0x4c/0x80 [ 36.841504] ? __sk_free+0x5c/0x230 [ 36.845092] ? sk_free+0x2f/0x40 [ 36.848421] ? __tun_detach+0x176/0x1390 [ 36.852450] ? tun_attach+0xf90/0xf90 [ 36.856213] ? do_raw_spin_trylock+0x190/0x190 [ 36.860760] ? locks_remove_file+0x3fa/0x5a0 [ 36.865132] ? fcntl_setlk+0x10d0/0x10d0 [ 36.869157] ? __fsnotify_parent+0xb4/0x3a0 [ 36.873443] ? fsnotify+0x1af0/0x1af0 [ 36.877209] ? __tun_detach+0x1390/0x1390 [ 36.881320] ? __tun_detach+0x1390/0x1390 [ 36.885435] rtnl_unlock+0xe/0x10 [ 36.888853] tun_chr_close+0x49/0x60 [ 36.892531] __fput+0x333/0x7f0 [ 36.895776] ? fput+0x140/0x140 [ 36.899021] ? check_same_owner+0x320/0x320 [ 36.903305] ? _raw_spin_unlock_irq+0x27/0x70 [ 36.907765] ____fput+0x15/0x20 [ 36.911010] task_work_run+0x199/0x270 [ 36.914864] ? task_work_cancel+0x210/0x210 [ 36.919157] ? _raw_spin_unlock+0x22/0x30 [ 36.923271] ? switch_task_namespaces+0x87/0xc0 [ 36.927905] do_exit+0x9d2/0x1af0 [ 36.931325] ? mm_update_next_owner+0x930/0x930 [ 36.935961] ? lock_acquire+0x1d5/0x580 [ 36.939897] ? __handle_mm_fault+0xf07/0x39c0 [ 36.944357] ? lock_release+0xd70/0xd70 [ 36.948293] ? check_noncircular+0x20/0x20 [ 36.952491] ? kvfree+0x3b/0x60 [ 36.955738] ? rtnl_unlock+0xe/0x10 [ 36.959330] ? check_noncircular+0x20/0x20 [ 36.963531] ? __handle_mm_fault+0x587/0x39c0 [ 36.967993] ? __pmd_alloc+0x4e0/0x4e0 [ 36.971850] ? find_held_lock+0x39/0x1d0 [ 36.975882] ? lock_downgrade+0x990/0x990 [ 36.980010] do_group_exit+0x149/0x400 [ 36.983859] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.988404] ? vmacache_find+0x5f/0x280 [ 36.992340] ? SyS_exit+0x30/0x30 [ 36.995761] ? do_fast_syscall_32+0x158/0xf05 [ 37.000221] ? do_group_exit+0x400/0x400 [ 37.004247] SyS_exit_group+0x1d/0x20