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-0,10.128.0.6' (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: [ 34.444304] ================================================================== [ 34.451728] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 34.458455] Write of size 8 at addr ffff8801cff13780 by task syzkaller995923/2986 [ 34.466045] [ 34.467647] CPU: 0 PID: 2986 Comm: syzkaller995923 Not tainted 4.14.0-rc3+ #23 [ 34.474976] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.484301] Call Trace: [ 34.486863] dump_stack+0x194/0x257 [ 34.490464] ? arch_local_irq_restore+0x53/0x53 [ 34.495103] ? show_regs_print_info+0x65/0x65 [ 34.499571] ? lock_timer_base+0x1a3/0x2b0 [ 34.503777] ? detach_if_pending+0x557/0x610 [ 34.508157] print_address_description+0x73/0x250 [ 34.512970] ? detach_if_pending+0x557/0x610 [ 34.517349] kasan_report+0x25b/0x340 [ 34.521122] __asan_report_store8_noabort+0x17/0x20 [ 34.526107] detach_if_pending+0x557/0x610 [ 34.530317] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.535480] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.540115] ? lock_timer_base+0x1a3/0x2b0 [ 34.544321] ? lock_timer_base+0x1eb/0x2b0 [ 34.548529] ? __internal_add_timer+0x2d0/0x2d0 [ 34.553170] ? trace_hardirqs_on+0xd/0x10 [ 34.557297] try_to_del_timer_sync+0xa2/0x120 [ 34.561762] ? del_timer+0x130/0x130 [ 34.565448] ? del_timer_sync+0xeb/0x240 [ 34.569487] del_timer_sync+0x18a/0x240 [ 34.573437] tun_free_netdev+0x105/0x1b0 [ 34.577468] ? tun_xdp+0x410/0x410 [ 34.580975] ? cpumask_next+0x24/0x30 [ 34.584747] ? netdev_refcnt_read+0xed/0x150 [ 34.589129] ? tun_xdp+0x410/0x410 [ 34.592649] netdev_run_todo+0x870/0xca0 [ 34.596682] ? do_group_exit+0x149/0x400 [ 34.600717] ? register_netdev+0x30/0x30 [ 34.604752] ? lock_downgrade+0x990/0x990 [ 34.608870] ? trace_hardirqs_on+0xd/0x10 [ 34.613005] ? refcount_sub_and_test+0x115/0x1b0 [ 34.617730] ? refcount_inc+0x50/0x50 [ 34.621500] ? refcount_inc+0x50/0x50 [ 34.625278] ? sk_destruct+0x4c/0x80 [ 34.628961] ? __sk_free+0x5c/0x230 [ 34.632559] ? sk_free+0x2f/0x40 [ 34.635895] ? __tun_detach+0x176/0x1390 [ 34.639936] ? tun_attach+0xf90/0xf90 [ 34.643717] ? locks_remove_file+0x3fa/0x5a0 [ 34.648099] ? fcntl_setlk+0x10d0/0x10d0 [ 34.652137] ? __fsnotify_parent+0xb4/0x3a0 [ 34.656432] ? fsnotify+0x1af0/0x1af0 [ 34.660206] ? __tun_detach+0x1390/0x1390 [ 34.664328] ? __tun_detach+0x1390/0x1390 [ 34.668451] rtnl_unlock+0xe/0x10 [ 34.671873] tun_chr_close+0x49/0x60 [ 34.675556] __fput+0x333/0x7f0 [ 34.678811] ? fput+0x140/0x140 [ 34.682064] ? check_same_owner+0x320/0x320 [ 34.686362] ____fput+0x15/0x20 [ 34.689613] task_work_run+0x199/0x270 [ 34.693476] ? task_work_cancel+0x210/0x210 [ 34.697766] ? free_nsproxy+0x185/0x1f0 [ 34.701711] ? switch_task_namespaces+0xa2/0xc0 [ 34.706356] do_exit+0x9d2/0x1af0 [ 34.709779] ? trace_hardirqs_on+0xd/0x10 [ 34.713901] ? mm_update_next_owner+0x930/0x930 [ 34.718539] ? mark_held_locks+0xb2/0x100 [ 34.722659] ? kfree+0xe4/0x250 [ 34.725909] ? kvfree+0x36/0x60 [ 34.729160] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.734149] ? trace_hardirqs_on+0xd/0x10 [ 34.738270] ? kvfree+0x3b/0x60 [ 34.741523] ? rtnl_unlock+0xe/0x10 [ 34.745122] ? __tun_chr_ioctl+0x27a/0x3d20 [ 34.749428] ? find_held_lock+0x39/0x1d0 [ 34.753464] ? __might_sleep+0x95/0x190 [ 34.757420] ? selinux_file_ioctl+0x444/0x690 [ 34.761884] ? __fget_light+0x29d/0x390 [ 34.765846] ? handle_mm_fault+0x410/0x8d0 [ 34.770058] ? tun_chr_compat_ioctl+0x29/0x30 [ 34.774523] ? tun_chr_compat_ioctl+0x29/0x30 [ 34.778992] do_group_exit+0x149/0x400 [ 34.782851] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 34.787228] ? SyS_exit+0x30/0x30 [ 34.790652] ? do_ioctl+0x60/0x60 [ 34.794078] ? do_fast_syscall_32+0x158/0xf05 [ 34.798546] ? do_group_exit+0x400/0x400 [ 34.802576] SyS_exit_group+0x1d/0x20 [ 34.806348] do_fast_syscall_32+0x3f2/0xf05 [ 34.810648] ? do_int80_syscall_32+0x940/0x940 [ 34.815201] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.819932] ? lockdep_sys_exit+0x47/0xf0 [ 34.824050] ? syscall_return_slowpath+0x2b3/0x510 [ 34.828956] ? sysret32_from_system_call+0x5/0x3b [ 34.833772] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 34.838589] entry_SYSENTER_compat+0x51/0x60 [ 34.842966] RIP: 0023:0xf7efec79 [ 34.846299] RSP: 002b:00000000ffcfed6c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 34.853979] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffcfef58 [ 34.861219] RDX: 0000000008048d6c RSI: 0000000000000036 RDI: 0000000000000004 [ 34.868459] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 34.875698] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 34.882940] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 34.890196] [ 34.891793] Allocated by task 2986: [ 34.895394] save_stack_trace+0x16/0x20 [ 34.899336] save_stack+0x43/0xd0 [ 34.902760] kasan_kmalloc+0xad/0xe0 [ 34.906441] __kmalloc_node+0x47/0x70 [ 34.910210] kvmalloc_node+0x64/0xd0 [ 34.913893] alloc_netdev_mqs+0x16e/0xed0 [ 34.918007] __tun_chr_ioctl+0x12be/0x3d20 [ 34.922208] tun_chr_compat_ioctl+0x29/0x30 [ 34.926498] compat_SyS_ioctl+0x1d7/0x3290 [ 34.930701] do_fast_syscall_32+0x3f2/0xf05 [ 34.934988] entry_SYSENTER_compat+0x51/0x60 [ 34.939363] [ 34.940959] Freed by task 2986: [ 34.944208] save_stack_trace+0x16/0x20 [ 34.948149] save_stack+0x43/0xd0 [ 34.951569] kasan_slab_free+0x71/0xc0 [ 34.955424] kfree+0xca/0x250 [ 34.958498] kvfree+0x36/0x60 [ 34.961573] free_netdev+0x2cf/0x360 [ 34.965257] __tun_chr_ioctl+0x2cf6/0x3d20 [ 34.969459] tun_chr_compat_ioctl+0x29/0x30 [ 34.973752] compat_SyS_ioctl+0x1d7/0x3290 [ 34.977971] do_fast_syscall_32+0x3f2/0xf05 [ 34.982263] entry_SYSENTER_compat+0x51/0x60 [ 34.986637] [ 34.988235] The buggy address belongs to the object at ffff8801cff10380 [ 34.988235] which belongs to the cache kmalloc-16384 of size 16384 [ 35.001208] The buggy address is located 13312 bytes inside of [ 35.001208] 16384-byte region [ffff8801cff10380, ffff8801cff14380) [ 35.013397] The buggy address belongs to the page: [ 35.018297] page:ffffea00073fc400 count:1 mapcount:0 mapping:ffff8801cff10380 index:0x0 compound_mapcount: 0 [ 35.028241] flags: 0x200000000008100(slab|head) [ 35.032880] raw: 0200000000008100 ffff8801cff10380 0000000000000000 0000000100000001 [ 35.040731] raw: ffffea000733fa20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.048581] page dumped because: kasan: bad access detected [ 35.054258] [ 35.055854] Memory state around the buggy address: [ 35.060752] ffff8801cff13680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.068080] ffff8801cff13700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.075410] >ffff8801cff13780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.082741] ^ [ 35.086077] ffff8801cff13800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.093405] ffff8801cff13880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.100732] ================================================================== [ 35.108060] Disabling lock debugging due to kernel taint [ 35.113472] Kernel panic - not syncing: panic_on_warn set ... [ 35.113472] [ 35.120800] CPU: 0 PID: 2986 Comm: syzkaller995923 Tainted: G B 4.14.0-rc3+ #23 [ 35.129337] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.138655] Call Trace: [ 35.141213] dump_stack+0x194/0x257 [ 35.144808] ? arch_local_irq_restore+0x53/0x53 [ 35.149446] ? vprintk_default+0x28/0x30 [ 35.153476] ? detach_if_pending+0x500/0x610 [ 35.157850] panic+0x1e4/0x417 [ 35.161007] ? __warn+0x1d9/0x1d9 [ 35.164430] ? detach_if_pending+0x557/0x610 [ 35.168804] kasan_end_report+0x50/0x50 [ 35.172744] kasan_report+0x144/0x340 [ 35.176511] __asan_report_store8_noabort+0x17/0x20 [ 35.181491] detach_if_pending+0x557/0x610 [ 35.185692] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.190847] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.195477] ? lock_timer_base+0x1a3/0x2b0 [ 35.199675] ? lock_timer_base+0x1eb/0x2b0 [ 35.203875] ? __internal_add_timer+0x2d0/0x2d0 [ 35.208511] ? trace_hardirqs_on+0xd/0x10 [ 35.212628] try_to_del_timer_sync+0xa2/0x120 [ 35.217087] ? del_timer+0x130/0x130 [ 35.220774] ? del_timer_sync+0xeb/0x240 [ 35.224807] del_timer_sync+0x18a/0x240 [ 35.228748] tun_free_netdev+0x105/0x1b0 [ 35.232774] ? tun_xdp+0x410/0x410 [ 35.236279] ? cpumask_next+0x24/0x30 [ 35.240044] ? netdev_refcnt_read+0xed/0x150 [ 35.244419] ? tun_xdp+0x410/0x410 [ 35.247922] netdev_run_todo+0x870/0xca0 [ 35.251947] ? do_group_exit+0x149/0x400 [ 35.255973] ? register_netdev+0x30/0x30 [ 35.260002] ? lock_downgrade+0x990/0x990 [ 35.264113] ? trace_hardirqs_on+0xd/0x10 [ 35.268240] ? refcount_sub_and_test+0x115/0x1b0 [ 35.272959] ? refcount_inc+0x50/0x50 [ 35.276724] ? refcount_inc+0x50/0x50 [ 35.280493] ? sk_destruct+0x4c/0x80 [ 35.284171] ? __sk_free+0x5c/0x230 [ 35.287762] ? sk_free+0x2f/0x40 [ 35.291093] ? __tun_detach+0x176/0x1390 [ 35.295125] ? tun_attach+0xf90/0xf90 [ 35.298894] ? locks_remove_file+0x3fa/0x5a0 [ 35.303268] ? fcntl_setlk+0x10d0/0x10d0 [ 35.307305] ? __fsnotify_parent+0xb4/0x3a0 [ 35.311592] ? fsnotify+0x1af0/0x1af0 [ 35.315363] ? __tun_detach+0x1390/0x1390 [ 35.319475] ? __tun_detach+0x1390/0x1390 [ 35.323588] rtnl_unlock+0xe/0x10 [ 35.327005] tun_chr_close+0x49/0x60 [ 35.330684] __fput+0x333/0x7f0 [ 35.333932] ? fput+0x140/0x140 [ 35.337179] ? check_same_owner+0x320/0x320 [ 35.341470] ____fput+0x15/0x20 [ 35.344716] task_work_run+0x199/0x270 [ 35.348570] ? task_work_cancel+0x210/0x210 [ 35.352855] ? free_nsproxy+0x185/0x1f0 [ 35.356795] ? switch_task_namespaces+0xa2/0xc0 [ 35.361428] do_exit+0x9d2/0x1af0 [ 35.364847] ? trace_hardirqs_on+0xd/0x10 [ 35.368960] ? mm_update_next_owner+0x930/0x930 [ 35.373591] ? mark_held_locks+0xb2/0x100 [ 35.377707] ? kfree+0xe4/0x250 [ 35.380957] ? kvfree+0x36/0x60 [ 35.384207] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.389195] ? trace_hardirqs_on+0xd/0x10 [ 35.393315] ? kvfree+0x3b/0x60 [ 35.396563] ? rtnl_unlock+0xe/0x10 [ 35.400156] ? __tun_chr_ioctl+0x27a/0x3d20 [ 35.404453] ? find_held_lock+0x39/0x1d0 [ 35.408481] ? __might_sleep+0x95/0x190 [ 35.412427] ? selinux_file_ioctl+0x444/0x690 [ 35.416886] ? __fget_light+0x29d/0x390 [ 35.420833] ? handle_mm_fault+0x410/0x8d0 [ 35.425035] ? tun_chr_compat_ioctl+0x29/0x30 [ 35.429495] ? tun_chr_compat_ioctl+0x29/0x30 [ 35.433985] do_group_exit+0x149/0x400 [ 35.437845] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 35.442217] ? SyS_exit+0x30/0x30 [ 35.445645] ? do_ioctl+0x60/0x60