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-4,10.128.0.33' (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: [ 47.033687] ================================================================== [ 47.041270] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 47.048003] Write of size 8 at addr ffff8801ce6437c0 by task syzkaller099950/2981 [ 47.055595] [ 47.057200] CPU: 0 PID: 2981 Comm: syzkaller099950 Not tainted 4.13.0-next-20170906+ #16 [ 47.065413] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.074755] Call Trace: [ 47.077330] dump_stack+0x194/0x257 [ 47.080949] ? arch_local_irq_restore+0x53/0x53 [ 47.085612] ? show_regs_print_info+0x65/0x65 [ 47.090104] ? lock_timer_base+0x1a3/0x2b0 [ 47.094332] ? detach_if_pending+0x557/0x610 [ 47.098727] print_address_description+0x73/0x250 [ 47.103551] ? detach_if_pending+0x557/0x610 [ 47.107961] kasan_report+0x24e/0x340 [ 47.111774] __asan_report_store8_noabort+0x17/0x20 [ 47.116791] detach_if_pending+0x557/0x610 [ 47.121007] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.126187] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.130849] ? lock_timer_base+0x1a3/0x2b0 [ 47.135069] ? lock_timer_base+0x1eb/0x2b0 [ 47.139289] ? __internal_add_timer+0x2d0/0x2d0 [ 47.143942] ? trace_hardirqs_on+0xd/0x10 [ 47.148122] try_to_del_timer_sync+0xa2/0x120 [ 47.152609] ? del_timer+0x130/0x130 [ 47.156301] ? del_timer_sync+0xeb/0x240 [ 47.160342] del_timer_sync+0x18a/0x240 [ 47.164295] tun_free_netdev+0x105/0x1b0 [ 47.168330] ? tun_xdp+0x410/0x410 [ 47.171851] ? cpumask_next+0x24/0x30 [ 47.175657] ? netdev_refcnt_read+0xed/0x150 [ 47.180050] ? tun_xdp+0x410/0x410 [ 47.183581] netdev_run_todo+0x870/0xca0 [ 47.187628] ? do_group_exit+0x149/0x400 [ 47.191677] ? register_netdev+0x30/0x30 [ 47.195912] ? lock_downgrade+0x990/0x990 [ 47.200133] ? trace_hardirqs_on+0xd/0x10 [ 47.204293] ? refcount_sub_and_test+0x115/0x1b0 [ 47.209040] ? refcount_inc+0x50/0x50 [ 47.212830] ? refcount_inc+0x50/0x50 [ 47.216633] ? sk_destruct+0x4c/0x80 [ 47.220348] ? __sk_free+0x5c/0x230 [ 47.223995] ? sk_free+0x2f/0x40 [ 47.227378] ? __tun_detach+0x176/0x1390 [ 47.231466] ? tun_attach+0xf90/0xf90 [ 47.235294] ? locks_remove_file+0x3fa/0x5a0 [ 47.239720] ? fcntl_setlk+0x10d0/0x10d0 [ 47.243783] ? __fsnotify_parent+0xb4/0x3a0 [ 47.248105] ? fsnotify+0x1af0/0x1af0 [ 47.251909] ? __tun_detach+0x1390/0x1390 [ 47.256044] ? __tun_detach+0x1390/0x1390 [ 47.260190] rtnl_unlock+0xe/0x10 [ 47.263624] tun_chr_close+0x49/0x60 [ 47.267417] __fput+0x333/0x7f0 [ 47.270687] ? fput+0x140/0x140 [ 47.273955] ? check_same_owner+0x320/0x320 [ 47.278272] ____fput+0x15/0x20 [ 47.281541] task_work_run+0x199/0x270 [ 47.285426] ? task_work_cancel+0x210/0x210 [ 47.289740] ? free_nsproxy+0x185/0x1f0 [ 47.293700] ? switch_task_namespaces+0xa2/0xc0 [ 47.298361] do_exit+0xa52/0x1b40 [ 47.301798] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.306801] ? check_noncircular+0x20/0x20 [ 47.311023] ? mm_update_next_owner+0x930/0x930 [ 47.315676] ? __pmd_alloc+0x4e0/0x4e0 [ 47.319553] ? find_held_lock+0x39/0x1d0 [ 47.323604] ? lock_downgrade+0x990/0x990 [ 47.327760] ? handle_mm_fault+0x4a2/0x860 [ 47.331971] ? down_read_trylock+0xdb/0x170 [ 47.336269] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.340832] ? vmacache_find+0x61/0x270 [ 47.344794] ? vmacache_update+0xfe/0x130 [ 47.348923] ? up_read+0x1a/0x40 [ 47.352267] ? __do_page_fault+0x35b/0xb60 [ 47.356481] ? do_vfs_ioctl+0x492/0x1530 [ 47.360527] ? do_page_fault+0xee/0x720 [ 47.364479] ? __do_page_fault+0xb60/0xb60 [ 47.368699] ? putname+0xf3/0x130 [ 47.372135] do_group_exit+0x149/0x400 [ 47.376002] ? lockdep_sys_exit+0x47/0xf0 [ 47.380127] ? SyS_exit+0x30/0x30 [ 47.383565] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.388557] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.393296] SyS_exit_group+0x1d/0x20 [ 47.397073] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.401803] RIP: 0033:0x445129 [ 47.404966] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.412658] RAX: ffffffffffffffda RBX: 831a644b96355b12 RCX: 0000000000445129 [ 47.419906] RDX: 0000000000445129 RSI: 000000002019dfd8 RDI: 0000000000000001 [ 47.427163] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 47.434412] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402780 [ 47.441656] R13: 0000000000402810 R14: 0000000000000000 R15: 0000000000000000 [ 47.448919] [ 47.450521] Allocated by task 2981: [ 47.454133] save_stack_trace+0x16/0x20 [ 47.458082] save_stack+0x43/0xd0 [ 47.461510] kasan_kmalloc+0xad/0xe0 [ 47.465198] __kmalloc_node+0x47/0x70 [ 47.468973] kvmalloc_node+0x64/0xd0 [ 47.472665] alloc_netdev_mqs+0x16e/0xed0 [ 47.476786] __tun_chr_ioctl+0x12be/0x3d20 [ 47.480995] tun_chr_ioctl+0x2a/0x40 [ 47.484683] do_vfs_ioctl+0x1b1/0x1530 [ 47.488543] SyS_ioctl+0x8f/0xc0 [ 47.491889] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.496615] [ 47.498216] Freed by task 2981: [ 47.501479] save_stack_trace+0x16/0x20 [ 47.505430] save_stack+0x43/0xd0 [ 47.508854] kasan_slab_free+0x71/0xc0 [ 47.512721] kfree+0xca/0x250 [ 47.515801] kvfree+0x36/0x60 [ 47.518890] free_netdev+0x2cf/0x360 [ 47.522578] __tun_chr_ioctl+0x2cf6/0x3d20 [ 47.526786] tun_chr_ioctl+0x2a/0x40 [ 47.530475] do_vfs_ioctl+0x1b1/0x1530 [ 47.534333] SyS_ioctl+0x8f/0xc0 [ 47.537685] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.542418] [ 47.544025] The buggy address belongs to the object at ffff8801ce6403c0 [ 47.544025] which belongs to the cache kmalloc-16384 of size 16384 [ 47.557014] The buggy address is located 13312 bytes inside of [ 47.557014] 16384-byte region [ffff8801ce6403c0, ffff8801ce6443c0) [ 47.569232] The buggy address belongs to the page: [ 47.574159] page:ffffea0007399000 count:1 mapcount:0 mapping:ffff8801ce6403c0 index:0x0 compound_mapcount: 0 [ 47.584219] flags: 0x200000000008100(slab|head) [ 47.588886] raw: 0200000000008100 ffff8801ce6403c0 0000000000000000 0000000100000001 [ 47.596755] raw: ffffea0007385820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 47.604627] page dumped because: kasan: bad access detected [ 47.610330] [ 47.611939] Memory state around the buggy address: [ 47.616845] ffff8801ce643680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.624195] ffff8801ce643700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.631528] >ffff8801ce643780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.638860] ^ [ 47.644296] ffff8801ce643800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.651649] ffff8801ce643880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.658990] ================================================================== [ 47.666335] Disabling lock debugging due to kernel taint [ 47.671759] Kernel panic - not syncing: panic_on_warn set ... [ 47.671759] [ 47.679110] CPU: 0 PID: 2981 Comm: syzkaller099950 Tainted: G B 4.13.0-next-20170906+ #16 [ 47.688544] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.697894] Call Trace: [ 47.700464] dump_stack+0x194/0x257 [ 47.704067] ? arch_local_irq_restore+0x53/0x53 [ 47.708705] ? vprintk_default+0x28/0x30 [ 47.712742] ? detach_if_pending+0x530/0x610 [ 47.717129] panic+0x1e4/0x417 [ 47.720381] ? __warn+0x1d9/0x1d9 [ 47.723818] ? detach_if_pending+0x557/0x610 [ 47.728197] kasan_end_report+0x50/0x50 [ 47.732137] kasan_report+0x137/0x340 [ 47.735905] __asan_report_store8_noabort+0x17/0x20 [ 47.740895] detach_if_pending+0x557/0x610 [ 47.745100] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.750261] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.754895] ? lock_timer_base+0x1a3/0x2b0 [ 47.759098] ? lock_timer_base+0x1eb/0x2b0 [ 47.763302] ? __internal_add_timer+0x2d0/0x2d0 [ 47.767949] ? trace_hardirqs_on+0xd/0x10 [ 47.772080] try_to_del_timer_sync+0xa2/0x120 [ 47.776558] ? del_timer+0x130/0x130 [ 47.780339] ? del_timer_sync+0xeb/0x240 [ 47.784369] del_timer_sync+0x18a/0x240 [ 47.788311] tun_free_netdev+0x105/0x1b0 [ 47.792337] ? tun_xdp+0x410/0x410 [ 47.795844] ? cpumask_next+0x24/0x30 [ 47.799627] ? netdev_refcnt_read+0xed/0x150 [ 47.804199] ? tun_xdp+0x410/0x410 [ 47.807726] netdev_run_todo+0x870/0xca0 [ 47.811774] ? do_group_exit+0x149/0x400 [ 47.815817] ? register_netdev+0x30/0x30 [ 47.819850] ? lock_downgrade+0x990/0x990 [ 47.823965] ? trace_hardirqs_on+0xd/0x10 [ 47.828110] ? refcount_sub_and_test+0x115/0x1b0 [ 47.832847] ? refcount_inc+0x50/0x50 [ 47.836615] ? refcount_inc+0x50/0x50 [ 47.840388] ? sk_destruct+0x4c/0x80 [ 47.844081] ? __sk_free+0x5c/0x230 [ 47.847685] ? sk_free+0x2f/0x40 [ 47.851029] ? __tun_detach+0x176/0x1390 [ 47.855075] ? tun_attach+0xf90/0xf90 [ 47.858866] ? locks_remove_file+0x3fa/0x5a0 [ 47.863255] ? fcntl_setlk+0x10d0/0x10d0 [ 47.867294] ? __fsnotify_parent+0xb4/0x3a0 [ 47.871584] ? fsnotify+0x1af0/0x1af0 [ 47.875356] ? __tun_detach+0x1390/0x1390 [ 47.879492] ? __tun_detach+0x1390/0x1390 [ 47.883622] rtnl_unlock+0xe/0x10 [ 47.887052] tun_chr_close+0x49/0x60 [ 47.890737] __fput+0x333/0x7f0 [ 47.893986] ? fput+0x140/0x140 [ 47.897247] ? check_same_owner+0x320/0x320 [ 47.901563] ____fput+0x15/0x20 [ 47.904819] task_work_run+0x199/0x270 [ 47.908674] ? task_work_cancel+0x210/0x210 [ 47.912979] ? free_nsproxy+0x185/0x1f0 [ 47.916924] ? switch_task_namespaces+0xa2/0xc0 [ 47.922012] do_exit+0xa52/0x1b40 [ 47.925434] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.930435] ? check_noncircular+0x20/0x20 [ 47.934666] ? mm_update_next_owner+0x930/0x930 [ 47.939309] ? __pmd_alloc+0x4e0/0x4e0 [ 47.943183] ? find_held_lock+0x39/0x1d0 [ 47.947246] ? lock_downgrade+0x990/0x990 [ 47.951382] ? handle_mm_fault+0x4a2/0x860 [ 47.955586] ? down_read_trylock+0xdb/0x170 [ 47.959907] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.964460] ? vmacache_find+0x61/0x270 [ 47.968402] ? vmacache_update+0xfe/0x130 [ 47.972534] ? up_read+0x1a/0x40 [ 47.975890] ? __do_page_fault+0x35b/0xb60 [ 47.980100] ? do_vfs_ioctl+0x492/0x1530 [ 47.984145] ? do_page_fault+0xee/0x720 [ 47.988091] ? __do_page_fault+0xb60/0xb60 [ 47.992297] ? putname+0xf3/0x130 [ 47.995726] do_group_exit+0x149/0x400 [ 47.999597] ? lockdep_sys_exit+0x47/0xf0 [ 48.003724] ? SyS_exit+0x30/0x30 [ 48.007158] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.012147] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 48.016880] SyS_exit_group+0x1d/0x20 [ 48.020674] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.025397] RIP: 0033:0x445129 [ 48.028567] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7