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-8,10.128.0.46' (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.838582] ================================================================== [ 50.846077] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 50.852813] Write of size 8 at addr ffff8801d0beb7c0 by task syzkaller813234/2988 [ 50.860403] [ 50.862009] CPU: 1 PID: 2988 Comm: syzkaller813234 Not tainted 4.13.0-next-20170907+ #17 [ 50.870217] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.879554] Call Trace: [ 50.882123] dump_stack+0x194/0x257 [ 50.885728] ? arch_local_irq_restore+0x53/0x53 [ 50.890367] ? show_regs_print_info+0x65/0x65 [ 50.894834] ? lock_timer_base+0x1a3/0x2b0 [ 50.899040] ? detach_if_pending+0x557/0x610 [ 50.903435] print_address_description+0x73/0x250 [ 50.908256] ? detach_if_pending+0x557/0x610 [ 50.912636] kasan_report+0x24e/0x340 [ 50.916416] __asan_report_store8_noabort+0x17/0x20 [ 50.921422] detach_if_pending+0x557/0x610 [ 50.925641] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.930807] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.935446] ? lock_timer_base+0x1a3/0x2b0 [ 50.939655] ? lock_timer_base+0x1eb/0x2b0 [ 50.943869] ? __internal_add_timer+0x2d0/0x2d0 [ 50.948513] ? trace_hardirqs_on+0xd/0x10 [ 50.952638] try_to_del_timer_sync+0xa2/0x120 [ 50.957133] ? del_timer+0x130/0x130 [ 50.960830] ? del_timer_sync+0xeb/0x240 [ 50.964871] del_timer_sync+0x18a/0x240 [ 50.968820] tun_free_netdev+0x105/0x1b0 [ 50.972852] ? tun_xdp+0x410/0x410 [ 50.976362] ? cpumask_next+0x24/0x30 [ 50.980136] ? netdev_refcnt_read+0xed/0x150 [ 50.984517] ? tun_xdp+0x410/0x410 [ 50.988028] netdev_run_todo+0x870/0xca0 [ 50.992059] ? do_group_exit+0x149/0x400 [ 50.996097] ? register_netdev+0x30/0x30 [ 51.000132] ? lock_downgrade+0x990/0x990 [ 51.004251] ? trace_hardirqs_on+0xd/0x10 [ 51.008390] ? refcount_sub_and_test+0x115/0x1b0 [ 51.013117] ? refcount_inc+0x50/0x50 [ 51.016887] ? refcount_inc+0x50/0x50 [ 51.020663] ? sk_destruct+0x4c/0x80 [ 51.024345] ? __sk_free+0x5c/0x230 [ 51.027941] ? sk_free+0x2f/0x40 [ 51.031279] ? __tun_detach+0x176/0x1390 [ 51.035321] ? tun_attach+0xf90/0xf90 [ 51.039096] ? do_raw_spin_trylock+0x190/0x190 [ 51.043655] ? locks_remove_file+0x3fa/0x5a0 [ 51.048035] ? fcntl_setlk+0x10d0/0x10d0 [ 51.052069] ? __fsnotify_parent+0xb4/0x3a0 [ 51.056363] ? fsnotify+0x1af0/0x1af0 [ 51.060137] ? __tun_detach+0x1390/0x1390 [ 51.064255] ? __tun_detach+0x1390/0x1390 [ 51.068377] rtnl_unlock+0xe/0x10 [ 51.071800] tun_chr_close+0x49/0x60 [ 51.075486] __fput+0x333/0x7f0 [ 51.078743] ? fput+0x140/0x140 [ 51.081997] ? check_same_owner+0x320/0x320 [ 51.086291] ? _raw_spin_unlock_irq+0x27/0x70 [ 51.090762] ____fput+0x15/0x20 [ 51.094014] task_work_run+0x199/0x270 [ 51.097874] ? task_work_cancel+0x210/0x210 [ 51.102168] ? _raw_spin_unlock+0x22/0x30 [ 51.106299] ? switch_task_namespaces+0x87/0xc0 [ 51.110945] do_exit+0xa52/0x1b40 [ 51.114382] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.119372] ? check_noncircular+0x20/0x20 [ 51.123588] ? mm_update_next_owner+0x930/0x930 [ 51.128228] ? __pmd_alloc+0x4e0/0x4e0 [ 51.132097] ? find_held_lock+0x39/0x1d0 [ 51.136140] ? lock_downgrade+0x990/0x990 [ 51.140279] ? handle_mm_fault+0x410/0x8d0 [ 51.144483] ? down_read_trylock+0xdb/0x170 [ 51.148777] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.153338] ? vmacache_find+0x61/0x270 [ 51.157300] ? up_read+0x1a/0x40 [ 51.160641] ? __do_page_fault+0x35b/0xb60 [ 51.164849] ? do_vfs_ioctl+0x492/0x1530 [ 51.168891] ? do_page_fault+0xee/0x720 [ 51.172839] ? __do_page_fault+0xb60/0xb60 [ 51.177045] ? putname+0xf3/0x130 [ 51.180477] do_group_exit+0x149/0x400 [ 51.184336] ? lockdep_sys_exit+0x47/0xf0 [ 51.188454] ? SyS_exit+0x30/0x30 [ 51.191881] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.196879] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.201609] SyS_exit_group+0x1d/0x20 [ 51.205385] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.210109] RIP: 0033:0x443ab8 [ 51.213269] RSP: 002b:00007ffd56afb6b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 51.220951] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ab8 [ 51.228200] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 51.235440] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 51.242680] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 51.249920] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 51.257177] [ 51.258781] Allocated by task 2988: [ 51.262382] save_stack_trace+0x16/0x20 [ 51.266326] save_stack+0x43/0xd0 [ 51.269748] kasan_kmalloc+0xad/0xe0 [ 51.273430] __kmalloc_node+0x47/0x70 [ 51.277201] kvmalloc_node+0x64/0xd0 [ 51.280888] alloc_netdev_mqs+0x16e/0xed0 [ 51.285005] __tun_chr_ioctl+0x12be/0x3d20 [ 51.289209] tun_chr_ioctl+0x2a/0x40 [ 51.292891] do_vfs_ioctl+0x1b1/0x1530 [ 51.296761] SyS_ioctl+0x8f/0xc0 [ 51.300096] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.304830] [ 51.306429] Freed by task 2988: [ 51.309681] save_stack_trace+0x16/0x20 [ 51.313626] save_stack+0x43/0xd0 [ 51.317050] kasan_slab_free+0x71/0xc0 [ 51.320906] kfree+0xca/0x250 [ 51.323988] kvfree+0x36/0x60 [ 51.327062] free_netdev+0x2cf/0x360 [ 51.330744] __tun_chr_ioctl+0x2cf6/0x3d20 [ 51.334946] tun_chr_ioctl+0x2a/0x40 [ 51.338629] do_vfs_ioctl+0x1b1/0x1530 [ 51.342487] SyS_ioctl+0x8f/0xc0 [ 51.345824] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.350990] [ 51.352591] The buggy address belongs to the object at ffff8801d0be83c0 [ 51.352591] which belongs to the cache kmalloc-16384 of size 16384 [ 51.365564] The buggy address is located 13312 bytes inside of [ 51.365564] 16384-byte region [ffff8801d0be83c0, ffff8801d0bec3c0) [ 51.377751] The buggy address belongs to the page: [ 51.382651] page:ffffea000742fa00 count:1 mapcount:0 mapping:ffff8801d0be83c0 index:0x0 compound_mapcount: 0 [ 51.392594] flags: 0x200000000008100(slab|head) [ 51.397235] raw: 0200000000008100 ffff8801d0be83c0 0000000000000000 0000000100000001 [ 51.405088] raw: ffffea00073ad420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 51.412934] page dumped because: kasan: bad access detected [ 51.418610] [ 51.420206] Memory state around the buggy address: [ 51.425106] ffff8801d0beb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.432444] ffff8801d0beb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.439780] >ffff8801d0beb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.447109] ^ [ 51.452527] ffff8801d0beb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.459853] ffff8801d0beb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.467178] ================================================================== [ 51.474504] Disabling lock debugging due to kernel taint [ 51.479920] Kernel panic - not syncing: panic_on_warn set ... [ 51.479920] [ 51.487247] CPU: 1 PID: 2988 Comm: syzkaller813234 Tainted: G B 4.13.0-next-20170907+ #17 [ 51.496652] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.505970] Call Trace: [ 51.508529] dump_stack+0x194/0x257 [ 51.512123] ? arch_local_irq_restore+0x53/0x53 [ 51.516761] ? vprintk_default+0x28/0x30 [ 51.520808] ? detach_if_pending+0x530/0x610 [ 51.525240] panic+0x1e4/0x417 [ 51.528419] ? __warn+0x1d9/0x1d9 [ 51.531850] ? detach_if_pending+0x557/0x610 [ 51.536242] kasan_end_report+0x50/0x50 [ 51.540181] kasan_report+0x137/0x340 [ 51.543948] __asan_report_store8_noabort+0x17/0x20 [ 51.548928] detach_if_pending+0x557/0x610 [ 51.553129] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.558294] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.562927] ? lock_timer_base+0x1a3/0x2b0 [ 51.567126] ? lock_timer_base+0x1eb/0x2b0 [ 51.571328] ? __internal_add_timer+0x2d0/0x2d0 [ 51.575964] ? trace_hardirqs_on+0xd/0x10 [ 51.580081] try_to_del_timer_sync+0xa2/0x120 [ 51.584550] ? del_timer+0x130/0x130 [ 51.588232] ? del_timer_sync+0xeb/0x240 [ 51.592263] del_timer_sync+0x18a/0x240 [ 51.596204] tun_free_netdev+0x105/0x1b0 [ 51.600229] ? tun_xdp+0x410/0x410 [ 51.603736] ? cpumask_next+0x24/0x30 [ 51.607507] ? netdev_refcnt_read+0xed/0x150 [ 51.611883] ? tun_xdp+0x410/0x410 [ 51.615388] netdev_run_todo+0x870/0xca0 [ 51.619414] ? do_group_exit+0x149/0x400 [ 51.623443] ? register_netdev+0x30/0x30 [ 51.627470] ? lock_downgrade+0x990/0x990 [ 51.631582] ? trace_hardirqs_on+0xd/0x10 [ 51.635709] ? refcount_sub_and_test+0x115/0x1b0 [ 51.640430] ? refcount_inc+0x50/0x50 [ 51.644203] ? refcount_inc+0x50/0x50 [ 51.647971] ? sk_destruct+0x4c/0x80 [ 51.651650] ? __sk_free+0x5c/0x230 [ 51.655242] ? sk_free+0x2f/0x40 [ 51.658574] ? __tun_detach+0x176/0x1390 [ 51.662606] ? tun_attach+0xf90/0xf90 [ 51.666376] ? do_raw_spin_trylock+0x190/0x190 [ 51.670927] ? locks_remove_file+0x3fa/0x5a0 [ 51.675300] ? fcntl_setlk+0x10d0/0x10d0 [ 51.679338] ? __fsnotify_parent+0xb4/0x3a0 [ 51.683631] ? fsnotify+0x1af0/0x1af0 [ 51.687398] ? __tun_detach+0x1390/0x1390 [ 51.691508] ? __tun_detach+0x1390/0x1390 [ 51.695631] rtnl_unlock+0xe/0x10 [ 51.699050] tun_chr_close+0x49/0x60 [ 51.702730] __fput+0x333/0x7f0 [ 51.705978] ? fput+0x140/0x140 [ 51.709226] ? check_same_owner+0x320/0x320 [ 51.713512] ? _raw_spin_unlock_irq+0x27/0x70 [ 51.717976] ____fput+0x15/0x20 [ 51.721221] task_work_run+0x199/0x270 [ 51.725074] ? task_work_cancel+0x210/0x210 [ 51.729361] ? _raw_spin_unlock+0x22/0x30 [ 51.733478] ? switch_task_namespaces+0x87/0xc0 [ 51.738114] do_exit+0xa52/0x1b40 [ 51.741544] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.746527] ? check_noncircular+0x20/0x20 [ 51.750734] ? mm_update_next_owner+0x930/0x930 [ 51.755367] ? __pmd_alloc+0x4e0/0x4e0 [ 51.759224] ? find_held_lock+0x39/0x1d0 [ 51.763255] ? lock_downgrade+0x990/0x990 [ 51.767376] ? handle_mm_fault+0x410/0x8d0 [ 51.771574] ? down_read_trylock+0xdb/0x170 [ 51.775861] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.780410] ? vmacache_find+0x61/0x270 [ 51.784352] ? up_read+0x1a/0x40 [ 51.787688] ? __do_page_fault+0x35b/0xb60 [ 51.791887] ? do_vfs_ioctl+0x492/0x1530 [ 51.795918] ? do_page_fault+0xee/0x720 [ 51.799856] ? __do_page_fault+0xb60/0xb60 [ 51.804055] ? putname+0xf3/0x130 [ 51.807477] do_group_exit+0x149/0x400 [ 51.811329] ? lockdep_sys_exit+0x47/0xf0 [ 51.815440] ? SyS_exit+0x30/0x30 [ 51.818859] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.823840] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.828579] SyS_exit_group+0x1d/0x20 [ 51.832350] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.837079] RIP: 0033:0x443ab8