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: [ 52.824499] ================================================================== [ 52.831917] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 52.838655] Write of size 8 at addr ffff8801ce333780 by task syzkaller145904/2987 [ 52.846244] [ 52.847853] CPU: 0 PID: 2987 Comm: syzkaller145904 Not tainted 4.14.0-rc4+ #38 [ 52.855183] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.864512] Call Trace: [ 52.867078] dump_stack+0x194/0x257 [ 52.870682] ? arch_local_irq_restore+0x53/0x53 [ 52.875327] ? show_regs_print_info+0x65/0x65 [ 52.879793] ? lock_timer_base+0x1a3/0x2b0 [ 52.883999] ? detach_if_pending+0x557/0x610 [ 52.888382] print_address_description+0x73/0x250 [ 52.893194] ? detach_if_pending+0x557/0x610 [ 52.897572] kasan_report+0x25b/0x340 [ 52.901346] __asan_report_store8_noabort+0x17/0x20 [ 52.906332] detach_if_pending+0x557/0x610 [ 52.910539] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.915700] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.920337] ? lock_timer_base+0x1a3/0x2b0 [ 52.924544] ? lock_timer_base+0x1eb/0x2b0 [ 52.928753] ? __internal_add_timer+0x2d0/0x2d0 [ 52.933393] ? trace_hardirqs_on+0xd/0x10 [ 52.937521] try_to_del_timer_sync+0xa2/0x120 [ 52.941986] ? del_timer+0x130/0x130 [ 52.945673] ? del_timer_sync+0xeb/0x240 [ 52.949713] del_timer_sync+0x18a/0x240 [ 52.953661] tun_free_netdev+0x105/0x1b0 [ 52.957693] ? tun_xdp+0x410/0x410 [ 52.961203] ? cpumask_next+0x24/0x30 [ 52.964978] ? netdev_refcnt_read+0xed/0x150 [ 52.969362] ? tun_xdp+0x410/0x410 [ 52.972872] netdev_run_todo+0x870/0xca0 [ 52.976908] ? do_group_exit+0x149/0x400 [ 52.980945] ? register_netdev+0x30/0x30 [ 52.984978] ? lock_downgrade+0x990/0x990 [ 52.989095] ? trace_hardirqs_on+0xd/0x10 [ 52.993231] ? refcount_sub_and_test+0x115/0x1b0 [ 52.997958] ? refcount_inc+0x50/0x50 [ 53.001732] ? refcount_inc+0x50/0x50 [ 53.005506] ? sk_destruct+0x4c/0x80 [ 53.009188] ? __sk_free+0x5c/0x230 [ 53.012789] ? sk_free+0x2f/0x40 [ 53.016125] ? __tun_detach+0x176/0x1390 [ 53.020167] ? tun_attach+0xf90/0xf90 [ 53.023943] ? do_raw_spin_trylock+0x190/0x190 [ 53.028497] ? locks_remove_file+0x3fa/0x5a0 [ 53.032910] ? fcntl_setlk+0x10d0/0x10d0 [ 53.036944] ? __fsnotify_parent+0xb4/0x3a0 [ 53.041238] ? fsnotify+0x1af0/0x1af0 [ 53.045012] ? __tun_detach+0x1390/0x1390 [ 53.049129] ? __tun_detach+0x1390/0x1390 [ 53.053249] rtnl_unlock+0xe/0x10 [ 53.056671] tun_chr_close+0x49/0x60 [ 53.060357] __fput+0x333/0x7f0 [ 53.063613] ? fput+0x140/0x140 [ 53.066863] ? check_same_owner+0x320/0x320 [ 53.071165] ? _raw_spin_unlock_irq+0x27/0x70 [ 53.075638] ____fput+0x15/0x20 [ 53.078890] task_work_run+0x199/0x270 [ 53.082751] ? task_work_cancel+0x210/0x210 [ 53.087043] ? _raw_spin_unlock+0x22/0x30 [ 53.091160] ? switch_task_namespaces+0x87/0xc0 [ 53.095803] do_exit+0x9d2/0x1af0 [ 53.099226] ? __handle_mm_fault+0xf07/0x39c0 [ 53.103699] ? mm_update_next_owner+0x930/0x930 [ 53.108336] ? lock_release+0xd70/0xd70 [ 53.112281] ? check_noncircular+0x20/0x20 [ 53.116488] ? kfree+0xe4/0x250 [ 53.119741] ? kvfree+0x36/0x60 [ 53.123001] ? check_noncircular+0x20/0x20 [ 53.127213] ? __handle_mm_fault+0x587/0x39c0 [ 53.131685] ? __pmd_alloc+0x4e0/0x4e0 [ 53.135553] ? find_held_lock+0x39/0x1d0 [ 53.139594] ? lock_downgrade+0x990/0x990 [ 53.143734] ? handle_mm_fault+0x410/0x8d0 [ 53.147937] ? down_read_trylock+0xdb/0x170 [ 53.152228] ? __do_page_fault+0x31e/0xd60 [ 53.156435] ? __handle_mm_fault+0x39c0/0x39c0 [ 53.160987] ? vmacache_find+0x5f/0x280 [ 53.164938] ? vmacache_update+0xfe/0x130 [ 53.169063] do_group_exit+0x149/0x400 [ 53.172919] ? __do_page_fault+0x3d6/0xd60 [ 53.177298] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 53.181679] ? SyS_exit+0x30/0x30 [ 53.185110] ? do_fast_syscall_32+0x158/0xf05 [ 53.189575] ? do_group_exit+0x400/0x400 [ 53.193608] SyS_exit_group+0x1d/0x20 [ 53.197378] do_fast_syscall_32+0x3f2/0xf05 [ 53.201676] ? do_int80_syscall_32+0x940/0x940 [ 53.206228] ? kasan_check_read+0x11/0x20 [ 53.210348] ? syscall_return_slowpath+0x510/0x510 [ 53.215250] ? SyS_rt_sigaction+0x94/0x1b0 [ 53.219457] ? lockdep_sys_exit+0x47/0xf0 [ 53.223576] ? retint_user+0x18/0x20 [ 53.227267] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 53.232086] entry_SYSENTER_compat+0x51/0x60 [ 53.236465] RIP: 0023:0xf7f86c79 [ 53.239798] RSP: 002b:00000000ffe0934c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 53.247482] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 53.254723] RDX: 0000000000000000 RSI: 00000000080db4b8 RDI: 00000000080f22a0 [ 53.261982] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 53.269225] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 53.276466] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 53.283728] [ 53.285328] Allocated by task 2987: [ 53.288928] save_stack_trace+0x16/0x20 [ 53.292872] save_stack+0x43/0xd0 [ 53.296295] kasan_kmalloc+0xad/0xe0 [ 53.299977] __kmalloc_node+0x47/0x70 [ 53.303746] kvmalloc_node+0x64/0xd0 [ 53.307429] alloc_netdev_mqs+0x16e/0xed0 [ 53.311546] __tun_chr_ioctl+0x12be/0x3d20 [ 53.315757] tun_chr_compat_ioctl+0x29/0x30 [ 53.320048] compat_SyS_ioctl+0x1d7/0x3290 [ 53.324251] do_fast_syscall_32+0x3f2/0xf05 [ 53.328542] entry_SYSENTER_compat+0x51/0x60 [ 53.332917] [ 53.334513] Freed by task 2987: [ 53.337760] save_stack_trace+0x16/0x20 [ 53.341702] save_stack+0x43/0xd0 [ 53.345123] kasan_slab_free+0x71/0xc0 [ 53.348980] kfree+0xca/0x250 [ 53.352052] kvfree+0x36/0x60 [ 53.355126] free_netdev+0x2cf/0x360 [ 53.358826] __tun_chr_ioctl+0x2cf6/0x3d20 [ 53.363030] tun_chr_compat_ioctl+0x29/0x30 [ 53.367320] compat_SyS_ioctl+0x1d7/0x3290 [ 53.371522] do_fast_syscall_32+0x3f2/0xf05 [ 53.375810] entry_SYSENTER_compat+0x51/0x60 [ 53.380185] [ 53.381782] The buggy address belongs to the object at ffff8801ce330380 [ 53.381782] which belongs to the cache kmalloc-16384 of size 16384 [ 53.394753] The buggy address is located 13312 bytes inside of [ 53.394753] 16384-byte region [ffff8801ce330380, ffff8801ce334380) [ 53.406942] The buggy address belongs to the page: [ 53.411839] page:ffffea000738cc00 count:1 mapcount:0 mapping:ffff8801ce330380 index:0x0 compound_mapcount: 0 [ 53.421784] flags: 0x200000000008100(slab|head) [ 53.426424] raw: 0200000000008100 ffff8801ce330380 0000000000000000 0000000100000001 [ 53.434273] raw: ffffea0007331820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 53.442120] page dumped because: kasan: bad access detected [ 53.447797] [ 53.449395] Memory state around the buggy address: [ 53.454293] ffff8801ce333680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.461621] ffff8801ce333700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.468948] >ffff8801ce333780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.476274] ^ [ 53.479610] ffff8801ce333800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.486936] ffff8801ce333880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.494262] ================================================================== [ 53.501587] Disabling lock debugging due to kernel taint [ 53.506999] Kernel panic - not syncing: panic_on_warn set ... [ 53.506999] [ 53.514326] CPU: 0 PID: 2987 Comm: syzkaller145904 Tainted: G B 4.14.0-rc4+ #38 [ 53.522871] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 53.532188] Call Trace: [ 53.534741] dump_stack+0x194/0x257 [ 53.538333] ? arch_local_irq_restore+0x53/0x53 [ 53.542965] ? vprintk_default+0x28/0x30 [ 53.546992] ? detach_if_pending+0x540/0x610 [ 53.551365] panic+0x1e4/0x417 [ 53.554522] ? __warn+0x1d9/0x1d9 [ 53.557944] ? detach_if_pending+0x557/0x610 [ 53.562315] kasan_end_report+0x50/0x50 [ 53.566252] kasan_report+0x144/0x340 [ 53.570017] __asan_report_store8_noabort+0x17/0x20 [ 53.574996] detach_if_pending+0x557/0x610 [ 53.579194] ? trace_raw_output_tick_stop+0x130/0x130 [ 53.584348] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 53.588979] ? lock_timer_base+0x1a3/0x2b0 [ 53.593177] ? lock_timer_base+0x1eb/0x2b0 [ 53.597377] ? __internal_add_timer+0x2d0/0x2d0 [ 53.602011] ? trace_hardirqs_on+0xd/0x10 [ 53.606126] try_to_del_timer_sync+0xa2/0x120 [ 53.610583] ? del_timer+0x130/0x130 [ 53.614261] ? del_timer_sync+0xeb/0x240 [ 53.618288] del_timer_sync+0x18a/0x240 [ 53.622227] tun_free_netdev+0x105/0x1b0 [ 53.626252] ? tun_xdp+0x410/0x410 [ 53.629754] ? cpumask_next+0x24/0x30 [ 53.633520] ? netdev_refcnt_read+0xed/0x150 [ 53.637894] ? tun_xdp+0x410/0x410 [ 53.641397] netdev_run_todo+0x870/0xca0 [ 53.645420] ? do_group_exit+0x149/0x400 [ 53.649449] ? register_netdev+0x30/0x30 [ 53.653474] ? lock_downgrade+0x990/0x990 [ 53.657585] ? trace_hardirqs_on+0xd/0x10 [ 53.661705] ? refcount_sub_and_test+0x115/0x1b0 [ 53.666424] ? refcount_inc+0x50/0x50 [ 53.670190] ? refcount_inc+0x50/0x50 [ 53.673961] ? sk_destruct+0x4c/0x80 [ 53.677638] ? __sk_free+0x5c/0x230 [ 53.681231] ? sk_free+0x2f/0x40 [ 53.684562] ? __tun_detach+0x176/0x1390 [ 53.688592] ? tun_attach+0xf90/0xf90 [ 53.692358] ? do_raw_spin_trylock+0x190/0x190 [ 53.696906] ? locks_remove_file+0x3fa/0x5a0 [ 53.701278] ? fcntl_setlk+0x10d0/0x10d0 [ 53.705305] ? __fsnotify_parent+0xb4/0x3a0 [ 53.709590] ? fsnotify+0x1af0/0x1af0 [ 53.713355] ? __tun_detach+0x1390/0x1390 [ 53.717466] ? __tun_detach+0x1390/0x1390 [ 53.721579] rtnl_unlock+0xe/0x10 [ 53.724995] tun_chr_close+0x49/0x60 [ 53.728681] __fput+0x333/0x7f0 [ 53.731928] ? fput+0x140/0x140 [ 53.735174] ? check_same_owner+0x320/0x320 [ 53.739458] ? _raw_spin_unlock_irq+0x27/0x70 [ 53.743920] ____fput+0x15/0x20 [ 53.747163] task_work_run+0x199/0x270 [ 53.751015] ? task_work_cancel+0x210/0x210 [ 53.755300] ? _raw_spin_unlock+0x22/0x30 [ 53.759414] ? switch_task_namespaces+0x87/0xc0 [ 53.764048] do_exit+0x9d2/0x1af0 [ 53.767465] ? __handle_mm_fault+0xf07/0x39c0 [ 53.771925] ? mm_update_next_owner+0x930/0x930 [ 53.776557] ? lock_release+0xd70/0xd70 [ 53.780494] ? check_noncircular+0x20/0x20 [ 53.784694] ? kfree+0xe4/0x250 [ 53.787935] ? kvfree+0x36/0x60 [ 53.791183] ? check_noncircular+0x20/0x20 [ 53.795385] ? __handle_mm_fault+0x587/0x39c0 [ 53.799845] ? __pmd_alloc+0x4e0/0x4e0 [ 53.803701] ? find_held_lock+0x39/0x1d0 [ 53.807732] ? lock_downgrade+0x990/0x990 [ 53.811853] ? handle_mm_fault+0x410/0x8d0 [ 53.816050] ? down_read_trylock+0xdb/0x170 [ 53.820336] ? __do_page_fault+0x31e/0xd60 [ 53.824535] ? __handle_mm_fault+0x39c0/0x39c0