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-3,10.128.0.6' (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: [ 59.698365] ================================================================== [ 59.705790] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 59.712518] Write of size 8 at addr ffff8801cf73b780 by task syzkaller285014/2981 [ 59.720122] [ 59.721727] CPU: 0 PID: 2981 Comm: syzkaller285014 Not tainted 4.13.0-next-20170907+ #17 [ 59.729947] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 59.739275] Call Trace: [ 59.741840] dump_stack+0x194/0x257 [ 59.745449] ? arch_local_irq_restore+0x53/0x53 [ 59.750093] ? show_regs_print_info+0x65/0x65 [ 59.754566] ? lock_timer_base+0x1a3/0x2b0 [ 59.758774] ? detach_if_pending+0x557/0x610 [ 59.763161] print_address_description+0x73/0x250 [ 59.767980] ? detach_if_pending+0x557/0x610 [ 59.772364] kasan_report+0x24e/0x340 [ 59.776147] __asan_report_store8_noabort+0x17/0x20 [ 59.781137] detach_if_pending+0x557/0x610 [ 59.785351] ? trace_raw_output_tick_stop+0x130/0x130 [ 59.790519] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 59.795412] ? lock_timer_base+0x1a3/0x2b0 [ 59.799622] ? lock_timer_base+0x1eb/0x2b0 [ 59.803835] ? __internal_add_timer+0x2d0/0x2d0 [ 59.808745] ? trace_hardirqs_on+0xd/0x10 [ 59.812881] try_to_del_timer_sync+0xa2/0x120 [ 59.817357] ? del_timer+0x130/0x130 [ 59.821047] ? del_timer_sync+0xeb/0x240 [ 59.825091] del_timer_sync+0x18a/0x240 [ 59.829042] tun_free_netdev+0x105/0x1b0 [ 59.833081] ? tun_xdp+0x410/0x410 [ 59.836594] ? cpumask_next+0x24/0x30 [ 59.840371] ? netdev_refcnt_read+0xed/0x150 [ 59.844768] ? tun_xdp+0x410/0x410 [ 59.848281] netdev_run_todo+0x870/0xca0 [ 59.852316] ? do_group_exit+0x149/0x400 [ 59.856356] ? register_netdev+0x30/0x30 [ 59.860404] ? lock_downgrade+0x990/0x990 [ 59.864526] ? trace_hardirqs_on+0xd/0x10 [ 59.868675] ? refcount_sub_and_test+0x115/0x1b0 [ 59.873407] ? refcount_inc+0x50/0x50 [ 59.877188] ? refcount_inc+0x50/0x50 [ 59.880981] ? sk_destruct+0x4c/0x80 [ 59.884668] ? __sk_free+0x5c/0x230 [ 59.888277] ? sk_free+0x2f/0x40 [ 59.891618] ? __tun_detach+0x176/0x1390 [ 59.895663] ? tun_attach+0xf90/0xf90 [ 59.899444] ? do_raw_spin_trylock+0x190/0x190 [ 59.904005] ? locks_remove_file+0x3fa/0x5a0 [ 59.908395] ? fcntl_setlk+0x10d0/0x10d0 [ 59.912435] ? __fsnotify_parent+0xb4/0x3a0 [ 59.916733] ? fsnotify+0x1af0/0x1af0 [ 59.920511] ? __tun_detach+0x1390/0x1390 [ 59.924635] ? __tun_detach+0x1390/0x1390 [ 59.928760] rtnl_unlock+0xe/0x10 [ 59.932198] tun_chr_close+0x49/0x60 [ 59.935886] __fput+0x333/0x7f0 [ 59.939145] ? fput+0x140/0x140 [ 59.942404] ? check_same_owner+0x320/0x320 [ 59.946698] ? _raw_spin_unlock_irq+0x27/0x70 [ 59.951171] ____fput+0x15/0x20 [ 59.954427] task_work_run+0x199/0x270 [ 59.958290] ? task_work_cancel+0x210/0x210 [ 59.962585] ? _raw_spin_unlock+0x22/0x30 [ 59.966704] ? switch_task_namespaces+0x87/0xc0 [ 59.971352] do_exit+0xa52/0x1b40 [ 59.974789] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 59.979783] ? check_noncircular+0x20/0x20 [ 59.984001] ? mm_update_next_owner+0x930/0x930 [ 59.988645] ? __pmd_alloc+0x4e0/0x4e0 [ 59.992518] ? find_held_lock+0x39/0x1d0 [ 59.996573] ? lock_downgrade+0x990/0x990 [ 60.000719] ? handle_mm_fault+0x410/0x8d0 [ 60.004925] ? down_read_trylock+0xdb/0x170 [ 60.009223] ? __handle_mm_fault+0x39c0/0x39c0 [ 60.013780] ? vmacache_find+0x61/0x270 [ 60.017739] ? up_read+0x1a/0x40 [ 60.021082] ? __do_page_fault+0x35b/0xb60 [ 60.025300] ? do_vfs_ioctl+0x492/0x1530 [ 60.029350] ? do_page_fault+0xee/0x720 [ 60.033305] ? __do_page_fault+0xb60/0xb60 [ 60.037519] ? putname+0xf3/0x130 [ 60.040957] do_group_exit+0x149/0x400 [ 60.044819] ? lockdep_sys_exit+0x47/0xf0 [ 60.048945] ? SyS_exit+0x30/0x30 [ 60.052373] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 60.057367] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 60.062106] SyS_exit_group+0x1d/0x20 [ 60.065885] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.070614] RIP: 0033:0x443688 [ 60.073775] RSP: 002b:00007ffd02ab56b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 60.081462] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443688 [ 60.088704] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 60.095950] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 60.103195] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 60.110465] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 60.117727] [ 60.119328] Allocated by task 2981: [ 60.122930] save_stack_trace+0x16/0x20 [ 60.126880] save_stack+0x43/0xd0 [ 60.130305] kasan_kmalloc+0xad/0xe0 [ 60.133989] __kmalloc_node+0x47/0x70 [ 60.137768] kvmalloc_node+0x64/0xd0 [ 60.141454] alloc_netdev_mqs+0x16e/0xed0 [ 60.145575] __tun_chr_ioctl+0x12be/0x3d20 [ 60.149779] tun_chr_ioctl+0x2a/0x40 [ 60.153474] do_vfs_ioctl+0x1b1/0x1530 [ 60.157335] SyS_ioctl+0x8f/0xc0 [ 60.160675] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.165402] [ 60.167003] Freed by task 2981: [ 60.170252] save_stack_trace+0x16/0x20 [ 60.174198] save_stack+0x43/0xd0 [ 60.177623] kasan_slab_free+0x71/0xc0 [ 60.181480] kfree+0xca/0x250 [ 60.184566] kvfree+0x36/0x60 [ 60.187645] free_netdev+0x2cf/0x360 [ 60.191335] __tun_chr_ioctl+0x2cf6/0x3d20 [ 60.195541] tun_chr_ioctl+0x2a/0x40 [ 60.199223] do_vfs_ioctl+0x1b1/0x1530 [ 60.203088] SyS_ioctl+0x8f/0xc0 [ 60.206429] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.211153] [ 60.212752] The buggy address belongs to the object at ffff8801cf738380 [ 60.212752] which belongs to the cache kmalloc-16384 of size 16384 [ 60.225725] The buggy address is located 13312 bytes inside of [ 60.225725] 16384-byte region [ffff8801cf738380, ffff8801cf73c380) [ 60.237927] The buggy address belongs to the page: [ 60.242833] page:ffffea00073dce00 count:1 mapcount:0 mapping:ffff8801cf738380 index:0x0 compound_mapcount: 0 [ 60.252781] flags: 0x200000000008100(slab|head) [ 60.257427] raw: 0200000000008100 ffff8801cf738380 0000000000000000 0000000100000001 [ 60.265281] raw: ffffea000735c020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 60.273136] page dumped because: kasan: bad access detected [ 60.278812] [ 60.280411] Memory state around the buggy address: [ 60.285322] ffff8801cf73b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 60.292653] ffff8801cf73b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 60.299982] >ffff8801cf73b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 60.307311] ^ [ 60.310674] ffff8801cf73b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 60.318010] ffff8801cf73b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 60.325338] ================================================================== [ 60.332672] Disabling lock debugging due to kernel taint [ 60.338085] Kernel panic - not syncing: panic_on_warn set ... [ 60.338085] [ 60.345412] CPU: 0 PID: 2981 Comm: syzkaller285014 Tainted: G B 4.13.0-next-20170907+ #17 [ 60.354818] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 60.364135] Call Trace: [ 60.366693] dump_stack+0x194/0x257 [ 60.370286] ? arch_local_irq_restore+0x53/0x53 [ 60.374922] ? vprintk_default+0x28/0x30 [ 60.378951] ? detach_if_pending+0x530/0x610 [ 60.383325] panic+0x1e4/0x417 [ 60.386485] ? __warn+0x1d9/0x1d9 [ 60.389912] ? detach_if_pending+0x557/0x610 [ 60.394292] kasan_end_report+0x50/0x50 [ 60.398231] kasan_report+0x137/0x340 [ 60.401997] __asan_report_store8_noabort+0x17/0x20 [ 60.406985] detach_if_pending+0x557/0x610 [ 60.411195] ? trace_raw_output_tick_stop+0x130/0x130 [ 60.416353] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 60.420985] ? lock_timer_base+0x1a3/0x2b0 [ 60.425185] ? lock_timer_base+0x1eb/0x2b0 [ 60.429390] ? __internal_add_timer+0x2d0/0x2d0 [ 60.434027] ? trace_hardirqs_on+0xd/0x10 [ 60.438147] try_to_del_timer_sync+0xa2/0x120 [ 60.442612] ? del_timer+0x130/0x130 [ 60.446291] ? del_timer_sync+0xeb/0x240 [ 60.450322] del_timer_sync+0x18a/0x240 [ 60.454265] tun_free_netdev+0x105/0x1b0 [ 60.458291] ? tun_xdp+0x410/0x410 [ 60.461795] ? cpumask_next+0x24/0x30 [ 60.465563] ? netdev_refcnt_read+0xed/0x150 [ 60.469939] ? tun_xdp+0x410/0x410 [ 60.473444] netdev_run_todo+0x870/0xca0 [ 60.477471] ? do_group_exit+0x149/0x400 [ 60.481498] ? register_netdev+0x30/0x30 [ 60.485540] ? lock_downgrade+0x990/0x990 [ 60.489655] ? trace_hardirqs_on+0xd/0x10 [ 60.493776] ? refcount_sub_and_test+0x115/0x1b0 [ 60.498499] ? refcount_inc+0x50/0x50 [ 60.502265] ? refcount_inc+0x50/0x50 [ 60.506031] ? sk_destruct+0x4c/0x80 [ 60.509709] ? __sk_free+0x5c/0x230 [ 60.513300] ? sk_free+0x2f/0x40 [ 60.516632] ? __tun_detach+0x176/0x1390 [ 60.520661] ? tun_attach+0xf90/0xf90 [ 60.524431] ? do_raw_spin_trylock+0x190/0x190 [ 60.528983] ? locks_remove_file+0x3fa/0x5a0 [ 60.533358] ? fcntl_setlk+0x10d0/0x10d0 [ 60.537394] ? __fsnotify_parent+0xb4/0x3a0 [ 60.541681] ? fsnotify+0x1af0/0x1af0 [ 60.545451] ? __tun_detach+0x1390/0x1390 [ 60.549566] ? __tun_detach+0x1390/0x1390 [ 60.553677] rtnl_unlock+0xe/0x10 [ 60.557093] tun_chr_close+0x49/0x60 [ 60.560779] __fput+0x333/0x7f0 [ 60.564033] ? fput+0x140/0x140 [ 60.567282] ? check_same_owner+0x320/0x320 [ 60.571570] ? _raw_spin_unlock_irq+0x27/0x70 [ 60.576032] ____fput+0x15/0x20 [ 60.579277] task_work_run+0x199/0x270 [ 60.583130] ? task_work_cancel+0x210/0x210 [ 60.587419] ? _raw_spin_unlock+0x22/0x30 [ 60.591546] ? switch_task_namespaces+0x87/0xc0 [ 60.596183] do_exit+0xa52/0x1b40 [ 60.599607] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 60.604591] ? check_noncircular+0x20/0x20 [ 60.608794] ? mm_update_next_owner+0x930/0x930 [ 60.613430] ? __pmd_alloc+0x4e0/0x4e0 [ 60.617288] ? find_held_lock+0x39/0x1d0 [ 60.621321] ? lock_downgrade+0x990/0x990 [ 60.625444] ? handle_mm_fault+0x410/0x8d0 [ 60.629642] ? down_read_trylock+0xdb/0x170 [ 60.633928] ? __handle_mm_fault+0x39c0/0x39c0 [ 60.638475] ? vmacache_find+0x61/0x270 [ 60.642419] ? up_read+0x1a/0x40 [ 60.645758] ? __do_page_fault+0x35b/0xb60 [ 60.649965] ? do_vfs_ioctl+0x492/0x1530 [ 60.654034] ? do_page_fault+0xee/0x720 [ 60.657974] ? __do_page_fault+0xb60/0xb60 [ 60.662175] ? putname+0xf3/0x130 [ 60.665596] do_group_exit+0x149/0x400 [ 60.669453] ? lockdep_sys_exit+0x47/0xf0 [ 60.673566] ? SyS_exit+0x30/0x30 [ 60.676987] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 60.681977] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 60.686700] SyS_exit_group+0x1d/0x20 [ 60.690469] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.695189] RIP: 0033:0x443688