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.15.202' (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: [ 35.702276] ================================================================== [ 35.703406] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.704299] Write of size 8 at addr ffff8801cdd13740 by task syzkaller399128/2987 [ 35.705311] [ 35.705549] CPU: 1 PID: 2987 Comm: syzkaller399128 Not tainted 4.14.0-rc2+ #19 [ 35.706516] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.707750] Call Trace: [ 35.708111] dump_stack+0x194/0x257 [ 35.708641] ? arch_local_irq_restore+0x53/0x53 [ 35.709282] ? show_regs_print_info+0x65/0x65 [ 35.709929] ? lock_timer_base+0x1a3/0x2b0 [ 35.710532] ? detach_if_pending+0x557/0x610 [ 35.711162] print_address_description+0x73/0x250 [ 35.711829] ? detach_if_pending+0x557/0x610 [ 35.712425] kasan_report+0x25b/0x340 [ 35.712961] __asan_report_store8_noabort+0x17/0x20 [ 35.713630] detach_if_pending+0x557/0x610 [ 35.714204] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.714898] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.715522] ? lock_timer_base+0x1a3/0x2b0 [ 35.716094] ? lock_timer_base+0x1eb/0x2b0 [ 35.716680] ? __internal_add_timer+0x2d0/0x2d0 [ 35.717308] ? trace_hardirqs_on+0xd/0x10 [ 35.717875] try_to_del_timer_sync+0xa2/0x120 [ 35.718491] ? del_timer+0x130/0x130 [ 35.719010] ? del_timer_sync+0xeb/0x240 [ 35.719567] del_timer_sync+0x18a/0x240 [ 35.720110] tun_free_netdev+0x105/0x1b0 [ 35.720659] ? tun_xdp+0x410/0x410 [ 35.721139] ? cpumask_next+0x24/0x30 [ 35.721656] ? netdev_refcnt_read+0xed/0x150 [ 35.722254] ? tun_xdp+0x410/0x410 [ 35.723225] netdev_run_todo+0x870/0xca0 [ 35.727256] ? do_group_exit+0x149/0x400 [ 35.731296] ? register_netdev+0x30/0x30 [ 35.735332] ? lock_downgrade+0x990/0x990 [ 35.739459] ? trace_hardirqs_on+0xd/0x10 [ 35.743602] ? refcount_sub_and_test+0x115/0x1b0 [ 35.748335] ? refcount_inc+0x50/0x50 [ 35.752109] ? refcount_inc+0x50/0x50 [ 35.755889] ? sk_destruct+0x4c/0x80 [ 35.759576] ? __sk_free+0x5c/0x230 [ 35.763178] ? sk_free+0x2f/0x40 [ 35.766515] ? __tun_detach+0x176/0x1390 [ 35.770558] ? tun_attach+0xf90/0xf90 [ 35.774339] ? locks_remove_file+0x3fa/0x5a0 [ 35.778721] ? fcntl_setlk+0x10d0/0x10d0 [ 35.782759] ? __fsnotify_parent+0xb4/0x3a0 [ 35.787063] ? fsnotify+0x1af0/0x1af0 [ 35.790845] ? __tun_detach+0x1390/0x1390 [ 35.794966] ? __tun_detach+0x1390/0x1390 [ 35.799089] rtnl_unlock+0xe/0x10 [ 35.802514] tun_chr_close+0x49/0x60 [ 35.806197] __fput+0x333/0x7f0 [ 35.809456] ? fput+0x140/0x140 [ 35.812709] ? check_same_owner+0x320/0x320 [ 35.817007] ____fput+0x15/0x20 [ 35.820260] task_work_run+0x199/0x270 [ 35.824121] ? task_work_cancel+0x210/0x210 [ 35.828414] ? free_nsproxy+0x185/0x1f0 [ 35.832361] ? switch_task_namespaces+0xa2/0xc0 [ 35.837008] do_exit+0x9d2/0x1af0 [ 35.840434] ? trace_hardirqs_on+0xd/0x10 [ 35.844563] ? mm_update_next_owner+0x930/0x930 [ 35.849203] ? mark_held_locks+0xb2/0x100 [ 35.853325] ? kfree+0xe4/0x250 [ 35.856576] ? kvfree+0x36/0x60 [ 35.859828] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.864814] ? trace_hardirqs_on+0xd/0x10 [ 35.868937] ? kvfree+0x3b/0x60 [ 35.872195] ? rtnl_unlock+0xe/0x10 [ 35.875795] ? __tun_chr_ioctl+0x27a/0x3d20 [ 35.880103] ? __pmd_alloc+0x4e0/0x4e0 [ 35.883967] ? __might_sleep+0x95/0x190 [ 35.887922] ? selinux_file_ioctl+0x444/0x690 [ 35.892390] ? __fget_light+0x29d/0x390 [ 35.896364] ? tun_chr_compat_ioctl+0x29/0x30 [ 35.900838] ? tun_chr_compat_ioctl+0x29/0x30 [ 35.905307] do_group_exit+0x149/0x400 [ 35.909164] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.913717] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 35.918096] ? SyS_exit+0x30/0x30 [ 35.921520] ? do_ioctl+0x60/0x60 [ 35.924947] ? do_fast_syscall_32+0x158/0xf05 [ 35.929416] ? do_group_exit+0x400/0x400 [ 35.933452] SyS_exit_group+0x1d/0x20 [ 35.937223] do_fast_syscall_32+0x3f2/0xf05 [ 35.941522] ? do_int80_syscall_32+0x940/0x940 [ 35.946075] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.950803] ? lockdep_sys_exit+0x47/0xf0 [ 35.954920] ? syscall_return_slowpath+0x2b3/0x510 [ 35.959828] ? sysret32_from_system_call+0x5/0x3b [ 35.964647] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 35.969467] entry_SYSENTER_compat+0x51/0x60 [ 35.973846] RIP: 0023:0xf7fafc79 [ 35.977178] RSP: 002b:00000000ffeac09c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 35.984875] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffeac288 [ 35.992284] RDX: 0000000008048d5f RSI: 0000000000000036 RDI: 0000000000000004 [ 35.999528] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 36.006776] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 36.014015] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 36.021300] [ 36.022901] Allocated by task 2987: [ 36.026501] save_stack_trace+0x16/0x20 [ 36.030445] save_stack+0x43/0xd0 [ 36.033869] kasan_kmalloc+0xad/0xe0 [ 36.037551] __kmalloc_node+0x47/0x70 [ 36.041321] kvmalloc_node+0x64/0xd0 [ 36.045007] alloc_netdev_mqs+0x16e/0xed0 [ 36.049122] __tun_chr_ioctl+0x12be/0x3d20 [ 36.053327] tun_chr_compat_ioctl+0x29/0x30 [ 36.057620] compat_SyS_ioctl+0x1d7/0x3290 [ 36.061825] do_fast_syscall_32+0x3f2/0xf05 [ 36.066118] entry_SYSENTER_compat+0x51/0x60 [ 36.070491] [ 36.072088] Freed by task 2987: [ 36.075336] save_stack_trace+0x16/0x20 [ 36.079279] save_stack+0x43/0xd0 [ 36.082699] kasan_slab_free+0x71/0xc0 [ 36.086553] kfree+0xca/0x250 [ 36.089626] kvfree+0x36/0x60 [ 36.092699] free_netdev+0x2cf/0x360 [ 36.096381] __tun_chr_ioctl+0x2cf6/0x3d20 [ 36.100584] tun_chr_compat_ioctl+0x29/0x30 [ 36.104873] compat_SyS_ioctl+0x1d7/0x3290 [ 36.109075] do_fast_syscall_32+0x3f2/0xf05 [ 36.113365] entry_SYSENTER_compat+0x51/0x60 [ 36.117742] [ 36.119343] The buggy address belongs to the object at ffff8801cdd10340 [ 36.119343] which belongs to the cache kmalloc-16384 of size 16384 [ 36.132322] The buggy address is located 13312 bytes inside of [ 36.132322] 16384-byte region [ffff8801cdd10340, ffff8801cdd14340) [ 36.144523] The buggy address belongs to the page: [ 36.149440] page:ffffea0007374400 count:1 mapcount:0 mapping:ffff8801cdd10340 index:0x0 compound_mapcount: 0 [ 36.159403] flags: 0x200000000008100(slab|head) [ 36.164051] raw: 0200000000008100 ffff8801cdd10340 0000000000000000 0000000100000001 [ 36.171925] raw: ffffea0007337c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 36.179776] page dumped because: kasan: bad access detected [ 36.185457] [ 36.187054] Memory state around the buggy address: [ 36.191954] ffff8801cdd13600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.199286] ffff8801cdd13680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.206615] >ffff8801cdd13700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.213950] ^ [ 36.219380] ffff8801cdd13780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.226718] ffff8801cdd13800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.234043] ================================================================== [ 36.241378] Disabling lock debugging due to kernel taint [ 36.246790] Kernel panic - not syncing: panic_on_warn set ... [ 36.246790] [ 36.254116] CPU: 1 PID: 2987 Comm: syzkaller399128 Tainted: G B 4.14.0-rc2+ #19 [ 36.262653] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.271971] Call Trace: [ 36.274525] dump_stack+0x194/0x257 [ 36.278120] ? arch_local_irq_restore+0x53/0x53 [ 36.282755] ? vprintk_default+0x28/0x30 [ 36.286785] ? detach_if_pending+0x4d0/0x610 [ 36.291159] panic+0x1e4/0x417 [ 36.294317] ? __warn+0x1d9/0x1d9 [ 36.297741] ? detach_if_pending+0x557/0x610 [ 36.302115] kasan_end_report+0x50/0x50 [ 36.306057] kasan_report+0x144/0x340 [ 36.309824] __asan_report_store8_noabort+0x17/0x20 [ 36.314804] detach_if_pending+0x557/0x610 [ 36.319005] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.324159] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.328790] ? lock_timer_base+0x1a3/0x2b0 [ 36.332989] ? lock_timer_base+0x1eb/0x2b0 [ 36.337202] ? __internal_add_timer+0x2d0/0x2d0 [ 36.341837] ? trace_hardirqs_on+0xd/0x10 [ 36.345953] try_to_del_timer_sync+0xa2/0x120 [ 36.350413] ? del_timer+0x130/0x130 [ 36.354094] ? del_timer_sync+0xeb/0x240 [ 36.358123] del_timer_sync+0x18a/0x240 [ 36.362063] tun_free_netdev+0x105/0x1b0 [ 36.366089] ? tun_xdp+0x410/0x410 [ 36.369593] ? cpumask_next+0x24/0x30 [ 36.373362] ? netdev_refcnt_read+0xed/0x150 [ 36.377742] ? tun_xdp+0x410/0x410 [ 36.381256] netdev_run_todo+0x870/0xca0 [ 36.385286] ? do_group_exit+0x149/0x400 [ 36.389317] ? register_netdev+0x30/0x30 [ 36.393348] ? lock_downgrade+0x990/0x990 [ 36.397468] ? trace_hardirqs_on+0xd/0x10 [ 36.401591] ? refcount_sub_and_test+0x115/0x1b0 [ 36.406312] ? refcount_inc+0x50/0x50 [ 36.410076] ? refcount_inc+0x50/0x50 [ 36.413845] ? sk_destruct+0x4c/0x80 [ 36.417522] ? __sk_free+0x5c/0x230 [ 36.421115] ? sk_free+0x2f/0x40 [ 36.424453] ? __tun_detach+0x176/0x1390 [ 36.428496] ? tun_attach+0xf90/0xf90 [ 36.432268] ? locks_remove_file+0x3fa/0x5a0 [ 36.436640] ? fcntl_setlk+0x10d0/0x10d0 [ 36.440668] ? __fsnotify_parent+0xb4/0x3a0 [ 36.444955] ? fsnotify+0x1af0/0x1af0 [ 36.448720] ? __tun_detach+0x1390/0x1390 [ 36.452833] ? __tun_detach+0x1390/0x1390 [ 36.456951] rtnl_unlock+0xe/0x10 [ 36.460388] tun_chr_close+0x49/0x60 [ 36.464070] __fput+0x333/0x7f0 [ 36.467318] ? fput+0x140/0x140 [ 36.470563] ? check_same_owner+0x320/0x320 [ 36.474851] ____fput+0x15/0x20 [ 36.478098] task_work_run+0x199/0x270 [ 36.481962] ? task_work_cancel+0x210/0x210 [ 36.486249] ? free_nsproxy+0x185/0x1f0 [ 36.490187] ? switch_task_namespaces+0xa2/0xc0 [ 36.494821] do_exit+0x9d2/0x1af0 [ 36.498239] ? trace_hardirqs_on+0xd/0x10 [ 36.502354] ? mm_update_next_owner+0x930/0x930 [ 36.506985] ? mark_held_locks+0xb2/0x100 [ 36.511100] ? kfree+0xe4/0x250 [ 36.514345] ? kvfree+0x36/0x60 [ 36.517589] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 36.522569] ? trace_hardirqs_on+0xd/0x10 [ 36.526684] ? kvfree+0x3b/0x60 [ 36.529931] ? rtnl_unlock+0xe/0x10 [ 36.533523] ? __tun_chr_ioctl+0x27a/0x3d20 [ 36.537815] ? __pmd_alloc+0x4e0/0x4e0 [ 36.541668] ? __might_sleep+0x95/0x190 [ 36.545613] ? selinux_file_ioctl+0x444/0x690 [ 36.550072] ? __fget_light+0x29d/0x390 [ 36.554026] ? tun_chr_compat_ioctl+0x29/0x30 [ 36.558484] ? tun_chr_compat_ioctl+0x29/0x30 [ 36.562947] do_group_exit+0x149/0x400 [ 36.566798] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.571344] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 36.575715] ? SyS_exit+0x30/0x30 [ 36.579133] ? do_ioctl+0x60/0x60 [ 36.582551] ? do_fast_syscall_32+0x158/0xf05 [ 36.587009] ? do_group_exit+0x400/0x400 [ 36.591033] SyS_exit_group+0x1d/0x20 [ 36.594798] do_fast_syscall_32+0x3f2/0xf05 [ 36.599087] ? do_int80_syscall_32+0x940/0x940 [ 36.603633] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 36.608357] ? lockdep_sys_exit+0x47/0xf0 [ 36.612467] ? syscall_return_slowpath+0x2b3/0x510 [ 36.617363] ? sysret32_from_system_call+0x5/0x3b [ 36.622173] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 36.626983] entry_SYSENTER_compat+0x51/0x60 [ 36.631354] RIP: 0023:0xf7fafc79 [ 36.634684] RSP: 002b:00000000ffeac09c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 36.642357] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffeac288 [ 36.649593] RDX: 0000000008048d5f RSI: 0000000000000036 RDI: 0000000000000004 [ 36.656826] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 36.664060] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 36.671297] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000