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-1,10.128.0.53' (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: [ 41.967320] ================================================================== [ 41.968452] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.969348] Write of size 8 at addr ffff8801ce6fb740 by task syzkaller442630/2977 [ 41.970368] [ 41.970606] CPU: 1 PID: 2977 Comm: syzkaller442630 Not tainted 4.14.0-rc2+ #18 [ 41.971573] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.972795] Call Trace: [ 41.973163] dump_stack+0x194/0x257 [ 41.973661] ? arch_local_irq_restore+0x53/0x53 [ 41.974289] ? show_regs_print_info+0x65/0x65 [ 41.974894] ? lock_timer_base+0x1a3/0x2b0 [ 41.975470] ? detach_if_pending+0x557/0x610 [ 41.976065] print_address_description+0x73/0x250 [ 41.976714] ? detach_if_pending+0x557/0x610 [ 41.977309] kasan_report+0x25b/0x340 [ 41.977828] __asan_report_store8_noabort+0x17/0x20 [ 41.978499] detach_if_pending+0x557/0x610 [ 41.979072] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.979767] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.980393] ? lock_timer_base+0x1a3/0x2b0 [ 41.980965] ? lock_timer_base+0x1eb/0x2b0 [ 41.981540] ? __internal_add_timer+0x2d0/0x2d0 [ 41.982170] ? trace_hardirqs_on+0xd/0x10 [ 41.982761] try_to_del_timer_sync+0xa2/0x120 [ 41.983374] ? del_timer+0x130/0x130 [ 41.983879] ? del_timer_sync+0xeb/0x240 [ 41.984433] del_timer_sync+0x18a/0x240 [ 41.984980] tun_free_netdev+0x105/0x1b0 [ 41.985528] ? tun_xdp+0x410/0x410 [ 41.986011] ? cpumask_next+0x24/0x30 [ 41.986542] ? netdev_refcnt_read+0xed/0x150 [ 41.987139] ? tun_xdp+0x410/0x410 [ 41.987621] netdev_run_todo+0x870/0xca0 [ 41.991657] ? do_group_exit+0x149/0x400 [ 41.995703] ? register_netdev+0x30/0x30 [ 41.999756] ? lock_downgrade+0x990/0x990 [ 42.003888] ? trace_hardirqs_on+0xd/0x10 [ 42.008030] ? refcount_sub_and_test+0x115/0x1b0 [ 42.012756] ? refcount_inc+0x50/0x50 [ 42.016534] ? refcount_inc+0x50/0x50 [ 42.020317] ? sk_destruct+0x4c/0x80 [ 42.024002] ? __sk_free+0x5c/0x230 [ 42.027602] ? sk_free+0x2f/0x40 [ 42.030944] ? __tun_detach+0x176/0x1390 [ 42.034989] ? tun_attach+0xf90/0xf90 [ 42.038766] ? do_raw_spin_trylock+0x190/0x190 [ 42.043320] ? locks_remove_file+0x3fa/0x5a0 [ 42.047702] ? fcntl_setlk+0x10d0/0x10d0 [ 42.051739] ? __fsnotify_parent+0xb4/0x3a0 [ 42.056034] ? fsnotify+0x1af0/0x1af0 [ 42.059807] ? __tun_detach+0x1390/0x1390 [ 42.063925] ? __tun_detach+0x1390/0x1390 [ 42.068046] rtnl_unlock+0xe/0x10 [ 42.071470] tun_chr_close+0x49/0x60 [ 42.075155] __fput+0x333/0x7f0 [ 42.078412] ? fput+0x140/0x140 [ 42.081667] ? check_same_owner+0x320/0x320 [ 42.085962] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.090437] ____fput+0x15/0x20 [ 42.093689] task_work_run+0x199/0x270 [ 42.097549] ? task_work_cancel+0x210/0x210 [ 42.101842] ? _raw_spin_unlock+0x22/0x30 [ 42.105963] ? switch_task_namespaces+0x87/0xc0 [ 42.110617] do_exit+0x9d2/0x1af0 [ 42.114049] ? mm_update_next_owner+0x930/0x930 [ 42.118694] ? lock_acquire+0x1d5/0x580 [ 42.122641] ? __handle_mm_fault+0xf07/0x39c0 [ 42.127114] ? lock_release+0xd70/0xd70 [ 42.131060] ? check_noncircular+0x20/0x20 [ 42.135268] ? kvfree+0x3b/0x60 [ 42.138527] ? rtnl_unlock+0xe/0x10 [ 42.142127] ? check_noncircular+0x20/0x20 [ 42.146338] ? __handle_mm_fault+0x587/0x39c0 [ 42.150810] ? __pmd_alloc+0x4e0/0x4e0 [ 42.154680] ? find_held_lock+0x39/0x1d0 [ 42.158723] ? lock_downgrade+0x990/0x990 [ 42.162868] do_group_exit+0x149/0x400 [ 42.166728] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.171291] ? vmacache_find+0x5f/0x280 [ 42.175238] ? SyS_exit+0x30/0x30 [ 42.178668] ? do_fast_syscall_32+0x158/0xf05 [ 42.183136] ? do_group_exit+0x400/0x400 [ 42.187173] SyS_exit_group+0x1d/0x20 [ 42.190946] do_fast_syscall_32+0x3f2/0xf05 [ 42.195245] ? do_int80_syscall_32+0x940/0x940 [ 42.199801] ? kasan_check_read+0x11/0x20 [ 42.203923] ? syscall_return_slowpath+0x510/0x510 [ 42.208827] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.213044] ? lockdep_sys_exit+0x47/0xf0 [ 42.217164] ? retint_user+0x18/0x20 [ 42.220854] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.225676] entry_SYSENTER_compat+0x51/0x60 [ 42.230058] RIP: 0023:0xf7f5ec79 [ 42.233393] RSP: 002b:00000000ffd138ec EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 42.241084] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 42.248325] RDX: 0000000000000000 RSI: 00000000080db838 RDI: 00000000080f22a0 [ 42.255564] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.262802] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.270044] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.277402] [ 42.279006] Allocated by task 2977: [ 42.282615] save_stack_trace+0x16/0x20 [ 42.286560] save_stack+0x43/0xd0 [ 42.289982] kasan_kmalloc+0xad/0xe0 [ 42.293663] __kmalloc_node+0x47/0x70 [ 42.297436] kvmalloc_node+0x64/0xd0 [ 42.301122] alloc_netdev_mqs+0x16e/0xed0 [ 42.305243] __tun_chr_ioctl+0x12be/0x3d20 [ 42.309446] tun_chr_compat_ioctl+0x29/0x30 [ 42.313737] compat_SyS_ioctl+0x1d7/0x3290 [ 42.317942] do_fast_syscall_32+0x3f2/0xf05 [ 42.322233] entry_SYSENTER_compat+0x51/0x60 [ 42.326607] [ 42.328206] Freed by task 2977: [ 42.331454] save_stack_trace+0x16/0x20 [ 42.335398] save_stack+0x43/0xd0 [ 42.338823] kasan_slab_free+0x71/0xc0 [ 42.342678] kfree+0xca/0x250 [ 42.345752] kvfree+0x36/0x60 [ 42.348827] free_netdev+0x2cf/0x360 [ 42.352509] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.356711] tun_chr_compat_ioctl+0x29/0x30 [ 42.361000] compat_SyS_ioctl+0x1d7/0x3290 [ 42.365204] do_fast_syscall_32+0x3f2/0xf05 [ 42.369494] entry_SYSENTER_compat+0x51/0x60 [ 42.373866] [ 42.375464] The buggy address belongs to the object at ffff8801ce6f8340 [ 42.375464] which belongs to the cache kmalloc-16384 of size 16384 [ 42.388444] The buggy address is located 13312 bytes inside of [ 42.388444] 16384-byte region [ffff8801ce6f8340, ffff8801ce6fc340) [ 42.400631] The buggy address belongs to the page: [ 42.405529] page:ffffea000739be00 count:1 mapcount:0 mapping:ffff8801ce6f8340 index:0x0 compound_mapcount: 0 [ 42.415473] flags: 0x200000000008100(slab|head) [ 42.420113] raw: 0200000000008100 ffff8801ce6f8340 0000000000000000 0000000100000001 [ 42.427974] raw: ffffea0007380820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.435820] page dumped because: kasan: bad access detected [ 42.441504] [ 42.443102] Memory state around the buggy address: [ 42.447999] ffff8801ce6fb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.455336] ffff8801ce6fb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.462664] >ffff8801ce6fb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.469992] ^ [ 42.475410] ffff8801ce6fb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.482746] ffff8801ce6fb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.490074] ================================================================== [ 42.497403] Disabling lock debugging due to kernel taint [ 42.502818] Kernel panic - not syncing: panic_on_warn set ... [ 42.502818] [ 42.510146] CPU: 1 PID: 2977 Comm: syzkaller442630 Tainted: G B 4.14.0-rc2+ #18 [ 42.518683] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.528000] Call Trace: [ 42.530554] dump_stack+0x194/0x257 [ 42.534147] ? arch_local_irq_restore+0x53/0x53 [ 42.538785] ? vprintk_default+0x28/0x30 [ 42.542815] ? detach_if_pending+0x4d0/0x610 [ 42.547191] panic+0x1e4/0x417 [ 42.550348] ? __warn+0x1d9/0x1d9 [ 42.553773] ? detach_if_pending+0x557/0x610 [ 42.558147] kasan_end_report+0x50/0x50 [ 42.562084] kasan_report+0x144/0x340 [ 42.565849] __asan_report_store8_noabort+0x17/0x20 [ 42.570828] detach_if_pending+0x557/0x610 [ 42.575026] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.580181] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.584812] ? lock_timer_base+0x1a3/0x2b0 [ 42.589010] ? lock_timer_base+0x1eb/0x2b0 [ 42.593211] ? __internal_add_timer+0x2d0/0x2d0 [ 42.597844] ? trace_hardirqs_on+0xd/0x10 [ 42.601960] try_to_del_timer_sync+0xa2/0x120 [ 42.606418] ? del_timer+0x130/0x130 [ 42.610099] ? del_timer_sync+0xeb/0x240 [ 42.614128] del_timer_sync+0x18a/0x240 [ 42.618070] tun_free_netdev+0x105/0x1b0 [ 42.622097] ? tun_xdp+0x410/0x410 [ 42.625599] ? cpumask_next+0x24/0x30 [ 42.629368] ? netdev_refcnt_read+0xed/0x150 [ 42.633746] ? tun_xdp+0x410/0x410 [ 42.637253] netdev_run_todo+0x870/0xca0 [ 42.641288] ? do_group_exit+0x149/0x400 [ 42.645322] ? register_netdev+0x30/0x30 [ 42.649350] ? lock_downgrade+0x990/0x990 [ 42.653462] ? trace_hardirqs_on+0xd/0x10 [ 42.657586] ? refcount_sub_and_test+0x115/0x1b0 [ 42.662307] ? refcount_inc+0x50/0x50 [ 42.666072] ? refcount_inc+0x50/0x50 [ 42.669840] ? sk_destruct+0x4c/0x80 [ 42.673518] ? __sk_free+0x5c/0x230 [ 42.677111] ? sk_free+0x2f/0x40 [ 42.680444] ? __tun_detach+0x176/0x1390 [ 42.684475] ? tun_attach+0xf90/0xf90 [ 42.688242] ? do_raw_spin_trylock+0x190/0x190 [ 42.692790] ? locks_remove_file+0x3fa/0x5a0 [ 42.697172] ? fcntl_setlk+0x10d0/0x10d0 [ 42.701202] ? __fsnotify_parent+0xb4/0x3a0 [ 42.705489] ? fsnotify+0x1af0/0x1af0 [ 42.709254] ? __tun_detach+0x1390/0x1390 [ 42.713366] ? __tun_detach+0x1390/0x1390 [ 42.717485] rtnl_unlock+0xe/0x10 [ 42.720903] tun_chr_close+0x49/0x60 [ 42.724583] __fput+0x333/0x7f0 [ 42.727829] ? fput+0x140/0x140 [ 42.731075] ? check_same_owner+0x320/0x320 [ 42.735360] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.739823] ____fput+0x15/0x20 [ 42.743070] task_work_run+0x199/0x270 [ 42.746925] ? task_work_cancel+0x210/0x210 [ 42.751209] ? _raw_spin_unlock+0x22/0x30 [ 42.755321] ? switch_task_namespaces+0x87/0xc0 [ 42.759957] do_exit+0x9d2/0x1af0 [ 42.763380] ? mm_update_next_owner+0x930/0x930 [ 42.768014] ? lock_acquire+0x1d5/0x580 [ 42.771959] ? __handle_mm_fault+0xf07/0x39c0 [ 42.776425] ? lock_release+0xd70/0xd70 [ 42.780369] ? check_noncircular+0x20/0x20 [ 42.784570] ? kvfree+0x3b/0x60 [ 42.787818] ? rtnl_unlock+0xe/0x10 [ 42.791413] ? check_noncircular+0x20/0x20 [ 42.795614] ? __handle_mm_fault+0x587/0x39c0 [ 42.800075] ? __pmd_alloc+0x4e0/0x4e0 [ 42.803934] ? find_held_lock+0x39/0x1d0 [ 42.807965] ? lock_downgrade+0x990/0x990 [ 42.812089] do_group_exit+0x149/0x400 [ 42.815940] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.820488] ? vmacache_find+0x5f/0x280 [ 42.824427] ? SyS_exit+0x30/0x30 [ 42.827847] ? do_fast_syscall_32+0x158/0xf05 [ 42.832304] ? do_group_exit+0x400/0x400 [ 42.836328] SyS_exit_group+0x1d/0x20 [ 42.840094] do_fast_syscall_32+0x3f2/0xf05 [ 42.844384] ? do_int80_syscall_32+0x940/0x940 [ 42.848932] ? kasan_check_read+0x11/0x20 [ 42.853044] ? syscall_return_slowpath+0x510/0x510 [ 42.857954] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.862155] ? lockdep_sys_exit+0x47/0xf0 [ 42.866269] ? retint_user+0x18/0x20 [ 42.869959] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.874773] entry_SYSENTER_compat+0x51/0x60 [ 42.879146] RIP: 0023:0xf7f5ec79 [ 42.882475] RSP: 002b:00000000ffd138ec EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 42.890146] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 42.897380] RDX: 0000000000000000 RSI: 00000000080db838 RDI: 00000000080f22a0 [ 42.904614] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.911859] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.919092] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000