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-9,10.128.0.61' (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: [ 66.579519] ================================================================== [ 66.586941] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 66.593666] Write of size 8 at addr ffff8801ce78b780 by task syzkaller695353/2984 [ 66.601255] [ 66.602858] CPU: 1 PID: 2984 Comm: syzkaller695353 Not tainted 4.14.0-rc4+ #125 [ 66.610276] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 66.619600] Call Trace: [ 66.622161] dump_stack+0x194/0x257 [ 66.625762] ? arch_local_irq_restore+0x53/0x53 [ 66.630403] ? show_regs_print_info+0x65/0x65 [ 66.634873] ? lock_timer_base+0x1a3/0x2b0 [ 66.639079] ? detach_if_pending+0x557/0x610 [ 66.643459] print_address_description+0x73/0x250 [ 66.648271] ? detach_if_pending+0x557/0x610 [ 66.652650] kasan_report+0x25b/0x340 [ 66.656427] __asan_report_store8_noabort+0x17/0x20 [ 66.661420] detach_if_pending+0x557/0x610 [ 66.665629] ? trace_raw_output_tick_stop+0x130/0x130 [ 66.670792] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 66.675428] ? lock_timer_base+0x1a3/0x2b0 [ 66.679633] ? lock_timer_base+0x1eb/0x2b0 [ 66.683841] ? __internal_add_timer+0x2d0/0x2d0 [ 66.688483] ? trace_hardirqs_on+0xd/0x10 [ 66.692609] try_to_del_timer_sync+0xa2/0x120 [ 66.697075] ? del_timer+0x130/0x130 [ 66.700768] ? del_timer_sync+0xeb/0x240 [ 66.704806] del_timer_sync+0x18a/0x240 [ 66.708754] tun_free_netdev+0x105/0x1b0 [ 66.712785] ? tun_xdp+0x410/0x410 [ 66.716292] ? cpumask_next+0x24/0x30 [ 66.720067] ? netdev_refcnt_read+0xed/0x150 [ 66.724448] ? tun_xdp+0x410/0x410 [ 66.727958] netdev_run_todo+0x870/0xca0 [ 66.731989] ? do_group_exit+0x149/0x400 [ 66.736024] ? register_netdev+0x30/0x30 [ 66.740077] ? lock_downgrade+0x990/0x990 [ 66.744199] ? trace_hardirqs_on+0xd/0x10 [ 66.748336] ? refcount_sub_and_test+0x115/0x1b0 [ 66.753062] ? refcount_inc+0x50/0x50 [ 66.756830] ? refcount_inc+0x50/0x50 [ 66.760605] ? sk_destruct+0x4c/0x80 [ 66.764290] ? __sk_free+0x5c/0x230 [ 66.767888] ? sk_free+0x2f/0x40 [ 66.771918] ? __tun_detach+0x176/0x1390 [ 66.775961] ? tun_attach+0xf90/0xf90 [ 66.779740] ? locks_remove_file+0x3fa/0x5a0 [ 66.784121] ? fcntl_setlk+0x10d0/0x10d0 [ 66.788155] ? __fsnotify_parent+0xb4/0x3a0 [ 66.792450] ? fsnotify+0x1af0/0x1af0 [ 66.796230] ? __tun_detach+0x1390/0x1390 [ 66.800353] rtnl_unlock+0xe/0x10 [ 66.803774] tun_chr_close+0x49/0x60 [ 66.807460] __fput+0x333/0x7f0 [ 66.810717] ? fput+0x140/0x140 [ 66.813967] ? check_same_owner+0x320/0x320 [ 66.818267] ____fput+0x15/0x20 [ 66.821517] task_work_run+0x199/0x270 [ 66.825376] ? task_work_cancel+0x210/0x210 [ 66.829666] ? free_nsproxy+0x185/0x1f0 [ 66.833610] ? switch_task_namespaces+0xa2/0xc0 [ 66.838253] do_exit+0x9d2/0x1af0 [ 66.841677] ? kvfree+0x3b/0x60 [ 66.844934] ? mm_update_next_owner+0x930/0x930 [ 66.849576] ? rtnl_unlock+0xe/0x10 [ 66.853173] ? __tun_chr_ioctl+0x27a/0x3d20 [ 66.857479] ? tun_chr_read_iter+0x1e0/0x1e0 [ 66.862041] ? lock_downgrade+0x990/0x990 [ 66.866189] ? handle_mm_fault+0x410/0x8d0 [ 66.870393] ? __do_page_fault+0x31e/0xd60 [ 66.874613] ? check_same_owner+0x320/0x320 [ 66.878912] ? up_read+0x1a/0x40 [ 66.883324] ? __do_page_fault+0x3d6/0xd60 [ 66.887544] ? tun_chr_compat_ioctl+0x30/0x30 [ 66.892008] ? tun_chr_ioctl+0x2a/0x40 [ 66.895873] ? tun_chr_ioctl+0x2a/0x40 [ 66.899734] ? do_vfs_ioctl+0x492/0x1530 [ 66.903771] ? ioctl_preallocate+0x2b0/0x2b0 [ 66.908155] ? selinux_capable+0x40/0x40 [ 66.912190] ? putname+0xf3/0x130 [ 66.915623] do_group_exit+0x149/0x400 [ 66.919484] ? SyS_exit+0x30/0x30 [ 66.922908] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 66.927897] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 66.932630] SyS_exit_group+0x1d/0x20 [ 66.936406] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 66.941130] RIP: 0033:0x445649 [ 66.944289] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 66.951971] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445649 [ 66.959215] RDX: 0000000000445649 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 66.966456] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 66.973696] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402ca0 [ 66.980935] R13: 0000000000402d30 R14: 0000000000000000 R15: 0000000000000000 [ 66.988194] [ 66.989807] Allocated by task 2984: [ 66.993415] save_stack_trace+0x16/0x20 [ 66.997362] save_stack+0x43/0xd0 [ 67.000783] kasan_kmalloc+0xad/0xe0 [ 67.004468] __kmalloc_node+0x47/0x70 [ 67.008238] kvmalloc_node+0x64/0xd0 [ 67.011920] alloc_netdev_mqs+0x16e/0xed0 [ 67.016037] __tun_chr_ioctl+0x12be/0x3d20 [ 67.020332] tun_chr_ioctl+0x2a/0x40 [ 67.024019] do_vfs_ioctl+0x1b1/0x1530 [ 67.027876] SyS_ioctl+0x8f/0xc0 [ 67.031212] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 67.035936] [ 67.037532] Freed by task 2984: [ 67.040781] save_stack_trace+0x16/0x20 [ 67.044726] save_stack+0x43/0xd0 [ 67.048147] kasan_slab_free+0x71/0xc0 [ 67.052003] kfree+0xca/0x250 [ 67.055080] kvfree+0x36/0x60 [ 67.058157] free_netdev+0x2cf/0x360 [ 67.061839] __tun_chr_ioctl+0x2cf6/0x3d20 [ 67.066041] tun_chr_ioctl+0x2a/0x40 [ 67.069725] do_vfs_ioctl+0x1b1/0x1530 [ 67.073581] SyS_ioctl+0x8f/0xc0 [ 67.076916] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 67.081637] [ 67.083235] The buggy address belongs to the object at ffff8801ce788380 [ 67.083235] which belongs to the cache kmalloc-16384 of size 16384 [ 67.096207] The buggy address is located 13312 bytes inside of [ 67.096207] 16384-byte region [ffff8801ce788380, ffff8801ce78c380) [ 67.108396] The buggy address belongs to the page: [ 67.113292] page:ffffea000739e200 count:1 mapcount:0 mapping:ffff8801ce788380 index:0x0 compound_mapcount: 0 [ 67.123233] flags: 0x200000000008100(slab|head) [ 67.127870] raw: 0200000000008100 ffff8801ce788380 0000000000000000 0000000100000001 [ 67.135718] raw: ffffea0007368420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 67.143564] page dumped because: kasan: bad access detected [ 67.149241] [ 67.150838] Memory state around the buggy address: [ 67.155735] ffff8801ce78b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 67.163064] ffff8801ce78b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 67.170393] >ffff8801ce78b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 67.177717] ^ [ 67.181059] ffff8801ce78b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 67.188385] ffff8801ce78b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 67.195714] ================================================================== [ 67.203038] Disabling lock debugging due to kernel taint [ 67.208452] Kernel panic - not syncing: panic_on_warn set ... [ 67.208452] [ 67.215776] CPU: 1 PID: 2984 Comm: syzkaller695353 Tainted: G B 4.14.0-rc4+ #125 [ 67.224399] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 67.233717] Call Trace: [ 67.236272] dump_stack+0x194/0x257 [ 67.239864] ? arch_local_irq_restore+0x53/0x53 [ 67.244495] ? vprintk_default+0x28/0x30 [ 67.248522] ? detach_if_pending+0x540/0x610 [ 67.252894] panic+0x1e4/0x417 [ 67.256052] ? __warn+0x1d9/0x1d9 [ 67.259475] ? detach_if_pending+0x557/0x610 [ 67.263847] kasan_end_report+0x50/0x50 [ 67.267785] kasan_report+0x144/0x340 [ 67.271550] __asan_report_store8_noabort+0x17/0x20 [ 67.276529] detach_if_pending+0x557/0x610 [ 67.280728] ? trace_raw_output_tick_stop+0x130/0x130 [ 67.285883] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 67.290514] ? lock_timer_base+0x1a3/0x2b0 [ 67.294710] ? lock_timer_base+0x1eb/0x2b0 [ 67.298909] ? __internal_add_timer+0x2d0/0x2d0 [ 67.303543] ? trace_hardirqs_on+0xd/0x10 [ 67.307657] try_to_del_timer_sync+0xa2/0x120 [ 67.312117] ? del_timer+0x130/0x130 [ 67.315795] ? del_timer_sync+0xeb/0x240 [ 67.319823] del_timer_sync+0x18a/0x240 [ 67.323763] tun_free_netdev+0x105/0x1b0 [ 67.327787] ? tun_xdp+0x410/0x410 [ 67.331289] ? cpumask_next+0x24/0x30 [ 67.335057] ? netdev_refcnt_read+0xed/0x150 [ 67.339428] ? tun_xdp+0x410/0x410 [ 67.342931] netdev_run_todo+0x870/0xca0 [ 67.346955] ? do_group_exit+0x149/0x400 [ 67.350982] ? register_netdev+0x30/0x30 [ 67.355006] ? lock_downgrade+0x990/0x990 [ 67.359129] ? trace_hardirqs_on+0xd/0x10 [ 67.363249] ? refcount_sub_and_test+0x115/0x1b0 [ 67.367970] ? refcount_inc+0x50/0x50 [ 67.371733] ? refcount_inc+0x50/0x50 [ 67.375500] ? sk_destruct+0x4c/0x80 [ 67.379176] ? __sk_free+0x5c/0x230 [ 67.382764] ? sk_free+0x2f/0x40 [ 67.386093] ? __tun_detach+0x176/0x1390 [ 67.390126] ? tun_attach+0xf90/0xf90 [ 67.393895] ? locks_remove_file+0x3fa/0x5a0 [ 67.398268] ? fcntl_setlk+0x10d0/0x10d0 [ 67.402294] ? __fsnotify_parent+0xb4/0x3a0 [ 67.406579] ? fsnotify+0x1af0/0x1af0 [ 67.410345] ? __tun_detach+0x1390/0x1390 [ 67.414457] rtnl_unlock+0xe/0x10 [ 67.417874] tun_chr_close+0x49/0x60 [ 67.421601] __fput+0x333/0x7f0 [ 67.424846] ? fput+0x140/0x140 [ 67.428091] ? check_same_owner+0x320/0x320 [ 67.432380] ____fput+0x15/0x20 [ 67.435626] task_work_run+0x199/0x270 [ 67.439479] ? task_work_cancel+0x210/0x210 [ 67.443766] ? free_nsproxy+0x185/0x1f0 [ 67.447703] ? switch_task_namespaces+0xa2/0xc0 [ 67.452336] do_exit+0x9d2/0x1af0 [ 67.455754] ? kvfree+0x3b/0x60 [ 67.458998] ? mm_update_next_owner+0x930/0x930 [ 67.463630] ? rtnl_unlock+0xe/0x10 [ 67.467218] ? __tun_chr_ioctl+0x27a/0x3d20 [ 67.471507] ? tun_chr_read_iter+0x1e0/0x1e0 [ 67.475880] ? lock_downgrade+0x990/0x990 [ 67.480002] ? handle_mm_fault+0x410/0x8d0 [ 67.484211] ? __do_page_fault+0x31e/0xd60 [ 67.488415] ? check_same_owner+0x320/0x320 [ 67.492700] ? up_read+0x1a/0x40 [ 67.496035] ? __do_page_fault+0x3d6/0xd60 [ 67.500234] ? tun_chr_compat_ioctl+0x30/0x30 [ 67.504692] ? tun_chr_ioctl+0x2a/0x40 [ 67.508540] ? tun_chr_ioctl+0x2a/0x40 [ 67.512391] ? do_vfs_ioctl+0x492/0x1530 [ 67.516419] ? ioctl_preallocate+0x2b0/0x2b0 [ 67.520794] ? selinux_capable+0x40/0x40 [ 67.524821] ? putname+0xf3/0x130 [ 67.528241] do_group_exit+0x149/0x400 [ 67.532093] ? SyS_exit+0x30/0x30 [ 67.535509] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 67.540489] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 67.545211] SyS_exit_group+0x1d/0x20 [ 67.548975] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 67.553692] RIP: 0033:0x445649 [ 67.556845] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 67.564774] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445649 [ 67.572007] RDX: 0000000000445649 RSI: 0000000020927fd8 RDI: 0000000000000001