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.32' (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: [ 46.154381] ================================================================== [ 46.155508] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 46.156398] Write of size 8 at addr ffff8801c1bfb678 by task syzkaller630416/2983 [ 46.157393] [ 46.157661] CPU: 1 PID: 2983 Comm: syzkaller630416 Not tainted 4.14.0-rc5+ #51 [ 46.158640] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.159872] Call Trace: [ 46.160230] dump_stack+0x194/0x257 [ 46.160737] ? arch_local_irq_restore+0x53/0x53 [ 46.161359] ? show_regs_print_info+0x65/0x65 [ 46.161958] ? lock_acquire+0x1d5/0x580 [ 46.162491] ? lock_timer_base+0x1a3/0x2b0 [ 46.163057] ? detach_if_pending+0x557/0x610 [ 46.163647] print_address_description+0x73/0x250 [ 46.164396] ? detach_if_pending+0x557/0x610 [ 46.164988] kasan_report+0x25b/0x340 [ 46.165504] __asan_report_store8_noabort+0x17/0x20 [ 46.166188] detach_if_pending+0x557/0x610 [ 46.166758] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.167448] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.168070] ? lock_timer_base+0x1a3/0x2b0 [ 46.168638] ? lock_timer_base+0x1eb/0x2b0 [ 46.169208] ? __internal_add_timer+0x2d0/0x2d0 [ 46.169829] ? lock_downgrade+0x990/0x990 [ 46.170396] ? trace_hardirqs_on+0xd/0x10 [ 46.171318] try_to_del_timer_sync+0xa2/0x120 [ 46.171964] ? del_timer+0x130/0x130 [ 46.172463] ? del_timer_sync+0xeb/0x240 [ 46.173035] del_timer_sync+0x18a/0x240 [ 46.173572] tun_free_netdev+0x105/0x1b0 [ 46.174137] ? tun_xdp+0x410/0x410 [ 46.175173] ? cpumask_next+0x24/0x30 [ 46.178942] ? netdev_refcnt_read+0xed/0x150 [ 46.183321] ? tun_xdp+0x410/0x410 [ 46.186826] netdev_run_todo+0x870/0xca0 [ 46.190852] ? do_group_exit+0x149/0x400 [ 46.194882] ? mark_held_locks+0xaf/0x100 [ 46.198995] ? register_netdev+0x30/0x30 [ 46.203022] ? find_held_lock+0x35/0x1d0 [ 46.207056] ? lock_downgrade+0x990/0x990 [ 46.211177] ? refcount_sub_and_test+0x115/0x1b0 [ 46.215898] ? refcount_inc+0x50/0x50 [ 46.219663] ? refcount_inc+0x50/0x50 [ 46.223433] ? sk_destruct+0x4c/0x80 [ 46.227110] ? __sk_free+0x5c/0x230 [ 46.230705] ? sk_free+0x2f/0x40 [ 46.234036] ? __tun_detach+0x176/0x1390 [ 46.238075] ? tun_attach+0xfa0/0xfa0 [ 46.241845] ? lock_downgrade+0x990/0x990 [ 46.245961] ? locks_remove_file+0x3fa/0x5a0 [ 46.250334] ? fcntl_setlk+0x10c0/0x10c0 [ 46.254364] ? __fsnotify_parent+0xb4/0x3a0 [ 46.258651] ? fsnotify+0x1af0/0x1af0 [ 46.262421] ? __tun_detach+0x1390/0x1390 [ 46.266536] ? __tun_detach+0x1390/0x1390 [ 46.270652] rtnl_unlock+0xe/0x10 [ 46.274245] tun_chr_close+0x49/0x60 [ 46.277929] __fput+0x327/0x7e0 [ 46.281183] ? fput+0x140/0x140 [ 46.284431] ? check_same_owner+0x320/0x320 [ 46.288722] ? _raw_spin_unlock_irq+0x27/0x70 [ 46.293192] ____fput+0x15/0x20 [ 46.296438] task_work_run+0x199/0x270 [ 46.300298] ? task_work_cancel+0x210/0x210 [ 46.304592] ? _raw_spin_unlock+0x22/0x30 [ 46.308705] ? switch_task_namespaces+0x87/0xc0 [ 46.313348] do_exit+0x9b5/0x1ad0 [ 46.316769] ? __handle_mm_fault+0xf07/0x39c0 [ 46.321233] ? mm_update_next_owner+0x930/0x930 [ 46.325869] ? lock_release+0xa40/0xa40 [ 46.329809] ? do_raw_spin_trylock+0x190/0x190 [ 46.334361] ? kfree+0xe4/0x250 [ 46.337609] ? kvfree+0x36/0x60 [ 46.340870] ? __handle_mm_fault+0x587/0x39c0 [ 46.345339] ? check_noncircular+0x20/0x20 [ 46.349537] ? __pmd_alloc+0x4e0/0x4e0 [ 46.353396] ? find_held_lock+0x35/0x1d0 [ 46.357442] ? handle_mm_fault+0x248/0x8d0 [ 46.361650] ? find_held_lock+0x35/0x1d0 [ 46.365688] ? __do_page_fault+0x64c/0xd60 [ 46.369895] ? lock_downgrade+0x990/0x990 [ 46.374024] ? handle_mm_fault+0x410/0x8d0 [ 46.378228] ? down_read_trylock+0xdb/0x170 [ 46.382519] ? __do_page_fault+0x31e/0xd60 [ 46.386724] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.391277] ? vmacache_find+0x5f/0x280 [ 46.395221] ? vmacache_update+0xfe/0x130 [ 46.399348] do_group_exit+0x149/0x400 [ 46.403205] ? __do_page_fault+0x3d6/0xd60 [ 46.407415] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 46.411792] ? SyS_exit+0x30/0x30 [ 46.415221] ? do_fast_syscall_32+0x158/0xf05 [ 46.419683] ? do_group_exit+0x400/0x400 [ 46.423712] SyS_exit_group+0x1d/0x20 [ 46.427481] do_fast_syscall_32+0x3f2/0xf05 [ 46.431778] ? do_int80_syscall_32+0x940/0x940 [ 46.436333] ? kasan_check_read+0x11/0x20 [ 46.440450] ? syscall_return_slowpath+0x510/0x510 [ 46.445349] ? SyS_rt_sigaction+0x94/0x1b0 [ 46.449549] ? SyS_sigprocmask+0x4b0/0x4b0 [ 46.453748] ? SyS_read+0x184/0x220 [ 46.457346] ? retint_user+0x18/0x20 [ 46.461030] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 46.465846] entry_SYSENTER_compat+0x51/0x60 [ 46.470220] RIP: 0023:0xf7f25c79 [ 46.473550] RSP: 002b:00000000ff9401cc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 46.481225] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 46.488461] RDX: 0000000000000000 RSI: 00000000080db8d8 RDI: 00000000080f22a0 [ 46.495697] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 46.502931] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 46.510164] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 46.517414] [ 46.519009] Allocated by task 2983: [ 46.522602] save_stack_trace+0x16/0x20 [ 46.526543] save_stack+0x43/0xd0 [ 46.529960] kasan_kmalloc+0xad/0xe0 [ 46.533636] __kmalloc_node+0x47/0x70 [ 46.537403] kvmalloc_node+0x64/0xd0 [ 46.541084] alloc_netdev_mqs+0x16e/0xed0 [ 46.545197] __tun_chr_ioctl+0x12b2/0x3d20 [ 46.549393] tun_chr_compat_ioctl+0x29/0x30 [ 46.553680] compat_SyS_ioctl+0x1d7/0x3290 [ 46.557881] do_fast_syscall_32+0x3f2/0xf05 [ 46.562166] entry_SYSENTER_compat+0x51/0x60 [ 46.566535] [ 46.568127] Freed by task 2983: [ 46.571370] save_stack_trace+0x16/0x20 [ 46.575307] save_stack+0x43/0xd0 [ 46.578724] kasan_slab_free+0x71/0xc0 [ 46.582577] kfree+0xca/0x250 [ 46.585647] kvfree+0x36/0x60 [ 46.588716] free_netdev+0x2cf/0x360 [ 46.592391] __tun_chr_ioctl+0x2cea/0x3d20 [ 46.596605] tun_chr_compat_ioctl+0x29/0x30 [ 46.600900] compat_SyS_ioctl+0x1d7/0x3290 [ 46.605116] do_fast_syscall_32+0x3f2/0xf05 [ 46.609412] entry_SYSENTER_compat+0x51/0x60 [ 46.613790] [ 46.615388] The buggy address belongs to the object at ffff8801c1bf8340 [ 46.615388] which belongs to the cache kmalloc-16384 of size 16384 [ 46.628357] The buggy address is located 13112 bytes inside of [ 46.628357] 16384-byte region [ffff8801c1bf8340, ffff8801c1bfc340) [ 46.640540] The buggy address belongs to the page: [ 46.645435] page:ffffea000706fe00 count:1 mapcount:0 mapping:ffff8801c1bf8340 index:0x0 compound_mapcount: 0 [ 46.655371] flags: 0x200000000008100(slab|head) [ 46.660006] raw: 0200000000008100 ffff8801c1bf8340 0000000000000000 0000000100000001 [ 46.667850] raw: ffffea000747c620 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 46.675690] page dumped because: kasan: bad access detected [ 46.681360] [ 46.682951] Memory state around the buggy address: [ 46.687845] ffff8801c1bfb500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.695168] ffff8801c1bfb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.702490] >ffff8801c1bfb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.709811] ^ [ 46.717046] ffff8801c1bfb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.724369] ffff8801c1bfb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.731690] ================================================================== [ 46.739010] Disabling lock debugging due to kernel taint [ 46.744421] Kernel panic - not syncing: panic_on_warn set ... [ 46.744421] [ 46.751748] CPU: 1 PID: 2983 Comm: syzkaller630416 Tainted: G B 4.14.0-rc5+ #51 [ 46.760286] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.769602] Call Trace: [ 46.772161] dump_stack+0x194/0x257 [ 46.775753] ? arch_local_irq_restore+0x53/0x53 [ 46.780386] ? kasan_end_report+0x32/0x50 [ 46.784505] ? lock_downgrade+0x990/0x990 [ 46.788621] ? detach_if_pending+0x540/0x610 [ 46.792993] panic+0x1e4/0x417 [ 46.796147] ? __warn+0x1d9/0x1d9 [ 46.799570] ? detach_if_pending+0x557/0x610 [ 46.803941] kasan_end_report+0x50/0x50 [ 46.807880] kasan_report+0x144/0x340 [ 46.811645] __asan_report_store8_noabort+0x17/0x20 [ 46.816622] detach_if_pending+0x557/0x610 [ 46.820820] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.825976] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.830605] ? lock_timer_base+0x1a3/0x2b0 [ 46.834801] ? lock_timer_base+0x1eb/0x2b0 [ 46.839003] ? __internal_add_timer+0x2d0/0x2d0 [ 46.843638] ? lock_downgrade+0x990/0x990 [ 46.847759] ? trace_hardirqs_on+0xd/0x10 [ 46.851879] try_to_del_timer_sync+0xa2/0x120 [ 46.856339] ? del_timer+0x130/0x130 [ 46.860016] ? del_timer_sync+0xeb/0x240 [ 46.864042] del_timer_sync+0x18a/0x240 [ 46.867985] tun_free_netdev+0x105/0x1b0 [ 46.872011] ? tun_xdp+0x410/0x410 [ 46.875520] ? cpumask_next+0x24/0x30 [ 46.879289] ? netdev_refcnt_read+0xed/0x150 [ 46.883663] ? tun_xdp+0x410/0x410 [ 46.887165] netdev_run_todo+0x870/0xca0 [ 46.891190] ? do_group_exit+0x149/0x400 [ 46.895216] ? mark_held_locks+0xaf/0x100 [ 46.899328] ? register_netdev+0x30/0x30 [ 46.903354] ? find_held_lock+0x35/0x1d0 [ 46.907382] ? lock_downgrade+0x990/0x990 [ 46.911498] ? refcount_sub_and_test+0x115/0x1b0 [ 46.916215] ? refcount_inc+0x50/0x50 [ 46.919977] ? refcount_inc+0x50/0x50 [ 46.923744] ? sk_destruct+0x4c/0x80 [ 46.927421] ? __sk_free+0x5c/0x230 [ 46.931012] ? sk_free+0x2f/0x40 [ 46.934343] ? __tun_detach+0x176/0x1390 [ 46.938370] ? tun_attach+0xfa0/0xfa0 [ 46.942136] ? lock_downgrade+0x990/0x990 [ 46.946250] ? locks_remove_file+0x3fa/0x5a0 [ 46.950622] ? fcntl_setlk+0x10c0/0x10c0 [ 46.954646] ? __fsnotify_parent+0xb4/0x3a0 [ 46.958931] ? fsnotify+0x1af0/0x1af0 [ 46.962698] ? __tun_detach+0x1390/0x1390 [ 46.966809] ? __tun_detach+0x1390/0x1390 [ 46.970924] rtnl_unlock+0xe/0x10 [ 46.974340] tun_chr_close+0x49/0x60 [ 46.978018] __fput+0x327/0x7e0 [ 46.981262] ? fput+0x140/0x140 [ 46.984515] ? check_same_owner+0x320/0x320 [ 46.988800] ? _raw_spin_unlock_irq+0x27/0x70 [ 46.993263] ____fput+0x15/0x20 [ 46.996506] task_work_run+0x199/0x270 [ 47.000359] ? task_work_cancel+0x210/0x210 [ 47.004645] ? _raw_spin_unlock+0x22/0x30 [ 47.008755] ? switch_task_namespaces+0x87/0xc0 [ 47.013390] do_exit+0x9b5/0x1ad0 [ 47.016809] ? __handle_mm_fault+0xf07/0x39c0 [ 47.021269] ? mm_update_next_owner+0x930/0x930 [ 47.025900] ? lock_release+0xa40/0xa40 [ 47.029838] ? do_raw_spin_trylock+0x190/0x190 [ 47.034386] ? kfree+0xe4/0x250 [ 47.037630] ? kvfree+0x36/0x60 [ 47.040880] ? __handle_mm_fault+0x587/0x39c0 [ 47.045340] ? check_noncircular+0x20/0x20 [ 47.049537] ? __pmd_alloc+0x4e0/0x4e0 [ 47.053392] ? find_held_lock+0x35/0x1d0 [ 47.057419] ? handle_mm_fault+0x248/0x8d0 [ 47.061620] ? find_held_lock+0x35/0x1d0 [ 47.065649] ? __do_page_fault+0x64c/0xd60 [ 47.069846] ? lock_downgrade+0x990/0x990 [ 47.073960] ? handle_mm_fault+0x410/0x8d0 [ 47.078156] ? down_read_trylock+0xdb/0x170 [ 47.082441] ? __do_page_fault+0x31e/0xd60 [ 47.086640] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.091185] ? vmacache_find+0x5f/0x280 [ 47.095121] ? vmacache_update+0xfe/0x130 [ 47.099237] do_group_exit+0x149/0x400 [ 47.103087] ? __do_page_fault+0x3d6/0xd60 [ 47.107284] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 47.111655] ? SyS_exit+0x30/0x30 [ 47.115076] ? do_fast_syscall_32+0x158/0xf05 [ 47.119533] ? do_group_exit+0x400/0x400 [ 47.123556] SyS_exit_group+0x1d/0x20 [ 47.127318] do_fast_syscall_32+0x3f2/0xf05 [ 47.131604] ? do_int80_syscall_32+0x940/0x940 [ 47.136149] ? kasan_check_read+0x11/0x20 [ 47.140261] ? syscall_return_slowpath+0x510/0x510 [ 47.145153] ? SyS_rt_sigaction+0x94/0x1b0 [ 47.149353] ? SyS_sigprocmask+0x4b0/0x4b0 [ 47.153555] ? SyS_read+0x184/0x220