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.15.209' (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: [ 44.509386] ================================================================== [ 44.516854] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 44.523582] Write of size 8 at addr ffff8801cc983740 by task syzkaller880522/2989 [ 44.531172] [ 44.532778] CPU: 1 PID: 2989 Comm: syzkaller880522 Not tainted 4.14.0-rc2+ #19 [ 44.540110] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 44.549438] Call Trace: [ 44.552002] dump_stack+0x194/0x257 [ 44.555607] ? arch_local_irq_restore+0x53/0x53 [ 44.560248] ? show_regs_print_info+0x65/0x65 [ 44.564718] ? lock_timer_base+0x1a3/0x2b0 [ 44.568930] ? detach_if_pending+0x557/0x610 [ 44.573320] print_address_description+0x73/0x250 [ 44.578139] ? detach_if_pending+0x557/0x610 [ 44.582524] kasan_report+0x25b/0x340 [ 44.586300] __asan_report_store8_noabort+0x17/0x20 [ 44.591287] detach_if_pending+0x557/0x610 [ 44.595510] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.600674] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.605313] ? lock_timer_base+0x1a3/0x2b0 [ 44.609519] ? lock_timer_base+0x1eb/0x2b0 [ 44.613734] ? __internal_add_timer+0x2d0/0x2d0 [ 44.618380] ? trace_hardirqs_on+0xd/0x10 [ 44.622508] try_to_del_timer_sync+0xa2/0x120 [ 44.626977] ? del_timer+0x130/0x130 [ 44.630668] ? del_timer_sync+0xeb/0x240 [ 44.634711] del_timer_sync+0x18a/0x240 [ 44.638662] tun_free_netdev+0x105/0x1b0 [ 44.642698] ? tun_xdp+0x410/0x410 [ 44.646213] ? cpumask_next+0x24/0x30 [ 44.649994] ? netdev_refcnt_read+0xed/0x150 [ 44.654379] ? tun_xdp+0x410/0x410 [ 44.657892] netdev_run_todo+0x870/0xca0 [ 44.661929] ? do_group_exit+0x149/0x400 [ 44.665981] ? register_netdev+0x30/0x30 [ 44.670022] ? lock_downgrade+0x990/0x990 [ 44.674144] ? trace_hardirqs_on+0xd/0x10 [ 44.678289] ? refcount_sub_and_test+0x115/0x1b0 [ 44.683022] ? refcount_inc+0x50/0x50 [ 44.686796] ? refcount_inc+0x50/0x50 [ 44.690577] ? sk_destruct+0x4c/0x80 [ 44.694264] ? __sk_free+0x5c/0x230 [ 44.697868] ? sk_free+0x2f/0x40 [ 44.701209] ? __tun_detach+0x176/0x1390 [ 44.705257] ? tun_attach+0xf90/0xf90 [ 44.709044] ? locks_remove_file+0x3fa/0x5a0 [ 44.713429] ? fcntl_setlk+0x10d0/0x10d0 [ 44.717466] ? __fsnotify_parent+0xb4/0x3a0 [ 44.721762] ? fsnotify+0x1af0/0x1af0 [ 44.725539] ? __tun_detach+0x1390/0x1390 [ 44.729659] ? __tun_detach+0x1390/0x1390 [ 44.733780] rtnl_unlock+0xe/0x10 [ 44.737204] tun_chr_close+0x49/0x60 [ 44.740893] __fput+0x333/0x7f0 [ 44.744151] ? fput+0x140/0x140 [ 44.747405] ? check_same_owner+0x320/0x320 [ 44.751704] ____fput+0x15/0x20 [ 44.754957] task_work_run+0x199/0x270 [ 44.758823] ? task_work_cancel+0x210/0x210 [ 44.763117] ? free_nsproxy+0x185/0x1f0 [ 44.767070] ? switch_task_namespaces+0xa2/0xc0 [ 44.771716] do_exit+0x9d2/0x1af0 [ 44.775142] ? trace_hardirqs_on+0xd/0x10 [ 44.779266] ? mm_update_next_owner+0x930/0x930 [ 44.783906] ? mark_held_locks+0xb2/0x100 [ 44.788028] ? kfree+0xe4/0x250 [ 44.791276] ? kvfree+0x36/0x60 [ 44.794527] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.799515] ? trace_hardirqs_on+0xd/0x10 [ 44.803637] ? kvfree+0x3b/0x60 [ 44.806897] ? rtnl_unlock+0xe/0x10 [ 44.810495] ? __tun_chr_ioctl+0x27a/0x3d20 [ 44.814892] ? __pmd_alloc+0x4e0/0x4e0 [ 44.818755] ? __might_sleep+0x95/0x190 [ 44.822710] ? selinux_file_ioctl+0x444/0x690 [ 44.827175] ? __fget_light+0x29d/0x390 [ 44.831146] ? tun_chr_compat_ioctl+0x29/0x30 [ 44.835614] ? tun_chr_compat_ioctl+0x29/0x30 [ 44.840083] do_group_exit+0x149/0x400 [ 44.843938] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.848487] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 44.852867] ? SyS_exit+0x30/0x30 [ 44.856294] ? do_ioctl+0x60/0x60 [ 44.859724] ? do_fast_syscall_32+0x158/0xf05 [ 44.864190] ? do_group_exit+0x400/0x400 [ 44.868221] SyS_exit_group+0x1d/0x20 [ 44.871994] do_fast_syscall_32+0x3f2/0xf05 [ 44.876295] ? do_int80_syscall_32+0x940/0x940 [ 44.880849] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 44.885579] ? lockdep_sys_exit+0x47/0xf0 [ 44.889700] ? syscall_return_slowpath+0x2b3/0x510 [ 44.894608] ? sysret32_from_system_call+0x5/0x3b [ 44.899426] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 44.904246] entry_SYSENTER_compat+0x51/0x60 [ 44.908624] RIP: 0023:0xf7efec79 [ 44.911958] RSP: 002b:00000000ff97014c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 44.919639] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ff970338 [ 44.926881] RDX: 0000000008048e5f RSI: 0000000000000036 RDI: 0000000000000004 [ 44.934126] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 44.941366] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 44.948606] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 44.955867] [ 44.957467] Allocated by task 2989: [ 44.961067] save_stack_trace+0x16/0x20 [ 44.965012] save_stack+0x43/0xd0 [ 44.968437] kasan_kmalloc+0xad/0xe0 [ 44.972122] __kmalloc_node+0x47/0x70 [ 44.975892] kvmalloc_node+0x64/0xd0 [ 44.979579] alloc_netdev_mqs+0x16e/0xed0 [ 44.983697] __tun_chr_ioctl+0x12be/0x3d20 [ 44.987902] tun_chr_compat_ioctl+0x29/0x30 [ 44.992195] compat_SyS_ioctl+0x1d7/0x3290 [ 44.996399] do_fast_syscall_32+0x3f2/0xf05 [ 45.000691] entry_SYSENTER_compat+0x51/0x60 [ 45.005068] [ 45.006667] Freed by task 2989: [ 45.009921] save_stack_trace+0x16/0x20 [ 45.013866] save_stack+0x43/0xd0 [ 45.017292] kasan_slab_free+0x71/0xc0 [ 45.021149] kfree+0xca/0x250 [ 45.024228] kvfree+0x36/0x60 [ 45.027307] free_netdev+0x2cf/0x360 [ 45.030989] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.035192] tun_chr_compat_ioctl+0x29/0x30 [ 45.039484] compat_SyS_ioctl+0x1d7/0x3290 [ 45.043691] do_fast_syscall_32+0x3f2/0xf05 [ 45.047984] entry_SYSENTER_compat+0x51/0x60 [ 45.052359] [ 45.053962] The buggy address belongs to the object at ffff8801cc980340 [ 45.053962] which belongs to the cache kmalloc-16384 of size 16384 [ 45.066937] The buggy address is located 13312 bytes inside of [ 45.066937] 16384-byte region [ffff8801cc980340, ffff8801cc984340) [ 45.079129] The buggy address belongs to the page: [ 45.084033] page:ffffea0007326000 count:1 mapcount:0 mapping:ffff8801cc980340 index:0x0 compound_mapcount: 0 [ 45.093982] flags: 0x200000000008100(slab|head) [ 45.098624] raw: 0200000000008100 ffff8801cc980340 0000000000000000 0000000100000001 [ 45.106477] raw: ffffea0007363820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.114323] page dumped because: kasan: bad access detected [ 45.120003] [ 45.121602] Memory state around the buggy address: [ 45.126502] ffff8801cc983600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.133831] ffff8801cc983680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.141163] >ffff8801cc983700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.148493] ^ [ 45.153913] ffff8801cc983780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.161244] ffff8801cc983800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.168572] ================================================================== [ 45.175900] Disabling lock debugging due to kernel taint [ 45.181314] Kernel panic - not syncing: panic_on_warn set ... [ 45.181314] [ 45.188642] CPU: 1 PID: 2989 Comm: syzkaller880522 Tainted: G B 4.14.0-rc2+ #19 [ 45.197180] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.206500] Call Trace: [ 45.209061] dump_stack+0x194/0x257 [ 45.212655] ? arch_local_irq_restore+0x53/0x53 [ 45.217293] ? vprintk_default+0x28/0x30 [ 45.221326] ? detach_if_pending+0x4d0/0x610 [ 45.225703] panic+0x1e4/0x417 [ 45.228864] ? __warn+0x1d9/0x1d9 [ 45.232292] ? detach_if_pending+0x557/0x610 [ 45.236667] kasan_end_report+0x50/0x50 [ 45.240607] kasan_report+0x144/0x340 [ 45.244375] __asan_report_store8_noabort+0x17/0x20 [ 45.249355] detach_if_pending+0x557/0x610 [ 45.253555] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.258712] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.263344] ? lock_timer_base+0x1a3/0x2b0 [ 45.267543] ? lock_timer_base+0x1eb/0x2b0 [ 45.271745] ? __internal_add_timer+0x2d0/0x2d0 [ 45.276382] ? trace_hardirqs_on+0xd/0x10 [ 45.280498] try_to_del_timer_sync+0xa2/0x120 [ 45.284959] ? del_timer+0x130/0x130 [ 45.288639] ? del_timer_sync+0xeb/0x240 [ 45.292666] del_timer_sync+0x18a/0x240 [ 45.296608] tun_free_netdev+0x105/0x1b0 [ 45.300634] ? tun_xdp+0x410/0x410 [ 45.304139] ? cpumask_next+0x24/0x30 [ 45.307919] ? netdev_refcnt_read+0xed/0x150 [ 45.312298] ? tun_xdp+0x410/0x410 [ 45.315809] netdev_run_todo+0x870/0xca0 [ 45.319842] ? do_group_exit+0x149/0x400 [ 45.323880] ? register_netdev+0x30/0x30 [ 45.327916] ? lock_downgrade+0x990/0x990 [ 45.332034] ? trace_hardirqs_on+0xd/0x10 [ 45.336160] ? refcount_sub_and_test+0x115/0x1b0 [ 45.340881] ? refcount_inc+0x50/0x50 [ 45.344648] ? refcount_inc+0x50/0x50 [ 45.348418] ? sk_destruct+0x4c/0x80 [ 45.352098] ? __sk_free+0x5c/0x230 [ 45.355690] ? sk_free+0x2f/0x40 [ 45.359022] ? __tun_detach+0x176/0x1390 [ 45.363052] ? tun_attach+0xf90/0xf90 [ 45.366825] ? locks_remove_file+0x3fa/0x5a0 [ 45.371198] ? fcntl_setlk+0x10d0/0x10d0 [ 45.375230] ? __fsnotify_parent+0xb4/0x3a0 [ 45.379517] ? fsnotify+0x1af0/0x1af0 [ 45.383286] ? __tun_detach+0x1390/0x1390 [ 45.387400] ? __tun_detach+0x1390/0x1390 [ 45.391514] rtnl_unlock+0xe/0x10 [ 45.394935] tun_chr_close+0x49/0x60 [ 45.398626] __fput+0x333/0x7f0 [ 45.401874] ? fput+0x140/0x140 [ 45.405122] ? check_same_owner+0x320/0x320 [ 45.409411] ____fput+0x15/0x20 [ 45.412659] task_work_run+0x199/0x270 [ 45.416513] ? task_work_cancel+0x210/0x210 [ 45.420803] ? free_nsproxy+0x185/0x1f0 [ 45.424742] ? switch_task_namespaces+0xa2/0xc0 [ 45.429377] do_exit+0x9d2/0x1af0 [ 45.432797] ? trace_hardirqs_on+0xd/0x10 [ 45.436913] ? mm_update_next_owner+0x930/0x930 [ 45.441548] ? mark_held_locks+0xb2/0x100 [ 45.445664] ? kfree+0xe4/0x250 [ 45.448914] ? kvfree+0x36/0x60 [ 45.452160] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.457140] ? trace_hardirqs_on+0xd/0x10 [ 45.461254] ? kvfree+0x3b/0x60 [ 45.464504] ? rtnl_unlock+0xe/0x10 [ 45.468097] ? __tun_chr_ioctl+0x27a/0x3d20 [ 45.472393] ? __pmd_alloc+0x4e0/0x4e0 [ 45.476248] ? __might_sleep+0x95/0x190 [ 45.480193] ? selinux_file_ioctl+0x444/0x690 [ 45.484654] ? __fget_light+0x29d/0x390 [ 45.488605] ? tun_chr_compat_ioctl+0x29/0x30 [ 45.493063] ? tun_chr_compat_ioctl+0x29/0x30 [ 45.497524] do_group_exit+0x149/0x400 [ 45.501384] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.505932] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 45.510305] ? SyS_exit+0x30/0x30