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-2,10.128.0.15' (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: [ 32.425322] ================================================================== [ 32.432759] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.439484] Write of size 8 at addr ffff8801ce06b780 by task syzkaller165482/2987 [ 32.447070] [ 32.448672] CPU: 0 PID: 2987 Comm: syzkaller165482 Not tainted 4.14.0-rc2+ #14 [ 32.456000] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.465324] Call Trace: [ 32.467886] dump_stack+0x194/0x257 [ 32.471488] ? arch_local_irq_restore+0x53/0x53 [ 32.476129] ? show_regs_print_info+0x65/0x65 [ 32.480596] ? lock_timer_base+0x1a3/0x2b0 [ 32.484801] ? detach_if_pending+0x557/0x610 [ 32.489268] print_address_description+0x73/0x250 [ 32.494080] ? detach_if_pending+0x557/0x610 [ 32.498457] kasan_report+0x25b/0x340 [ 32.502231] __asan_report_store8_noabort+0x17/0x20 [ 32.507215] detach_if_pending+0x557/0x610 [ 32.511422] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.516583] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.521220] ? lock_timer_base+0x1a3/0x2b0 [ 32.525426] ? lock_timer_base+0x1eb/0x2b0 [ 32.529635] ? __internal_add_timer+0x2d0/0x2d0 [ 32.534276] ? trace_hardirqs_on+0xd/0x10 [ 32.538402] try_to_del_timer_sync+0xa2/0x120 [ 32.542864] ? del_timer+0x130/0x130 [ 32.546549] ? del_timer_sync+0xeb/0x240 [ 32.550585] del_timer_sync+0x18a/0x240 [ 32.554532] tun_free_netdev+0x105/0x1b0 [ 32.558564] ? tun_xdp+0x410/0x410 [ 32.562072] ? cpumask_next+0x24/0x30 [ 32.565848] ? netdev_refcnt_read+0xed/0x150 [ 32.570229] ? tun_xdp+0x410/0x410 [ 32.573739] netdev_run_todo+0x870/0xca0 [ 32.577770] ? do_group_exit+0x149/0x400 [ 32.581809] ? register_netdev+0x30/0x30 [ 32.585841] ? lock_downgrade+0x990/0x990 [ 32.589958] ? trace_hardirqs_on+0xd/0x10 [ 32.594095] ? refcount_sub_and_test+0x115/0x1b0 [ 32.598821] ? refcount_inc+0x50/0x50 [ 32.602591] ? refcount_inc+0x50/0x50 [ 32.606369] ? sk_destruct+0x4c/0x80 [ 32.610053] ? __sk_free+0x5c/0x230 [ 32.613651] ? sk_free+0x2f/0x40 [ 32.616989] ? __tun_detach+0x176/0x1390 [ 32.621032] ? tun_attach+0xf90/0xf90 [ 32.624812] ? locks_remove_file+0x3fa/0x5a0 [ 32.629192] ? fcntl_setlk+0x10d0/0x10d0 [ 32.633228] ? __fsnotify_parent+0xb4/0x3a0 [ 32.637521] ? fsnotify+0x1af0/0x1af0 [ 32.641294] ? __tun_detach+0x1390/0x1390 [ 32.645413] ? __tun_detach+0x1390/0x1390 [ 32.649559] rtnl_unlock+0xe/0x10 [ 32.653015] tun_chr_close+0x49/0x60 [ 32.656711] __fput+0x333/0x7f0 [ 32.659972] ? fput+0x140/0x140 [ 32.663228] ? check_same_owner+0x320/0x320 [ 32.667530] ____fput+0x15/0x20 [ 32.670781] task_work_run+0x199/0x270 [ 32.674643] ? task_work_cancel+0x210/0x210 [ 32.678934] ? free_nsproxy+0x185/0x1f0 [ 32.682882] ? switch_task_namespaces+0xa2/0xc0 [ 32.687524] do_exit+0x9d2/0x1af0 [ 32.690949] ? trace_hardirqs_on+0xd/0x10 [ 32.695074] ? mm_update_next_owner+0x930/0x930 [ 32.699712] ? mark_held_locks+0xb2/0x100 [ 32.703831] ? kfree+0xe4/0x250 [ 32.707081] ? kvfree+0x36/0x60 [ 32.710330] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.715316] ? trace_hardirqs_on+0xd/0x10 [ 32.719436] ? kvfree+0x3b/0x60 [ 32.722701] ? rtnl_unlock+0xe/0x10 [ 32.726296] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.730601] ? __pmd_alloc+0x4e0/0x4e0 [ 32.734472] ? __might_sleep+0x95/0x190 [ 32.738434] ? selinux_file_ioctl+0x444/0x690 [ 32.742910] ? __fget_light+0x29d/0x390 [ 32.746883] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.751346] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.755816] do_group_exit+0x149/0x400 [ 32.759670] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.764232] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.768611] ? SyS_exit+0x30/0x30 [ 32.772040] ? do_ioctl+0x60/0x60 [ 32.775470] ? do_fast_syscall_32+0x158/0xf05 [ 32.779937] ? do_group_exit+0x400/0x400 [ 32.783970] SyS_exit_group+0x1d/0x20 [ 32.787739] do_fast_syscall_32+0x3f2/0xf05 [ 32.792039] ? do_int80_syscall_32+0x940/0x940 [ 32.796590] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.801322] ? lockdep_sys_exit+0x47/0xf0 [ 32.805440] ? syscall_return_slowpath+0x2b3/0x510 [ 32.810348] ? sysret32_from_system_call+0x5/0x3b [ 32.815165] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.819988] entry_SYSENTER_compat+0x51/0x60 [ 32.824366] RIP: 0023:0xf7f0dc79 [ 32.827699] RSP: 002b:00000000ffc8167c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 32.835378] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffc81868 [ 32.842616] RDX: 0000000008048c9a RSI: 0000000000000036 RDI: 0000000000000004 [ 32.849854] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 32.857095] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.864354] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.871613] [ 32.873211] Allocated by task 2987: [ 32.876806] save_stack_trace+0x16/0x20 [ 32.880749] save_stack+0x43/0xd0 [ 32.884171] kasan_kmalloc+0xad/0xe0 [ 32.887852] __kmalloc_node+0x47/0x70 [ 32.891622] kvmalloc_node+0x64/0xd0 [ 32.895307] alloc_netdev_mqs+0x16e/0xed0 [ 32.899424] __tun_chr_ioctl+0x12be/0x3d20 [ 32.903626] tun_chr_compat_ioctl+0x29/0x30 [ 32.907917] compat_SyS_ioctl+0x1d7/0x3290 [ 32.912120] do_fast_syscall_32+0x3f2/0xf05 [ 32.916408] entry_SYSENTER_compat+0x51/0x60 [ 32.920782] [ 32.922378] Freed by task 2987: [ 32.925625] save_stack_trace+0x16/0x20 [ 32.929568] save_stack+0x43/0xd0 [ 32.932987] kasan_slab_free+0x71/0xc0 [ 32.936841] kfree+0xca/0x250 [ 32.939916] kvfree+0x36/0x60 [ 32.942993] free_netdev+0x2cf/0x360 [ 32.946675] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.950877] tun_chr_compat_ioctl+0x29/0x30 [ 32.955170] compat_SyS_ioctl+0x1d7/0x3290 [ 32.959371] do_fast_syscall_32+0x3f2/0xf05 [ 32.963659] entry_SYSENTER_compat+0x51/0x60 [ 32.968034] [ 32.969643] The buggy address belongs to the object at ffff8801ce068380 [ 32.969643] which belongs to the cache kmalloc-16384 of size 16384 [ 32.982615] The buggy address is located 13312 bytes inside of [ 32.982615] 16384-byte region [ffff8801ce068380, ffff8801ce06c380) [ 32.994802] The buggy address belongs to the page: [ 32.999700] page:ffffea0007381a00 count:1 mapcount:0 mapping:ffff8801ce068380 index:0x0 compound_mapcount: 0 [ 33.009643] flags: 0x200000000008100(slab|head) [ 33.014282] raw: 0200000000008100 ffff8801ce068380 0000000000000000 0000000100000001 [ 33.022137] raw: ffffea000738a020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 33.029983] page dumped because: kasan: bad access detected [ 33.035658] [ 33.037253] Memory state around the buggy address: [ 33.042153] ffff8801ce06b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.049479] ffff8801ce06b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.056808] >ffff8801ce06b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.064136] ^ [ 33.067468] ffff8801ce06b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.074796] ffff8801ce06b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.082119] ================================================================== [ 33.089442] Disabling lock debugging due to kernel taint [ 33.094854] Kernel panic - not syncing: panic_on_warn set ... [ 33.094854] [ 33.102189] CPU: 0 PID: 2987 Comm: syzkaller165482 Tainted: G B 4.14.0-rc2+ #14 [ 33.110727] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.120043] Call Trace: [ 33.122602] dump_stack+0x194/0x257 [ 33.126194] ? arch_local_irq_restore+0x53/0x53 [ 33.130829] ? vprintk_default+0x28/0x30 [ 33.134865] ? detach_if_pending+0x540/0x610 [ 33.139237] panic+0x1e4/0x417 [ 33.142393] ? __warn+0x1d9/0x1d9 [ 33.145816] ? detach_if_pending+0x557/0x610 [ 33.150187] kasan_end_report+0x50/0x50 [ 33.154125] kasan_report+0x144/0x340 [ 33.157892] __asan_report_store8_noabort+0x17/0x20 [ 33.162873] detach_if_pending+0x557/0x610 [ 33.167074] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.172228] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.176859] ? lock_timer_base+0x1a3/0x2b0 [ 33.181058] ? lock_timer_base+0x1eb/0x2b0 [ 33.185256] ? __internal_add_timer+0x2d0/0x2d0 [ 33.189889] ? trace_hardirqs_on+0xd/0x10 [ 33.194004] try_to_del_timer_sync+0xa2/0x120 [ 33.198462] ? del_timer+0x130/0x130 [ 33.202143] ? del_timer_sync+0xeb/0x240 [ 33.206174] del_timer_sync+0x18a/0x240 [ 33.210118] tun_free_netdev+0x105/0x1b0 [ 33.214148] ? tun_xdp+0x410/0x410 [ 33.217655] ? cpumask_next+0x24/0x30 [ 33.221421] ? netdev_refcnt_read+0xed/0x150 [ 33.225793] ? tun_xdp+0x410/0x410 [ 33.229296] netdev_run_todo+0x870/0xca0 [ 33.233323] ? do_group_exit+0x149/0x400 [ 33.237353] ? register_netdev+0x30/0x30 [ 33.241379] ? lock_downgrade+0x990/0x990 [ 33.245490] ? trace_hardirqs_on+0xd/0x10 [ 33.249613] ? refcount_sub_and_test+0x115/0x1b0 [ 33.254332] ? refcount_inc+0x50/0x50 [ 33.258097] ? refcount_inc+0x50/0x50 [ 33.261864] ? sk_destruct+0x4c/0x80 [ 33.265551] ? __sk_free+0x5c/0x230 [ 33.269144] ? sk_free+0x2f/0x40 [ 33.272472] ? __tun_detach+0x176/0x1390 [ 33.276500] ? tun_attach+0xf90/0xf90 [ 33.280270] ? locks_remove_file+0x3fa/0x5a0 [ 33.284644] ? fcntl_setlk+0x10d0/0x10d0 [ 33.288672] ? __fsnotify_parent+0xb4/0x3a0 [ 33.292960] ? fsnotify+0x1af0/0x1af0 [ 33.296726] ? __tun_detach+0x1390/0x1390 [ 33.300838] ? __tun_detach+0x1390/0x1390 [ 33.304950] rtnl_unlock+0xe/0x10 [ 33.308366] tun_chr_close+0x49/0x60 [ 33.312043] __fput+0x333/0x7f0 [ 33.315287] ? fput+0x140/0x140 [ 33.318533] ? check_same_owner+0x320/0x320 [ 33.322821] ____fput+0x15/0x20 [ 33.326063] task_work_run+0x199/0x270 [ 33.329917] ? task_work_cancel+0x210/0x210 [ 33.334204] ? free_nsproxy+0x185/0x1f0 [ 33.338143] ? switch_task_namespaces+0xa2/0xc0 [ 33.342778] do_exit+0x9d2/0x1af0 [ 33.346195] ? trace_hardirqs_on+0xd/0x10 [ 33.350310] ? mm_update_next_owner+0x930/0x930 [ 33.354944] ? mark_held_locks+0xb2/0x100 [ 33.359056] ? kfree+0xe4/0x250 [ 33.362302] ? kvfree+0x36/0x60 [ 33.365545] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 33.370524] ? trace_hardirqs_on+0xd/0x10 [ 33.374639] ? kvfree+0x3b/0x60 [ 33.377885] ? rtnl_unlock+0xe/0x10 [ 33.381474] ? __tun_chr_ioctl+0x27a/0x3d20 [ 33.385767] ? __pmd_alloc+0x4e0/0x4e0 [ 33.389622] ? __might_sleep+0x95/0x190 [ 33.393563] ? selinux_file_ioctl+0x444/0x690 [ 33.398024] ? __fget_light+0x29d/0x390 [ 33.401975] ? tun_chr_compat_ioctl+0x29/0x30 [ 33.406433] ? tun_chr_compat_ioctl+0x29/0x30 [ 33.410893] do_group_exit+0x149/0x400 [ 33.414743] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.419288] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 33.423661] ? SyS_exit+0x30/0x30