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-0,10.128.0.35' (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: [ 31.012219] ================================================================== [ 31.013326] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.014218] Write of size 8 at addr ffff8801cf223740 by task syzkaller219295/2978 [ 31.015217] [ 31.015453] CPU: 1 PID: 2978 Comm: syzkaller219295 Not tainted 4.14.0-rc2+ #21 [ 31.016421] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.017643] Call Trace: [ 31.018006] dump_stack+0x194/0x257 [ 31.018504] ? arch_local_irq_restore+0x53/0x53 [ 31.019130] ? show_regs_print_info+0x65/0x65 [ 31.019751] ? lock_timer_base+0x1a3/0x2b0 [ 31.020325] ? detach_if_pending+0x557/0x610 [ 31.020920] print_address_description+0x73/0x250 [ 31.021572] ? detach_if_pending+0x557/0x610 [ 31.022165] kasan_report+0x25b/0x340 [ 31.022700] __asan_report_store8_noabort+0x17/0x20 [ 31.023371] detach_if_pending+0x557/0x610 [ 31.023946] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.024642] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.025265] ? lock_timer_base+0x1a3/0x2b0 [ 31.025836] ? lock_timer_base+0x1eb/0x2b0 [ 31.026411] ? __internal_add_timer+0x2d0/0x2d0 [ 31.027039] ? trace_hardirqs_on+0xd/0x10 [ 31.027624] try_to_del_timer_sync+0xa2/0x120 [ 31.028228] ? del_timer+0x130/0x130 [ 31.028735] ? del_timer_sync+0xeb/0x240 [ 31.029290] del_timer_sync+0x18a/0x240 [ 31.029832] tun_free_netdev+0x105/0x1b0 [ 31.030398] ? tun_xdp+0x410/0x410 [ 31.030878] ? cpumask_next+0x24/0x30 [ 31.031396] ? netdev_refcnt_read+0xed/0x150 [ 31.031994] ? tun_xdp+0x410/0x410 [ 31.032476] netdev_run_todo+0x870/0xca0 [ 31.036509] ? do_group_exit+0x149/0x400 [ 31.040552] ? register_netdev+0x30/0x30 [ 31.044589] ? lock_downgrade+0x990/0x990 [ 31.048712] ? trace_hardirqs_on+0xd/0x10 [ 31.052850] ? refcount_sub_and_test+0x115/0x1b0 [ 31.057577] ? refcount_inc+0x50/0x50 [ 31.061350] ? refcount_inc+0x50/0x50 [ 31.065128] ? sk_destruct+0x4c/0x80 [ 31.068812] ? __sk_free+0x5c/0x230 [ 31.072429] ? sk_free+0x2f/0x40 [ 31.075768] ? __tun_detach+0x176/0x1390 [ 31.079811] ? tun_attach+0xf90/0xf90 [ 31.083589] ? do_raw_spin_trylock+0x190/0x190 [ 31.088146] ? locks_remove_file+0x3fa/0x5a0 [ 31.092529] ? fcntl_setlk+0x10d0/0x10d0 [ 31.096567] ? __fsnotify_parent+0xb4/0x3a0 [ 31.100861] ? fsnotify+0x1af0/0x1af0 [ 31.104636] ? __tun_detach+0x1390/0x1390 [ 31.108755] ? __tun_detach+0x1390/0x1390 [ 31.112874] rtnl_unlock+0xe/0x10 [ 31.116298] tun_chr_close+0x49/0x60 [ 31.119983] __fput+0x333/0x7f0 [ 31.123241] ? fput+0x140/0x140 [ 31.126495] ? check_same_owner+0x320/0x320 [ 31.130788] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.135642] ____fput+0x15/0x20 [ 31.138894] task_work_run+0x199/0x270 [ 31.142755] ? task_work_cancel+0x210/0x210 [ 31.147049] ? _raw_spin_unlock+0x22/0x30 [ 31.151169] ? switch_task_namespaces+0x87/0xc0 [ 31.155811] do_exit+0x9d2/0x1af0 [ 31.159236] ? __handle_mm_fault+0xf07/0x39c0 [ 31.163705] ? mm_update_next_owner+0x930/0x930 [ 31.168347] ? lock_release+0xd70/0xd70 [ 31.172290] ? check_noncircular+0x20/0x20 [ 31.176497] ? kfree+0xe4/0x250 [ 31.179749] ? kvfree+0x36/0x60 [ 31.183007] ? check_noncircular+0x20/0x20 [ 31.187226] ? __handle_mm_fault+0x587/0x39c0 [ 31.191699] ? __pmd_alloc+0x4e0/0x4e0 [ 31.195567] ? find_held_lock+0x39/0x1d0 [ 31.199611] ? lock_downgrade+0x990/0x990 [ 31.203755] ? handle_mm_fault+0x410/0x8d0 [ 31.207959] ? down_read_trylock+0xdb/0x170 [ 31.212251] ? __do_page_fault+0x31e/0xd60 [ 31.216457] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.221009] ? vmacache_find+0x5f/0x280 [ 31.224954] ? vmacache_update+0xfe/0x130 [ 31.229080] do_group_exit+0x149/0x400 [ 31.232937] ? __do_page_fault+0x3d6/0xd60 [ 31.237142] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 31.241520] ? SyS_exit+0x30/0x30 [ 31.244953] ? do_fast_syscall_32+0x158/0xf05 [ 31.249420] ? do_group_exit+0x400/0x400 [ 31.253462] SyS_exit_group+0x1d/0x20 [ 31.257238] do_fast_syscall_32+0x3f2/0xf05 [ 31.261541] ? do_int80_syscall_32+0x940/0x940 [ 31.266096] ? kasan_check_read+0x11/0x20 [ 31.270218] ? syscall_return_slowpath+0x510/0x510 [ 31.275119] ? SyS_rt_sigaction+0x94/0x1b0 [ 31.279327] ? lockdep_sys_exit+0x47/0xf0 [ 31.283447] ? retint_user+0x18/0x20 [ 31.287138] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 31.291960] entry_SYSENTER_compat+0x51/0x60 [ 31.296335] RIP: 0023:0xf7f4ac79 [ 31.299669] RSP: 002b:00000000ffb2ce0c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 31.307355] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 31.314597] RDX: 0000000000000000 RSI: 00000000080db738 RDI: 00000000080f22a0 [ 31.321838] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 31.329080] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 31.336320] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 31.343578] [ 31.345176] Allocated by task 2978: [ 31.348775] save_stack_trace+0x16/0x20 [ 31.352721] save_stack+0x43/0xd0 [ 31.356144] kasan_kmalloc+0xad/0xe0 [ 31.359830] __kmalloc_node+0x47/0x70 [ 31.363603] kvmalloc_node+0x64/0xd0 [ 31.367287] alloc_netdev_mqs+0x16e/0xed0 [ 31.371405] __tun_chr_ioctl+0x12be/0x3d20 [ 31.375606] tun_chr_compat_ioctl+0x29/0x30 [ 31.379896] compat_SyS_ioctl+0x1d7/0x3290 [ 31.384206] do_fast_syscall_32+0x3f2/0xf05 [ 31.388497] entry_SYSENTER_compat+0x51/0x60 [ 31.392875] [ 31.394473] Freed by task 2978: [ 31.397729] save_stack_trace+0x16/0x20 [ 31.401672] save_stack+0x43/0xd0 [ 31.405097] kasan_slab_free+0x71/0xc0 [ 31.408961] kfree+0xca/0x250 [ 31.412038] kvfree+0x36/0x60 [ 31.415115] free_netdev+0x2cf/0x360 [ 31.418797] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.423018] tun_chr_compat_ioctl+0x29/0x30 [ 31.427308] compat_SyS_ioctl+0x1d7/0x3290 [ 31.431514] do_fast_syscall_32+0x3f2/0xf05 [ 31.435804] entry_SYSENTER_compat+0x51/0x60 [ 31.440177] [ 31.441775] The buggy address belongs to the object at ffff8801cf220340 [ 31.441775] which belongs to the cache kmalloc-16384 of size 16384 [ 31.454750] The buggy address is located 13312 bytes inside of [ 31.454750] 16384-byte region [ffff8801cf220340, ffff8801cf224340) [ 31.466939] The buggy address belongs to the page: [ 31.471840] page:ffffea00073c8800 count:1 mapcount:0 mapping:ffff8801cf220340 index:0x0 compound_mapcount: 0 [ 31.481784] flags: 0x200000000008100(slab|head) [ 31.486424] raw: 0200000000008100 ffff8801cf220340 0000000000000000 0000000100000001 [ 31.494277] raw: ffffea000739a820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.502126] page dumped because: kasan: bad access detected [ 31.507804] [ 31.509402] Memory state around the buggy address: [ 31.514299] ffff8801cf223600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.521626] ffff8801cf223680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.528956] >ffff8801cf223700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.536284] ^ [ 31.541701] ffff8801cf223780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.549042] ffff8801cf223800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.556369] ================================================================== [ 31.563694] Disabling lock debugging due to kernel taint [ 31.569106] Kernel panic - not syncing: panic_on_warn set ... [ 31.569106] [ 31.576433] CPU: 1 PID: 2978 Comm: syzkaller219295 Tainted: G B 4.14.0-rc2+ #21 [ 31.584977] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.594295] Call Trace: [ 31.596850] dump_stack+0x194/0x257 [ 31.600446] ? arch_local_irq_restore+0x53/0x53 [ 31.605085] ? vprintk_default+0x28/0x30 [ 31.609112] ? detach_if_pending+0x500/0x610 [ 31.613488] panic+0x1e4/0x417 [ 31.616648] ? __warn+0x1d9/0x1d9 [ 31.620071] ? detach_if_pending+0x557/0x610 [ 31.624445] kasan_end_report+0x50/0x50 [ 31.628383] kasan_report+0x144/0x340 [ 31.632158] __asan_report_store8_noabort+0x17/0x20 [ 31.637140] detach_if_pending+0x557/0x610 [ 31.641341] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.646498] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.651130] ? lock_timer_base+0x1a3/0x2b0 [ 31.655330] ? lock_timer_base+0x1eb/0x2b0 [ 31.659530] ? __internal_add_timer+0x2d0/0x2d0 [ 31.664164] ? trace_hardirqs_on+0xd/0x10 [ 31.668280] try_to_del_timer_sync+0xa2/0x120 [ 31.672741] ? del_timer+0x130/0x130 [ 31.676420] ? del_timer_sync+0xeb/0x240 [ 31.680450] del_timer_sync+0x18a/0x240 [ 31.684392] tun_free_netdev+0x105/0x1b0 [ 31.688419] ? tun_xdp+0x410/0x410 [ 31.691924] ? cpumask_next+0x24/0x30 [ 31.695691] ? netdev_refcnt_read+0xed/0x150 [ 31.700065] ? tun_xdp+0x410/0x410 [ 31.703569] netdev_run_todo+0x870/0xca0 [ 31.707604] ? do_group_exit+0x149/0x400 [ 31.711633] ? register_netdev+0x30/0x30 [ 31.715659] ? lock_downgrade+0x990/0x990 [ 31.719772] ? trace_hardirqs_on+0xd/0x10 [ 31.723892] ? refcount_sub_and_test+0x115/0x1b0 [ 31.728612] ? refcount_inc+0x50/0x50 [ 31.732376] ? refcount_inc+0x50/0x50 [ 31.736143] ? sk_destruct+0x4c/0x80 [ 31.739820] ? __sk_free+0x5c/0x230 [ 31.743411] ? sk_free+0x2f/0x40 [ 31.746742] ? __tun_detach+0x176/0x1390 [ 31.750776] ? tun_attach+0xf90/0xf90 [ 31.754544] ? do_raw_spin_trylock+0x190/0x190 [ 31.759092] ? locks_remove_file+0x3fa/0x5a0 [ 31.763465] ? fcntl_setlk+0x10d0/0x10d0 [ 31.767496] ? __fsnotify_parent+0xb4/0x3a0 [ 31.771784] ? fsnotify+0x1af0/0x1af0 [ 31.775554] ? __tun_detach+0x1390/0x1390 [ 31.779668] ? __tun_detach+0x1390/0x1390 [ 31.783782] rtnl_unlock+0xe/0x10 [ 31.787199] tun_chr_close+0x49/0x60 [ 31.790878] __fput+0x333/0x7f0 [ 31.794127] ? fput+0x140/0x140 [ 31.797374] ? check_same_owner+0x320/0x320 [ 31.801661] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.806122] ____fput+0x15/0x20 [ 31.809366] task_work_run+0x199/0x270 [ 31.813220] ? task_work_cancel+0x210/0x210 [ 31.817505] ? _raw_spin_unlock+0x22/0x30 [ 31.821617] ? switch_task_namespaces+0x87/0xc0 [ 31.826251] do_exit+0x9d2/0x1af0 [ 31.829669] ? __handle_mm_fault+0xf07/0x39c0 [ 31.834132] ? mm_update_next_owner+0x930/0x930 [ 31.838765] ? lock_release+0xd70/0xd70 [ 31.842705] ? check_noncircular+0x20/0x20 [ 31.846903] ? kfree+0xe4/0x250 [ 31.850156] ? kvfree+0x36/0x60 [ 31.853405] ? check_noncircular+0x20/0x20 [ 31.857608] ? __handle_mm_fault+0x587/0x39c0 [ 31.862070] ? __pmd_alloc+0x4e0/0x4e0 [ 31.865927] ? find_held_lock+0x39/0x1d0 [ 31.869958] ? lock_downgrade+0x990/0x990 [ 31.874080] ? handle_mm_fault+0x410/0x8d0 [ 31.878278] ? down_read_trylock+0xdb/0x170 [ 31.882565] ? __do_page_fault+0x31e/0xd60 [ 31.886852] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.891399] ? vmacache_find+0x5f/0x280 [ 31.895339] ? vmacache_update+0xfe/0x130 [ 31.899455] do_group_exit+0x149/0x400 [ 31.903308] ? __do_page_fault+0x3d6/0xd60 [ 31.907508] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 31.911880] ? SyS_exit+0x30/0x30 [ 31.915300] ? do_fast_syscall_32+0x158/0xf05 [ 31.919759] ? do_group_exit+0x400/0x400 [ 31.923782] SyS_exit_group+0x1d/0x20 [ 31.927548] do_fast_syscall_32+0x3f2/0xf05 [ 31.931837] ? do_int80_syscall_32+0x940/0x940 [ 31.936394] ? kasan_check_read+0x11/0x20 [ 31.940507] ? syscall_return_slowpath+0x510/0x510 [ 31.945402] ? SyS_rt_sigaction+0x94/0x1b0 [ 31.949602] ? lockdep_sys_exit+0x47/0xf0 [ 31.953724] ? retint_user+0x18/0x20 [ 31.957406] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 31.962226] entry_SYSENTER_compat+0x51/0x60 [ 31.966599] RIP: 0023:0xf7f4ac79 [ 31.969928] RSP: 002b:00000000ffb2ce0c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 31.977600] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 31.984836] RDX: 0000000000000000 RSI: 00000000080db738 RDI: 00000000080f22a0 [ 31.992081] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 31.999316] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.006549] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000