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-4,10.128.15.194' (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.648545] ================================================================== [ 31.656038] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.662768] Write of size 8 at addr ffff8801ce4e3780 by task syzkaller416637/2985 [ 31.670358] [ 31.671960] CPU: 1 PID: 2985 Comm: syzkaller416637 Not tainted 4.14.0-rc2+ #19 [ 31.679289] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.688613] Call Trace: [ 31.691172] dump_stack+0x194/0x257 [ 31.694775] ? arch_local_irq_restore+0x53/0x53 [ 31.699424] ? show_regs_print_info+0x65/0x65 [ 31.703898] ? lock_timer_base+0x1a3/0x2b0 [ 31.708110] ? detach_if_pending+0x557/0x610 [ 31.712497] print_address_description+0x73/0x250 [ 31.717314] ? detach_if_pending+0x557/0x610 [ 31.721700] kasan_report+0x25b/0x340 [ 31.725481] __asan_report_store8_noabort+0x17/0x20 [ 31.730471] detach_if_pending+0x557/0x610 [ 31.734684] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.739852] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.744509] ? lock_timer_base+0x1a3/0x2b0 [ 31.748732] ? lock_timer_base+0x1eb/0x2b0 [ 31.752955] ? __internal_add_timer+0x2d0/0x2d0 [ 31.757623] ? trace_hardirqs_on+0xd/0x10 [ 31.761790] try_to_del_timer_sync+0xa2/0x120 [ 31.766277] ? del_timer+0x130/0x130 [ 31.769978] ? del_timer_sync+0xeb/0x240 [ 31.774024] del_timer_sync+0x18a/0x240 [ 31.777979] tun_free_netdev+0x105/0x1b0 [ 31.782018] ? tun_xdp+0x410/0x410 [ 31.785532] ? cpumask_next+0x24/0x30 [ 31.789311] ? netdev_refcnt_read+0xed/0x150 [ 31.793696] ? tun_xdp+0x410/0x410 [ 31.797209] netdev_run_todo+0x870/0xca0 [ 31.801249] ? do_group_exit+0x149/0x400 [ 31.805288] ? register_netdev+0x30/0x30 [ 31.809327] ? lock_downgrade+0x990/0x990 [ 31.813449] ? trace_hardirqs_on+0xd/0x10 [ 31.817592] ? refcount_sub_and_test+0x115/0x1b0 [ 31.822321] ? refcount_inc+0x50/0x50 [ 31.826095] ? refcount_inc+0x50/0x50 [ 31.829877] ? sk_destruct+0x4c/0x80 [ 31.833581] ? __sk_free+0x5c/0x230 [ 31.837201] ? sk_free+0x2f/0x40 [ 31.840552] ? __tun_detach+0x176/0x1390 [ 31.844604] ? tun_attach+0xf90/0xf90 [ 31.848394] ? locks_remove_file+0x3fa/0x5a0 [ 31.852782] ? fcntl_setlk+0x10d0/0x10d0 [ 31.856826] ? __fsnotify_parent+0xb4/0x3a0 [ 31.861161] ? fsnotify+0x1af0/0x1af0 [ 31.864945] ? __tun_detach+0x1390/0x1390 [ 31.869099] ? __tun_detach+0x1390/0x1390 [ 31.873223] rtnl_unlock+0xe/0x10 [ 31.876648] tun_chr_close+0x49/0x60 [ 31.880340] __fput+0x333/0x7f0 [ 31.883600] ? fput+0x140/0x140 [ 31.886862] ? check_same_owner+0x320/0x320 [ 31.891184] ____fput+0x15/0x20 [ 31.894441] task_work_run+0x199/0x270 [ 31.898307] ? task_work_cancel+0x210/0x210 [ 31.902606] ? free_nsproxy+0x185/0x1f0 [ 31.906557] ? switch_task_namespaces+0xa2/0xc0 [ 31.911204] do_exit+0x9d2/0x1af0 [ 31.914632] ? trace_hardirqs_on+0xd/0x10 [ 31.918759] ? mm_update_next_owner+0x930/0x930 [ 31.923414] ? mark_held_locks+0xb2/0x100 [ 31.927542] ? kfree+0xe4/0x250 [ 31.930919] ? kvfree+0x36/0x60 [ 31.934184] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.939183] ? trace_hardirqs_on+0xd/0x10 [ 31.943310] ? kvfree+0x3b/0x60 [ 31.946571] ? rtnl_unlock+0xe/0x10 [ 31.950173] ? __tun_chr_ioctl+0x27a/0x3d20 [ 31.954484] ? __pmd_alloc+0x4e0/0x4e0 [ 31.958349] ? __might_sleep+0x95/0x190 [ 31.962831] ? selinux_file_ioctl+0x444/0x690 [ 31.967301] ? __fget_light+0x29d/0x390 [ 31.971273] ? tun_chr_compat_ioctl+0x29/0x30 [ 31.975741] ? tun_chr_compat_ioctl+0x29/0x30 [ 31.980212] do_group_exit+0x149/0x400 [ 31.984069] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.988621] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 31.993000] ? SyS_exit+0x30/0x30 [ 31.996431] ? do_ioctl+0x60/0x60 [ 31.999861] ? do_fast_syscall_32+0x158/0xf05 [ 32.004349] ? do_group_exit+0x400/0x400 [ 32.008383] SyS_exit_group+0x1d/0x20 [ 32.012155] do_fast_syscall_32+0x3f2/0xf05 [ 32.016456] ? do_int80_syscall_32+0x940/0x940 [ 32.021016] ? lockdep_sys_exit+0x47/0xf0 [ 32.025134] ? syscall_return_slowpath+0x2b3/0x510 [ 32.030036] ? finish_task_switch+0x1aa/0x740 [ 32.034508] ? sysret32_from_system_call+0x5/0x3b [ 32.039325] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.044153] entry_SYSENTER_compat+0x51/0x60 [ 32.048531] RIP: 0023:0xf7f6fc79 [ 32.051866] RSP: 002b:000000000820fe3c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 32.059563] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 000000000820ff6c [ 32.066804] RDX: 0000000008048ea1 RSI: 0000000000000036 RDI: 0000000000000004 [ 32.074053] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 32.081295] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.088533] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.095809] [ 32.097420] Allocated by task 2985: [ 32.101029] save_stack_trace+0x16/0x20 [ 32.104981] save_stack+0x43/0xd0 [ 32.108404] kasan_kmalloc+0xad/0xe0 [ 32.112092] __kmalloc_node+0x47/0x70 [ 32.115866] kvmalloc_node+0x64/0xd0 [ 32.119550] alloc_netdev_mqs+0x16e/0xed0 [ 32.123668] __tun_chr_ioctl+0x12be/0x3d20 [ 32.127872] tun_chr_compat_ioctl+0x29/0x30 [ 32.132251] compat_SyS_ioctl+0x1d7/0x3290 [ 32.136455] do_fast_syscall_32+0x3f2/0xf05 [ 32.140747] entry_SYSENTER_compat+0x51/0x60 [ 32.145123] [ 32.146721] Freed by task 2985: [ 32.149972] save_stack_trace+0x16/0x20 [ 32.153934] save_stack+0x43/0xd0 [ 32.157365] kasan_slab_free+0x71/0xc0 [ 32.161221] kfree+0xca/0x250 [ 32.164295] kvfree+0x36/0x60 [ 32.167371] free_netdev+0x2cf/0x360 [ 32.171062] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.175265] tun_chr_compat_ioctl+0x29/0x30 [ 32.179559] compat_SyS_ioctl+0x1d7/0x3290 [ 32.183773] do_fast_syscall_32+0x3f2/0xf05 [ 32.188067] entry_SYSENTER_compat+0x51/0x60 [ 32.192450] [ 32.194051] The buggy address belongs to the object at ffff8801ce4e0380 [ 32.194051] which belongs to the cache kmalloc-16384 of size 16384 [ 32.207025] The buggy address is located 13312 bytes inside of [ 32.207025] 16384-byte region [ffff8801ce4e0380, ffff8801ce4e4380) [ 32.219217] The buggy address belongs to the page: [ 32.224127] page:ffffea0007393800 count:1 mapcount:0 mapping:ffff8801ce4e0380 index:0x0 compound_mapcount: 0 [ 32.234073] flags: 0x200000000008100(slab|head) [ 32.238717] raw: 0200000000008100 ffff8801ce4e0380 0000000000000000 0000000100000001 [ 32.246568] raw: ffffea0007371220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.254417] page dumped because: kasan: bad access detected [ 32.260095] [ 32.261695] Memory state around the buggy address: [ 32.266597] ffff8801ce4e3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.273931] ffff8801ce4e3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.281267] >ffff8801ce4e3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.288595] ^ [ 32.291933] ffff8801ce4e3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.299263] ffff8801ce4e3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.306597] ================================================================== [ 32.313925] Disabling lock debugging due to kernel taint [ 32.319348] Kernel panic - not syncing: panic_on_warn set ... [ 32.319348] [ 32.326675] CPU: 1 PID: 2985 Comm: syzkaller416637 Tainted: G B 4.14.0-rc2+ #19 [ 32.335213] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.344532] Call Trace: [ 32.347092] dump_stack+0x194/0x257 [ 32.350685] ? arch_local_irq_restore+0x53/0x53 [ 32.355327] ? vprintk_default+0x28/0x30 [ 32.359355] ? detach_if_pending+0x4d0/0x610 [ 32.363735] panic+0x1e4/0x417 [ 32.366896] ? __warn+0x1d9/0x1d9 [ 32.370320] ? detach_if_pending+0x557/0x610 [ 32.374694] kasan_end_report+0x50/0x50 [ 32.378634] kasan_report+0x144/0x340 [ 32.382404] __asan_report_store8_noabort+0x17/0x20 [ 32.387385] detach_if_pending+0x557/0x610 [ 32.391590] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.396759] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.401391] ? lock_timer_base+0x1a3/0x2b0 [ 32.405590] ? lock_timer_base+0x1eb/0x2b0 [ 32.409790] ? __internal_add_timer+0x2d0/0x2d0 [ 32.414424] ? trace_hardirqs_on+0xd/0x10 [ 32.418539] try_to_del_timer_sync+0xa2/0x120 [ 32.423006] ? del_timer+0x130/0x130 [ 32.426684] ? del_timer_sync+0xeb/0x240 [ 32.430713] del_timer_sync+0x18a/0x240 [ 32.434654] tun_free_netdev+0x105/0x1b0 [ 32.438679] ? tun_xdp+0x410/0x410 [ 32.442184] ? cpumask_next+0x24/0x30 [ 32.445953] ? netdev_refcnt_read+0xed/0x150 [ 32.450330] ? tun_xdp+0x410/0x410 [ 32.453837] netdev_run_todo+0x870/0xca0 [ 32.457863] ? do_group_exit+0x149/0x400 [ 32.461901] ? register_netdev+0x30/0x30 [ 32.465933] ? lock_downgrade+0x990/0x990 [ 32.470044] ? trace_hardirqs_on+0xd/0x10 [ 32.474170] ? refcount_sub_and_test+0x115/0x1b0 [ 32.478891] ? refcount_inc+0x50/0x50 [ 32.482657] ? refcount_inc+0x50/0x50 [ 32.486423] ? sk_destruct+0x4c/0x80 [ 32.490100] ? __sk_free+0x5c/0x230 [ 32.493689] ? sk_free+0x2f/0x40 [ 32.497021] ? __tun_detach+0x176/0x1390 [ 32.501051] ? tun_attach+0xf90/0xf90 [ 32.504822] ? locks_remove_file+0x3fa/0x5a0 [ 32.509195] ? fcntl_setlk+0x10d0/0x10d0 [ 32.513224] ? __fsnotify_parent+0xb4/0x3a0 [ 32.517511] ? fsnotify+0x1af0/0x1af0 [ 32.521280] ? __tun_detach+0x1390/0x1390 [ 32.525395] ? __tun_detach+0x1390/0x1390 [ 32.529511] rtnl_unlock+0xe/0x10 [ 32.532929] tun_chr_close+0x49/0x60 [ 32.536608] __fput+0x333/0x7f0 [ 32.539859] ? fput+0x140/0x140 [ 32.543104] ? check_same_owner+0x320/0x320 [ 32.547395] ____fput+0x15/0x20 [ 32.550641] task_work_run+0x199/0x270 [ 32.554495] ? task_work_cancel+0x210/0x210 [ 32.558787] ? free_nsproxy+0x185/0x1f0 [ 32.562727] ? switch_task_namespaces+0xa2/0xc0 [ 32.567364] do_exit+0x9d2/0x1af0 [ 32.570790] ? trace_hardirqs_on+0xd/0x10 [ 32.574906] ? mm_update_next_owner+0x930/0x930 [ 32.579539] ? mark_held_locks+0xb2/0x100 [ 32.583655] ? kfree+0xe4/0x250 [ 32.586899] ? kvfree+0x36/0x60 [ 32.590142] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.595124] ? trace_hardirqs_on+0xd/0x10 [ 32.599238] ? kvfree+0x3b/0x60 [ 32.602489] ? rtnl_unlock+0xe/0x10 [ 32.606087] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.610388] ? __pmd_alloc+0x4e0/0x4e0 [ 32.614259] ? __might_sleep+0x95/0x190 [ 32.618204] ? selinux_file_ioctl+0x444/0x690 [ 32.622675] ? __fget_light+0x29d/0x390 [ 32.627201] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.631662] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.636126] do_group_exit+0x149/0x400 [ 32.639980] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.644532] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.648910] ? SyS_exit+0x30/0x30