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-3,10.128.0.13' (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: [ 43.354521] ================================================================== [ 43.361975] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 43.368705] Write of size 8 at addr ffff8801cd843740 by task syzkaller936011/2984 [ 43.376298] [ 43.377902] CPU: 1 PID: 2984 Comm: syzkaller936011 Not tainted 4.14.0-rc4+ #36 [ 43.385233] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.394559] Call Trace: [ 43.397123] dump_stack+0x194/0x257 [ 43.400726] ? arch_local_irq_restore+0x53/0x53 [ 43.405371] ? show_regs_print_info+0x65/0x65 [ 43.409839] ? lock_timer_base+0x1a3/0x2b0 [ 43.414048] ? detach_if_pending+0x557/0x610 [ 43.418430] print_address_description+0x73/0x250 [ 43.423244] ? detach_if_pending+0x557/0x610 [ 43.427624] kasan_report+0x25b/0x340 [ 43.431398] __asan_report_store8_noabort+0x17/0x20 [ 43.436384] detach_if_pending+0x557/0x610 [ 43.440596] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.445758] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.450395] ? lock_timer_base+0x1a3/0x2b0 [ 43.454613] ? lock_timer_base+0x1eb/0x2b0 [ 43.458824] ? __internal_add_timer+0x2d0/0x2d0 [ 43.463466] ? trace_hardirqs_on+0xd/0x10 [ 43.467593] try_to_del_timer_sync+0xa2/0x120 [ 43.472061] ? del_timer+0x130/0x130 [ 43.475750] ? del_timer_sync+0xeb/0x240 [ 43.479789] del_timer_sync+0x18a/0x240 [ 43.483739] tun_free_netdev+0x105/0x1b0 [ 43.487781] ? tun_xdp+0x410/0x410 [ 43.491293] ? cpumask_next+0x24/0x30 [ 43.495070] ? netdev_refcnt_read+0xed/0x150 [ 43.499457] ? tun_xdp+0x410/0x410 [ 43.502970] netdev_run_todo+0x870/0xca0 [ 43.507003] ? do_group_exit+0x149/0x400 [ 43.511041] ? register_netdev+0x30/0x30 [ 43.515081] ? lock_downgrade+0x990/0x990 [ 43.519200] ? trace_hardirqs_on+0xd/0x10 [ 43.523338] ? refcount_sub_and_test+0x115/0x1b0 [ 43.528065] ? refcount_inc+0x50/0x50 [ 43.531842] ? refcount_inc+0x50/0x50 [ 43.535620] ? sk_destruct+0x4c/0x80 [ 43.539442] ? __sk_free+0x5c/0x230 [ 43.543072] ? sk_free+0x2f/0x40 [ 43.546426] ? __tun_detach+0x176/0x1390 [ 43.550475] ? tun_attach+0xf90/0xf90 [ 43.554259] ? do_raw_spin_trylock+0x190/0x190 [ 43.558819] ? locks_remove_file+0x3fa/0x5a0 [ 43.563203] ? fcntl_setlk+0x10d0/0x10d0 [ 43.567242] ? __fsnotify_parent+0xb4/0x3a0 [ 43.571539] ? fsnotify+0x1af0/0x1af0 [ 43.575317] ? __tun_detach+0x1390/0x1390 [ 43.579436] ? __tun_detach+0x1390/0x1390 [ 43.583558] rtnl_unlock+0xe/0x10 [ 43.586984] tun_chr_close+0x49/0x60 [ 43.590669] __fput+0x333/0x7f0 [ 43.593928] ? fput+0x140/0x140 [ 43.597184] ? check_same_owner+0x320/0x320 [ 43.601479] ? _raw_spin_unlock_irq+0x27/0x70 [ 43.605951] ____fput+0x15/0x20 [ 43.609204] task_work_run+0x199/0x270 [ 43.613067] ? task_work_cancel+0x210/0x210 [ 43.617361] ? _raw_spin_unlock+0x22/0x30 [ 43.621483] ? switch_task_namespaces+0x87/0xc0 [ 43.626138] do_exit+0x9d2/0x1af0 [ 43.629565] ? __handle_mm_fault+0xf07/0x39c0 [ 43.634036] ? mm_update_next_owner+0x930/0x930 [ 43.638682] ? lock_release+0xd70/0xd70 [ 43.642628] ? check_noncircular+0x20/0x20 [ 43.646838] ? kfree+0xe4/0x250 [ 43.650090] ? kvfree+0x36/0x60 [ 43.653352] ? check_noncircular+0x20/0x20 [ 43.657562] ? __handle_mm_fault+0x587/0x39c0 [ 43.662034] ? __pmd_alloc+0x4e0/0x4e0 [ 43.665925] ? find_held_lock+0x39/0x1d0 [ 43.669969] ? lock_downgrade+0x990/0x990 [ 43.674121] ? handle_mm_fault+0x410/0x8d0 [ 43.678327] ? down_read_trylock+0xdb/0x170 [ 43.682617] ? __do_page_fault+0x31e/0xd60 [ 43.686823] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.691379] ? vmacache_find+0x5f/0x280 [ 43.695327] ? vmacache_update+0xfe/0x130 [ 43.699454] do_group_exit+0x149/0x400 [ 43.703314] ? __do_page_fault+0x3d6/0xd60 [ 43.707521] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 43.711907] ? SyS_exit+0x30/0x30 [ 43.715346] ? do_fast_syscall_32+0x158/0xf05 [ 43.719837] ? do_group_exit+0x400/0x400 [ 43.723879] SyS_exit_group+0x1d/0x20 [ 43.727656] do_fast_syscall_32+0x3f2/0xf05 [ 43.731956] ? do_int80_syscall_32+0x940/0x940 [ 43.736512] ? kasan_check_read+0x11/0x20 [ 43.740632] ? syscall_return_slowpath+0x510/0x510 [ 43.745538] ? SyS_rt_sigaction+0x94/0x1b0 [ 43.749749] ? lockdep_sys_exit+0x47/0xf0 [ 43.753871] ? retint_user+0x18/0x20 [ 43.757562] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 43.762383] entry_SYSENTER_compat+0x51/0x60 [ 43.766764] RIP: 0023:0xf7f75c79 [ 43.770100] RSP: 002b:00000000ff931a4c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 43.777787] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 43.785030] RDX: 0000000000000000 RSI: 00000000080daa58 RDI: 00000000080f12a0 [ 43.792358] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 43.799601] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 43.806842] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 43.814109] [ 43.815710] Allocated by task 2984: [ 43.819312] save_stack_trace+0x16/0x20 [ 43.823259] save_stack+0x43/0xd0 [ 43.826681] kasan_kmalloc+0xad/0xe0 [ 43.830367] __kmalloc_node+0x47/0x70 [ 43.834141] kvmalloc_node+0x64/0xd0 [ 43.837829] alloc_netdev_mqs+0x16e/0xed0 [ 43.841953] __tun_chr_ioctl+0x12be/0x3d20 [ 43.846159] tun_chr_compat_ioctl+0x29/0x30 [ 43.850453] compat_SyS_ioctl+0x1d7/0x3290 [ 43.854658] do_fast_syscall_32+0x3f2/0xf05 [ 43.858949] entry_SYSENTER_compat+0x51/0x60 [ 43.863323] [ 43.864920] Freed by task 2984: [ 43.868173] save_stack_trace+0x16/0x20 [ 43.872120] save_stack+0x43/0xd0 [ 43.875543] kasan_slab_free+0x71/0xc0 [ 43.879401] kfree+0xca/0x250 [ 43.882476] kvfree+0x36/0x60 [ 43.885553] free_netdev+0x2cf/0x360 [ 43.889235] __tun_chr_ioctl+0x2cf6/0x3d20 [ 43.893438] tun_chr_compat_ioctl+0x29/0x30 [ 43.897730] compat_SyS_ioctl+0x1d7/0x3290 [ 43.901935] do_fast_syscall_32+0x3f2/0xf05 [ 43.906225] entry_SYSENTER_compat+0x51/0x60 [ 43.910600] [ 43.912199] The buggy address belongs to the object at ffff8801cd840340 [ 43.912199] which belongs to the cache kmalloc-16384 of size 16384 [ 43.925173] The buggy address is located 13312 bytes inside of [ 43.925173] 16384-byte region [ffff8801cd840340, ffff8801cd844340) [ 43.937364] The buggy address belongs to the page: [ 43.942265] page:ffffea0007361000 count:1 mapcount:0 mapping:ffff8801cd840340 index:0x0 compound_mapcount: 0 [ 43.952212] flags: 0x200000000008100(slab|head) [ 43.956855] raw: 0200000000008100 ffff8801cd840340 0000000000000000 0000000100000001 [ 43.964704] raw: ffffea000735a820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 43.972551] page dumped because: kasan: bad access detected [ 43.978227] [ 43.979822] Memory state around the buggy address: [ 43.984725] ffff8801cd843600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.992054] ffff8801cd843680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.999383] >ffff8801cd843700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.006713] ^ [ 44.012134] ffff8801cd843780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.019551] ffff8801cd843800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 44.026881] ================================================================== [ 44.034209] Disabling lock debugging due to kernel taint [ 44.039631] Kernel panic - not syncing: panic_on_warn set ... [ 44.039631] [ 44.046964] CPU: 1 PID: 2984 Comm: syzkaller936011 Tainted: G B 4.14.0-rc4+ #36 [ 44.055502] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 44.064822] Call Trace: [ 44.067382] dump_stack+0x194/0x257 [ 44.070975] ? arch_local_irq_restore+0x53/0x53 [ 44.075612] ? vprintk_default+0x28/0x30 [ 44.079642] ? detach_if_pending+0x540/0x610 [ 44.084020] panic+0x1e4/0x417 [ 44.087179] ? __warn+0x1d9/0x1d9 [ 44.090603] ? detach_if_pending+0x557/0x610 [ 44.094979] kasan_end_report+0x50/0x50 [ 44.098918] kasan_report+0x144/0x340 [ 44.102710] __asan_report_store8_noabort+0x17/0x20 [ 44.107691] detach_if_pending+0x557/0x610 [ 44.111891] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.117050] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.121681] ? lock_timer_base+0x1a3/0x2b0 [ 44.125881] ? lock_timer_base+0x1eb/0x2b0 [ 44.130085] ? __internal_add_timer+0x2d0/0x2d0 [ 44.134720] ? trace_hardirqs_on+0xd/0x10 [ 44.138836] try_to_del_timer_sync+0xa2/0x120 [ 44.143295] ? del_timer+0x130/0x130 [ 44.146974] ? del_timer_sync+0xeb/0x240 [ 44.151003] del_timer_sync+0x18a/0x240 [ 44.154945] tun_free_netdev+0x105/0x1b0 [ 44.158973] ? tun_xdp+0x410/0x410 [ 44.162479] ? cpumask_next+0x24/0x30 [ 44.166247] ? netdev_refcnt_read+0xed/0x150 [ 44.170621] ? tun_xdp+0x410/0x410 [ 44.174126] netdev_run_todo+0x870/0xca0 [ 44.178152] ? do_group_exit+0x149/0x400 [ 44.182179] ? register_netdev+0x30/0x30 [ 44.186209] ? lock_downgrade+0x990/0x990 [ 44.190333] ? trace_hardirqs_on+0xd/0x10 [ 44.194456] ? refcount_sub_and_test+0x115/0x1b0 [ 44.199177] ? refcount_inc+0x50/0x50 [ 44.202944] ? refcount_inc+0x50/0x50 [ 44.206714] ? sk_destruct+0x4c/0x80 [ 44.210394] ? __sk_free+0x5c/0x230 [ 44.213986] ? sk_free+0x2f/0x40 [ 44.217319] ? __tun_detach+0x176/0x1390 [ 44.221351] ? tun_attach+0xf90/0xf90 [ 44.225122] ? do_raw_spin_trylock+0x190/0x190 [ 44.229673] ? locks_remove_file+0x3fa/0x5a0 [ 44.234048] ? fcntl_setlk+0x10d0/0x10d0 [ 44.238082] ? __fsnotify_parent+0xb4/0x3a0 [ 44.242369] ? fsnotify+0x1af0/0x1af0 [ 44.246136] ? __tun_detach+0x1390/0x1390 [ 44.250257] ? __tun_detach+0x1390/0x1390 [ 44.254371] rtnl_unlock+0xe/0x10 [ 44.257788] tun_chr_close+0x49/0x60 [ 44.261466] __fput+0x333/0x7f0 [ 44.264715] ? fput+0x140/0x140 [ 44.267963] ? check_same_owner+0x320/0x320 [ 44.272249] ? _raw_spin_unlock_irq+0x27/0x70 [ 44.276712] ____fput+0x15/0x20 [ 44.279958] task_work_run+0x199/0x270 [ 44.283811] ? task_work_cancel+0x210/0x210 [ 44.288099] ? _raw_spin_unlock+0x22/0x30 [ 44.292214] ? switch_task_namespaces+0x87/0xc0 [ 44.296855] do_exit+0x9d2/0x1af0 [ 44.300274] ? __handle_mm_fault+0xf07/0x39c0 [ 44.304734] ? mm_update_next_owner+0x930/0x930 [ 44.309371] ? lock_release+0xd70/0xd70 [ 44.313313] ? check_noncircular+0x20/0x20 [ 44.317513] ? kfree+0xe4/0x250 [ 44.320759] ? kvfree+0x36/0x60 [ 44.324008] ? check_noncircular+0x20/0x20 [ 44.328221] ? __handle_mm_fault+0x587/0x39c0 [ 44.332685] ? __pmd_alloc+0x4e0/0x4e0 [ 44.336543] ? find_held_lock+0x39/0x1d0 [ 44.340575] ? lock_downgrade+0x990/0x990 [ 44.344697] ? handle_mm_fault+0x410/0x8d0 [ 44.348898] ? down_read_trylock+0xdb/0x170 [ 44.353197] ? __do_page_fault+0x31e/0xd60