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.235' (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: [ 29.442268] ================================================================== [ 29.449698] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.456429] Write of size 8 at addr ffff8801ce1ab740 by task syzkaller609743/2981 [ 29.464026] [ 29.465632] CPU: 0 PID: 2981 Comm: syzkaller609743 Not tainted 4.14.0-rc2+ #14 [ 29.472960] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.482284] Call Trace: [ 29.484848] dump_stack+0x194/0x257 [ 29.488452] ? arch_local_irq_restore+0x53/0x53 [ 29.493101] ? show_regs_print_info+0x65/0x65 [ 29.497572] ? lock_timer_base+0x1a3/0x2b0 [ 29.501779] ? detach_if_pending+0x557/0x610 [ 29.506160] print_address_description+0x73/0x250 [ 29.510973] ? detach_if_pending+0x557/0x610 [ 29.515359] kasan_report+0x25b/0x340 [ 29.519140] __asan_report_store8_noabort+0x17/0x20 [ 29.524129] detach_if_pending+0x557/0x610 [ 29.528337] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.533500] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.538141] ? lock_timer_base+0x1a3/0x2b0 [ 29.542345] ? lock_timer_base+0x1eb/0x2b0 [ 29.546552] ? __internal_add_timer+0x2d0/0x2d0 [ 29.551193] ? trace_hardirqs_on+0xd/0x10 [ 29.555331] try_to_del_timer_sync+0xa2/0x120 [ 29.559794] ? del_timer+0x130/0x130 [ 29.563478] ? del_timer_sync+0xeb/0x240 [ 29.567518] del_timer_sync+0x18a/0x240 [ 29.571466] tun_free_netdev+0x105/0x1b0 [ 29.575503] ? tun_xdp+0x410/0x410 [ 29.579019] ? cpumask_next+0x24/0x30 [ 29.582794] ? netdev_refcnt_read+0xed/0x150 [ 29.587176] ? tun_xdp+0x410/0x410 [ 29.590688] netdev_run_todo+0x870/0xca0 [ 29.594720] ? do_group_exit+0x149/0x400 [ 29.598756] ? register_netdev+0x30/0x30 [ 29.602793] ? lock_downgrade+0x990/0x990 [ 29.606933] ? refcount_sub_and_test+0x115/0x1b0 [ 29.611657] ? refcount_inc+0x50/0x50 [ 29.615427] ? refcount_inc+0x50/0x50 [ 29.619201] ? sk_destruct+0x4c/0x80 [ 29.622882] ? __sk_free+0x5c/0x230 [ 29.626480] ? sk_free+0x2f/0x40 [ 29.629815] ? __tun_detach+0x176/0x1390 [ 29.633858] ? tun_attach+0xf90/0xf90 [ 29.637633] ? do_raw_spin_trylock+0x190/0x190 [ 29.642190] ? locks_remove_file+0x3fa/0x5a0 [ 29.646570] ? fcntl_setlk+0x10d0/0x10d0 [ 29.650605] ? __fsnotify_parent+0xb4/0x3a0 [ 29.654905] ? fsnotify+0x1af0/0x1af0 [ 29.658678] ? __tun_detach+0x1390/0x1390 [ 29.662797] ? __tun_detach+0x1390/0x1390 [ 29.666917] rtnl_unlock+0xe/0x10 [ 29.670341] tun_chr_close+0x49/0x60 [ 29.674023] __fput+0x333/0x7f0 [ 29.677277] ? fput+0x140/0x140 [ 29.680527] ? check_same_owner+0x320/0x320 [ 29.685164] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.689633] ____fput+0x15/0x20 [ 29.692890] task_work_run+0x199/0x270 [ 29.696751] ? task_work_cancel+0x210/0x210 [ 29.701043] ? _raw_spin_unlock+0x22/0x30 [ 29.705162] ? switch_task_namespaces+0x87/0xc0 [ 29.709806] do_exit+0x9d2/0x1af0 [ 29.713235] ? mm_update_next_owner+0x930/0x930 [ 29.717876] ? lock_acquire+0x1d5/0x580 [ 29.721819] ? __handle_mm_fault+0xf07/0x39c0 [ 29.726291] ? lock_release+0xd70/0xd70 [ 29.730235] ? check_noncircular+0x20/0x20 [ 29.734442] ? kvfree+0x3b/0x60 [ 29.737697] ? rtnl_unlock+0xe/0x10 [ 29.741304] ? check_noncircular+0x20/0x20 [ 29.745512] ? __handle_mm_fault+0x587/0x39c0 [ 29.749981] ? __pmd_alloc+0x4e0/0x4e0 [ 29.753847] ? find_held_lock+0x39/0x1d0 [ 29.757888] ? lock_downgrade+0x990/0x990 [ 29.762032] do_group_exit+0x149/0x400 [ 29.765885] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.770438] ? vmacache_find+0x5f/0x280 [ 29.774381] ? SyS_exit+0x30/0x30 [ 29.777809] ? do_fast_syscall_32+0x158/0xf05 [ 29.782272] ? do_group_exit+0x400/0x400 [ 29.786302] SyS_exit_group+0x1d/0x20 [ 29.790070] do_fast_syscall_32+0x3f2/0xf05 [ 29.794367] ? do_int80_syscall_32+0x940/0x940 [ 29.798919] ? kasan_check_read+0x11/0x20 [ 29.803038] ? syscall_return_slowpath+0x510/0x510 [ 29.807936] ? SyS_rt_sigaction+0x94/0x1b0 [ 29.812142] ? lockdep_sys_exit+0x47/0xf0 [ 29.816259] ? retint_user+0x18/0x20 [ 29.819947] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.824772] entry_SYSENTER_compat+0x51/0x60 [ 29.829150] RIP: 0023:0xf7fa8c79 [ 29.832485] RSP: 002b:00000000ff84aacc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 29.840164] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 29.847404] RDX: 0000000000000000 RSI: 00000000080db4f8 RDI: 00000000080f22a0 [ 29.854643] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 29.861881] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 29.869120] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 29.876374] [ 29.877974] Allocated by task 2981: [ 29.881569] save_stack_trace+0x16/0x20 [ 29.885512] save_stack+0x43/0xd0 [ 29.888932] kasan_kmalloc+0xad/0xe0 [ 29.892611] __kmalloc_node+0x47/0x70 [ 29.896381] kvmalloc_node+0x64/0xd0 [ 29.900062] alloc_netdev_mqs+0x16e/0xed0 [ 29.904178] __tun_chr_ioctl+0x12be/0x3d20 [ 29.908382] tun_chr_compat_ioctl+0x29/0x30 [ 29.912678] compat_SyS_ioctl+0x1d7/0x3290 [ 29.916894] do_fast_syscall_32+0x3f2/0xf05 [ 29.921184] entry_SYSENTER_compat+0x51/0x60 [ 29.925558] [ 29.927153] Freed by task 2981: [ 29.930403] save_stack_trace+0x16/0x20 [ 29.934348] save_stack+0x43/0xd0 [ 29.937782] kasan_slab_free+0x71/0xc0 [ 29.941637] kfree+0xca/0x250 [ 29.944712] kvfree+0x36/0x60 [ 29.947788] free_netdev+0x2cf/0x360 [ 29.951476] __tun_chr_ioctl+0x2cf6/0x3d20 [ 29.955679] tun_chr_compat_ioctl+0x29/0x30 [ 29.959967] compat_SyS_ioctl+0x1d7/0x3290 [ 29.964170] do_fast_syscall_32+0x3f2/0xf05 [ 29.968458] entry_SYSENTER_compat+0x51/0x60 [ 29.972833] [ 29.974431] The buggy address belongs to the object at ffff8801ce1a8340 [ 29.974431] which belongs to the cache kmalloc-16384 of size 16384 [ 29.987401] The buggy address is located 13312 bytes inside of [ 29.987401] 16384-byte region [ffff8801ce1a8340, ffff8801ce1ac340) [ 29.999673] The buggy address belongs to the page: [ 30.004569] page:ffffea0007386a00 count:1 mapcount:0 mapping:ffff8801ce1a8340 index:0x0 compound_mapcount: 0 [ 30.014513] flags: 0x200000000008100(slab|head) [ 30.019152] raw: 0200000000008100 ffff8801ce1a8340 0000000000000000 0000000100000001 [ 30.027000] raw: ffffea000737f820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 30.034846] page dumped because: kasan: bad access detected [ 30.040522] [ 30.042119] Memory state around the buggy address: [ 30.047013] ffff8801ce1ab600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.054341] ffff8801ce1ab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.061667] >ffff8801ce1ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.068991] ^ [ 30.074408] ffff8801ce1ab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.081735] ffff8801ce1ab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 30.089060] ================================================================== [ 30.096382] Disabling lock debugging due to kernel taint [ 30.101793] Kernel panic - not syncing: panic_on_warn set ... [ 30.101793] [ 30.109118] CPU: 0 PID: 2981 Comm: syzkaller609743 Tainted: G B 4.14.0-rc2+ #14 [ 30.117658] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.126983] Call Trace: [ 30.129538] dump_stack+0x194/0x257 [ 30.133132] ? arch_local_irq_restore+0x53/0x53 [ 30.137767] ? vprintk_default+0x28/0x30 [ 30.141800] ? detach_if_pending+0x540/0x610 [ 30.146172] panic+0x1e4/0x417 [ 30.149330] ? __warn+0x1d9/0x1d9 [ 30.152752] ? detach_if_pending+0x557/0x610 [ 30.157124] kasan_end_report+0x50/0x50 [ 30.161061] kasan_report+0x144/0x340 [ 30.164829] __asan_report_store8_noabort+0x17/0x20 [ 30.169807] detach_if_pending+0x557/0x610 [ 30.174005] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.179160] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.183790] ? lock_timer_base+0x1a3/0x2b0 [ 30.187986] ? lock_timer_base+0x1eb/0x2b0 [ 30.192188] ? __internal_add_timer+0x2d0/0x2d0 [ 30.196820] ? trace_hardirqs_on+0xd/0x10 [ 30.200934] try_to_del_timer_sync+0xa2/0x120 [ 30.205393] ? del_timer+0x130/0x130 [ 30.209071] ? del_timer_sync+0xeb/0x240 [ 30.213099] del_timer_sync+0x18a/0x240 [ 30.217037] tun_free_netdev+0x105/0x1b0 [ 30.221063] ? tun_xdp+0x410/0x410 [ 30.224568] ? cpumask_next+0x24/0x30 [ 30.228331] ? netdev_refcnt_read+0xed/0x150 [ 30.232713] ? tun_xdp+0x410/0x410 [ 30.236216] netdev_run_todo+0x870/0xca0 [ 30.240239] ? do_group_exit+0x149/0x400 [ 30.244269] ? register_netdev+0x30/0x30 [ 30.248295] ? lock_downgrade+0x990/0x990 [ 30.252416] ? refcount_sub_and_test+0x115/0x1b0 [ 30.257135] ? refcount_inc+0x50/0x50 [ 30.260898] ? refcount_inc+0x50/0x50 [ 30.264663] ? sk_destruct+0x4c/0x80 [ 30.268339] ? __sk_free+0x5c/0x230 [ 30.271931] ? sk_free+0x2f/0x40 [ 30.275261] ? __tun_detach+0x176/0x1390 [ 30.279290] ? tun_attach+0xf90/0xf90 [ 30.283056] ? do_raw_spin_trylock+0x190/0x190 [ 30.287610] ? locks_remove_file+0x3fa/0x5a0 [ 30.291982] ? fcntl_setlk+0x10d0/0x10d0 [ 30.296007] ? __fsnotify_parent+0xb4/0x3a0 [ 30.300292] ? fsnotify+0x1af0/0x1af0 [ 30.304056] ? __tun_detach+0x1390/0x1390 [ 30.308166] ? __tun_detach+0x1390/0x1390 [ 30.312278] rtnl_unlock+0xe/0x10 [ 30.315694] tun_chr_close+0x49/0x60 [ 30.319372] __fput+0x333/0x7f0 [ 30.322620] ? fput+0x140/0x140 [ 30.325865] ? check_same_owner+0x320/0x320 [ 30.330150] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.334610] ____fput+0x15/0x20 [ 30.337855] task_work_run+0x199/0x270 [ 30.341707] ? task_work_cancel+0x210/0x210 [ 30.345989] ? _raw_spin_unlock+0x22/0x30 [ 30.350102] ? switch_task_namespaces+0x87/0xc0 [ 30.354735] do_exit+0x9d2/0x1af0 [ 30.358153] ? mm_update_next_owner+0x930/0x930 [ 30.362785] ? lock_acquire+0x1d5/0x580 [ 30.366721] ? __handle_mm_fault+0xf07/0x39c0 [ 30.371182] ? lock_release+0xd70/0xd70 [ 30.375118] ? check_noncircular+0x20/0x20 [ 30.379315] ? kvfree+0x3b/0x60 [ 30.382561] ? rtnl_unlock+0xe/0x10 [ 30.386150] ? check_noncircular+0x20/0x20 [ 30.390350] ? __handle_mm_fault+0x587/0x39c0 [ 30.394811] ? __pmd_alloc+0x4e0/0x4e0 [ 30.398665] ? find_held_lock+0x39/0x1d0 [ 30.402694] ? lock_downgrade+0x990/0x990 [ 30.406817] do_group_exit+0x149/0x400 [ 30.410666] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.415210] ? vmacache_find+0x5f/0x280 [ 30.419147] ? SyS_exit+0x30/0x30 [ 30.422567] ? do_fast_syscall_32+0x158/0xf05 [ 30.427024] ? do_group_exit+0x400/0x400 [ 30.431048] SyS_exit_group+0x1d/0x20 [ 30.434810] do_fast_syscall_32+0x3f2/0xf05 [ 30.439099] ? do_int80_syscall_32+0x940/0x940