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-next-kasan-gce-0,10.128.0.31' (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: [ 50.689305] ================================================================== [ 50.696752] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 50.703474] Write of size 8 at addr ffff8801ce053740 by task syzkaller976994/2983 [ 50.711060] [ 50.712662] CPU: 0 PID: 2983 Comm: syzkaller976994 Not tainted 4.14.0-rc4-next-20171009+ #33 [ 50.721205] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.730531] Call Trace: [ 50.733094] dump_stack+0x194/0x257 [ 50.736695] ? arch_local_irq_restore+0x53/0x53 [ 50.741338] ? show_regs_print_info+0x65/0x65 [ 50.745810] ? lock_timer_base+0x1a3/0x2b0 [ 50.750020] ? detach_if_pending+0x557/0x610 [ 50.754403] print_address_description+0x73/0x250 [ 50.759218] ? detach_if_pending+0x557/0x610 [ 50.763599] kasan_report+0x25b/0x340 [ 50.767378] __asan_report_store8_noabort+0x17/0x20 [ 50.772365] detach_if_pending+0x557/0x610 [ 50.776575] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.781745] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.786383] ? lock_timer_base+0x1a3/0x2b0 [ 50.790590] ? lock_timer_base+0x1eb/0x2b0 [ 50.794801] ? __internal_add_timer+0x2d0/0x2d0 [ 50.799440] ? trace_hardirqs_on+0xd/0x10 [ 50.803566] try_to_del_timer_sync+0xa2/0x120 [ 50.808033] ? del_timer+0x130/0x130 [ 50.811723] ? del_timer_sync+0xeb/0x240 [ 50.815764] del_timer_sync+0x18a/0x240 [ 50.819718] tun_free_netdev+0x105/0x1b0 [ 50.823751] ? tun_xdp+0x410/0x410 [ 50.827260] ? cpumask_next+0x24/0x30 [ 50.831036] ? netdev_refcnt_read+0xed/0x150 [ 50.835425] netdev_run_todo+0x683/0xae0 [ 50.839459] ? tun_xdp+0x410/0x410 [ 50.842972] ? register_netdev+0x30/0x30 [ 50.847007] ? refcount_inc+0x50/0x50 [ 50.850779] ? refcount_inc+0x50/0x50 [ 50.854556] ? sk_destruct+0x4c/0x80 [ 50.858238] ? __sk_free+0x5c/0x230 [ 50.861837] ? sk_free+0x2f/0x40 [ 50.865174] ? __tun_detach+0x760/0x1570 [ 50.869229] ? locks_remove_file+0x3fa/0x5a0 [ 50.873612] ? fcntl_setlk+0x10d0/0x10d0 [ 50.877651] ? fsnotify+0x1af0/0x1af0 [ 50.881429] ? __tun_detach+0x1570/0x1570 [ 50.885560] rtnl_unlock+0xe/0x10 [ 50.888985] tun_chr_close+0x49/0x60 [ 50.892672] __fput+0x333/0x7f0 [ 50.895931] ? fput+0x140/0x140 [ 50.899184] ? check_same_owner+0x320/0x320 [ 50.903483] ____fput+0x15/0x20 [ 50.906735] task_work_run+0x199/0x270 [ 50.910596] ? task_work_cancel+0x210/0x210 [ 50.914889] ? free_nsproxy+0x185/0x1f0 [ 50.918834] ? switch_task_namespaces+0xa2/0xc0 [ 50.923478] do_exit+0x9c8/0x1b00 [ 50.926907] ? hrtimer_try_to_cancel+0x71/0x5c0 [ 50.931546] ? mm_update_next_owner+0x930/0x930 [ 50.936184] ? __hrtimer_get_remaining+0x1c0/0x1c0 [ 50.941091] ? check_same_owner+0x320/0x320 [ 50.945383] ? _do_fork+0x2f5/0xfe0 [ 50.948984] ? fork_idle+0x2d0/0x2d0 [ 50.952670] ? __might_sleep+0x95/0x190 [ 50.956621] ? do_nanosleep+0x4f9/0x6e0 [ 50.960570] ? schedule_timeout_idle+0x90/0x90 [ 50.965126] ? handle_mm_fault+0x410/0x8d0 [ 50.969340] ? memset+0x31/0x40 [ 50.972598] ? hrtimer_nanosleep+0x2cc/0x860 [ 50.977000] ? nanosleep_copyout+0x100/0x100 [ 50.981378] ? __might_sleep+0x95/0x190 [ 50.985329] ? kasan_check_write+0x14/0x20 [ 50.989535] ? _copy_from_user+0x99/0x110 [ 50.993660] ? __hrtimer_init+0x140/0x140 [ 50.997785] ? syscall_return_slowpath+0x510/0x510 [ 51.002691] do_group_exit+0x149/0x400 [ 51.006564] ? SyS_exit+0x30/0x30 [ 51.009990] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.014979] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.019711] SyS_exit_group+0x1d/0x20 [ 51.023482] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.028207] RIP: 0033:0x44a2b9 [ 51.031367] RSP: 002b:00007ffcbca86758 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 51.039049] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000044a2b9 [ 51.046289] RDX: 0000000000476761 RSI: 0000000000000000 RDI: 0000000000000001 [ 51.053529] RBP: 0000000000000082 R08: 00000000006dcbc0 R09: 0000000000000000 [ 51.060769] R10: 00000000006dcb44 R11: 0000000000000206 R12: 0000000000000000 [ 51.068008] R13: 00007ffcbca866ff R14: 00007fa3377ee9c0 R15: 0000000000000000 [ 51.075266] [ 51.076866] Allocated by task 3009: [ 51.080464] save_stack+0x43/0xd0 [ 51.083887] kasan_kmalloc+0xad/0xe0 [ 51.087572] __kmalloc_node+0x47/0x70 [ 51.091345] kvmalloc_node+0x64/0xd0 [ 51.095029] alloc_netdev_mqs+0x16d/0xed0 [ 51.099147] __tun_chr_ioctl+0x1386/0x3e40 [ 51.103349] tun_chr_ioctl+0x2a/0x40 [ 51.107033] do_vfs_ioctl+0x1b1/0x1530 [ 51.110890] SyS_ioctl+0x8f/0xc0 [ 51.114226] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.118948] [ 51.120547] Freed by task 3009: [ 51.123796] save_stack+0x43/0xd0 [ 51.127219] kasan_slab_free+0x71/0xc0 [ 51.131076] kfree+0xca/0x250 [ 51.134153] kvfree+0x36/0x60 [ 51.137228] free_netdev+0x2cf/0x360 [ 51.140932] __tun_chr_ioctl+0x2df6/0x3e40 [ 51.145137] tun_chr_ioctl+0x2a/0x40 [ 51.148821] do_vfs_ioctl+0x1b1/0x1530 [ 51.152677] SyS_ioctl+0x8f/0xc0 [ 51.156015] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.160736] [ 51.162334] The buggy address belongs to the object at ffff8801ce050340 [ 51.162334] which belongs to the cache kmalloc-16384 of size 16384 [ 51.175327] The buggy address is located 13312 bytes inside of [ 51.175327] 16384-byte region [ffff8801ce050340, ffff8801ce054340) [ 51.187519] The buggy address belongs to the page: [ 51.192418] page:ffffea0007381400 count:1 mapcount:0 mapping:ffff8801ce050340 index:0x0 compound_mapcount: 0 [ 51.202363] flags: 0x200000000008100(slab|head) [ 51.207004] raw: 0200000000008100 ffff8801ce050340 0000000000000000 0000000100000001 [ 51.214855] raw: ffffea000733fc20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 51.222703] page dumped because: kasan: bad access detected [ 51.228380] [ 51.229980] Memory state around the buggy address: [ 51.234877] ffff8801ce053600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.242205] ffff8801ce053680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.249554] >ffff8801ce053700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.256881] ^ [ 51.262300] ffff8801ce053780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.269628] ffff8801ce053800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.276956] ================================================================== [ 51.284292] Disabling lock debugging due to kernel taint [ 51.289705] Kernel panic - not syncing: panic_on_warn set ... [ 51.289705] [ 51.297033] CPU: 0 PID: 2983 Comm: syzkaller976994 Tainted: G B 4.14.0-rc4-next-20171009+ #33 [ 51.306874] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.316193] Call Trace: [ 51.318748] dump_stack+0x194/0x257 [ 51.322344] ? arch_local_irq_restore+0x53/0x53 [ 51.326982] ? vprintk_default+0x28/0x30 [ 51.331014] ? detach_if_pending+0x470/0x610 [ 51.335389] panic+0x1e4/0x41c [ 51.338546] ? refcount_error_report+0x214/0x214 [ 51.343276] ? detach_if_pending+0x557/0x610 [ 51.347650] kasan_end_report+0x50/0x50 [ 51.351604] kasan_report+0x144/0x340 [ 51.355374] __asan_report_store8_noabort+0x17/0x20 [ 51.360356] detach_if_pending+0x557/0x610 [ 51.364559] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.369714] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.374347] ? lock_timer_base+0x1a3/0x2b0 [ 51.378546] ? lock_timer_base+0x1eb/0x2b0 [ 51.382749] ? __internal_add_timer+0x2d0/0x2d0 [ 51.387382] ? trace_hardirqs_on+0xd/0x10 [ 51.391498] try_to_del_timer_sync+0xa2/0x120 [ 51.395959] ? del_timer+0x130/0x130 [ 51.399639] ? del_timer_sync+0xeb/0x240 [ 51.403671] del_timer_sync+0x18a/0x240 [ 51.407615] tun_free_netdev+0x105/0x1b0 [ 51.411651] ? tun_xdp+0x410/0x410 [ 51.415158] ? cpumask_next+0x24/0x30 [ 51.418926] ? netdev_refcnt_read+0xed/0x150 [ 51.423303] netdev_run_todo+0x683/0xae0 [ 51.427332] ? tun_xdp+0x410/0x410 [ 51.430838] ? register_netdev+0x30/0x30 [ 51.434864] ? refcount_inc+0x50/0x50 [ 51.438627] ? refcount_inc+0x50/0x50 [ 51.442396] ? sk_destruct+0x4c/0x80 [ 51.446074] ? __sk_free+0x5c/0x230 [ 51.449669] ? sk_free+0x2f/0x40 [ 51.453000] ? __tun_detach+0x760/0x1570 [ 51.457035] ? locks_remove_file+0x3fa/0x5a0 [ 51.461410] ? fcntl_setlk+0x10d0/0x10d0 [ 51.465451] ? fsnotify+0x1af0/0x1af0 [ 51.469220] ? __tun_detach+0x1570/0x1570 [ 51.473333] rtnl_unlock+0xe/0x10 [ 51.476750] tun_chr_close+0x49/0x60 [ 51.480429] __fput+0x333/0x7f0 [ 51.483681] ? fput+0x140/0x140 [ 51.486930] ? check_same_owner+0x320/0x320 [ 51.491219] ____fput+0x15/0x20 [ 51.494464] task_work_run+0x199/0x270 [ 51.498317] ? task_work_cancel+0x210/0x210 [ 51.502604] ? free_nsproxy+0x185/0x1f0 [ 51.506544] ? switch_task_namespaces+0xa2/0xc0 [ 51.511182] do_exit+0x9c8/0x1b00 [ 51.514604] ? hrtimer_try_to_cancel+0x71/0x5c0 [ 51.519236] ? mm_update_next_owner+0x930/0x930 [ 51.523871] ? __hrtimer_get_remaining+0x1c0/0x1c0 [ 51.528772] ? check_same_owner+0x320/0x320 [ 51.533059] ? _do_fork+0x2f5/0xfe0 [ 51.536652] ? fork_idle+0x2d0/0x2d0 [ 51.540340] ? __might_sleep+0x95/0x190 [ 51.544282] ? do_nanosleep+0x4f9/0x6e0 [ 51.548223] ? schedule_timeout_idle+0x90/0x90 [ 51.552780] ? handle_mm_fault+0x410/0x8d0 [ 51.556986] ? memset+0x31/0x40 [ 51.560242] ? hrtimer_nanosleep+0x2cc/0x860 [ 51.564624] ? nanosleep_copyout+0x100/0x100 [ 51.569000] ? __might_sleep+0x95/0x190 [ 51.572942] ? kasan_check_write+0x14/0x20 [ 51.577148] ? _copy_from_user+0x99/0x110 [ 51.581266] ? __hrtimer_init+0x140/0x140 [ 51.585380] ? syscall_return_slowpath+0x510/0x510 [ 51.590275] do_group_exit+0x149/0x400 [ 51.594128] ? SyS_exit+0x30/0x30 [ 51.597549] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.602529] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.607252] SyS_exit_group+0x1d/0x20 [ 51.611021] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.615741] RIP: 0033:0x44a2b9 [ 51.618896] RSP: 002b:00007ffcbca86758 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 51.626569] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000044a2b9 [ 51.633807] RDX: 0000000000476761 RSI: 0000000000000000 RDI: 0000000000000001 [ 51.641042] RBP: 0000000000000082 R08: 00000000006dcbc0 R09: 0000000000000000 [ 51.648276] R10: 00000000006dcb44 R11: 0000000000000206 R12: 0000000000000000 [ 51.655510] R13: 00007ffcbca866ff R14: 00007fa3377ee9c0 R15: 0000000000000000