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-6,10.128.0.9' (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: [ 41.650337] ================================================================== [ 41.657753] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.664487] Write of size 8 at addr ffff8801ce79b7c0 by task syzkaller494527/2982 [ 41.672075] [ 41.673675] CPU: 1 PID: 2982 Comm: syzkaller494527 Not tainted 4.13.0-next-20170906+ #16 [ 41.681874] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.691202] Call Trace: [ 41.693765] dump_stack+0x194/0x257 [ 41.697371] ? arch_local_irq_restore+0x53/0x53 [ 41.702014] ? show_regs_print_info+0x65/0x65 [ 41.706497] ? lock_timer_base+0x1a3/0x2b0 [ 41.710710] ? detach_if_pending+0x557/0x610 [ 41.715103] print_address_description+0x73/0x250 [ 41.719919] ? detach_if_pending+0x557/0x610 [ 41.724305] kasan_report+0x24e/0x340 [ 41.728087] __asan_report_store8_noabort+0x17/0x20 [ 41.733079] detach_if_pending+0x557/0x610 [ 41.737291] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.742475] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.747117] ? lock_timer_base+0x1a3/0x2b0 [ 41.751325] ? lock_timer_base+0x1eb/0x2b0 [ 41.755536] ? __internal_add_timer+0x2d0/0x2d0 [ 41.760179] ? trace_hardirqs_on+0xd/0x10 [ 41.764306] try_to_del_timer_sync+0xa2/0x120 [ 41.768771] ? del_timer+0x130/0x130 [ 41.772458] ? del_timer_sync+0xeb/0x240 [ 41.776500] del_timer_sync+0x18a/0x240 [ 41.780451] tun_free_netdev+0x105/0x1b0 [ 41.784486] ? tun_xdp+0x410/0x410 [ 41.787999] ? cpumask_next+0x24/0x30 [ 41.791776] ? netdev_refcnt_read+0xed/0x150 [ 41.796160] ? tun_xdp+0x410/0x410 [ 41.799671] netdev_run_todo+0x870/0xca0 [ 41.803705] ? do_group_exit+0x149/0x400 [ 41.807744] ? register_netdev+0x30/0x30 [ 41.811779] ? lock_downgrade+0x990/0x990 [ 41.815902] ? trace_hardirqs_on+0xd/0x10 [ 41.820040] ? refcount_sub_and_test+0x115/0x1b0 [ 41.824768] ? refcount_inc+0x50/0x50 [ 41.828541] ? refcount_inc+0x50/0x50 [ 41.832320] ? sk_destruct+0x4c/0x80 [ 41.836005] ? __sk_free+0x5c/0x230 [ 41.839604] ? sk_free+0x2f/0x40 [ 41.842945] ? __tun_detach+0x176/0x1390 [ 41.846992] ? tun_attach+0xf90/0xf90 [ 41.850780] ? locks_remove_file+0x3fa/0x5a0 [ 41.855177] ? fcntl_setlk+0x10d0/0x10d0 [ 41.859218] ? __fsnotify_parent+0xb4/0x3a0 [ 41.863515] ? fsnotify+0x1af0/0x1af0 [ 41.867311] ? __tun_detach+0x1390/0x1390 [ 41.871435] ? __tun_detach+0x1390/0x1390 [ 41.875561] rtnl_unlock+0xe/0x10 [ 41.878984] tun_chr_close+0x49/0x60 [ 41.882673] __fput+0x333/0x7f0 [ 41.885931] ? fput+0x140/0x140 [ 41.889190] ? check_same_owner+0x320/0x320 [ 41.893491] ____fput+0x15/0x20 [ 41.896749] task_work_run+0x199/0x270 [ 41.900620] ? task_work_cancel+0x210/0x210 [ 41.904928] ? free_nsproxy+0x185/0x1f0 [ 41.908894] ? switch_task_namespaces+0xa2/0xc0 [ 41.913552] do_exit+0xa52/0x1b40 [ 41.916984] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.921978] ? trace_hardirqs_on+0xd/0x10 [ 41.926107] ? kvfree+0x3b/0x60 [ 41.929371] ? mm_update_next_owner+0x930/0x930 [ 41.934014] ? rtnl_unlock+0xe/0x10 [ 41.937612] ? __tun_chr_ioctl+0x27a/0x3d20 [ 41.941911] ? unwind_get_return_address+0x84/0xa0 [ 41.946842] ? tun_chr_read_iter+0x1e0/0x1e0 [ 41.951229] ? putname+0xee/0x130 [ 41.954656] ? save_stack+0xa3/0xd0 [ 41.958258] ? save_stack_trace+0x16/0x20 [ 41.962384] ? save_stack+0x43/0xd0 [ 41.965983] ? kasan_slab_free+0x71/0xc0 [ 41.970026] ? kmem_cache_free+0x77/0x280 [ 41.974146] ? putname+0xee/0x130 [ 41.977576] ? __lock_is_held+0xbc/0x140 [ 41.981627] ? check_same_owner+0x320/0x320 [ 41.985936] ? tun_chr_compat_ioctl+0x30/0x30 [ 41.990403] ? tun_chr_ioctl+0x2a/0x40 [ 41.994263] ? tun_chr_ioctl+0x2a/0x40 [ 41.998126] ? do_vfs_ioctl+0x492/0x1530 [ 42.002164] ? ioctl_preallocate+0x2b0/0x2b0 [ 42.006549] ? selinux_capable+0x40/0x40 [ 42.010585] ? putname+0xf3/0x130 [ 42.014017] do_group_exit+0x149/0x400 [ 42.017880] ? SyS_exit+0x30/0x30 [ 42.021305] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.026297] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.031029] SyS_exit_group+0x1d/0x20 [ 42.034802] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.039529] RIP: 0033:0x445209 [ 42.042691] RSP: 002b:00007fffe12eef28 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 42.050372] RAX: ffffffffffffffda RBX: 00007fffe12eef60 RCX: 0000000000445209 [ 42.057613] RDX: 0000000000445209 RSI: 0000000020f6e000 RDI: 0000000000000001 [ 42.064856] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fffe12eef60 [ 42.072101] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004025b0 [ 42.079359] R13: 0000000000402640 R14: 0000000000000000 R15: 0000000000000000 [ 42.086625] [ 42.088226] Allocated by task 2982: [ 42.091828] save_stack_trace+0x16/0x20 [ 42.095775] save_stack+0x43/0xd0 [ 42.099199] kasan_kmalloc+0xad/0xe0 [ 42.102892] __kmalloc_node+0x47/0x70 [ 42.106664] kvmalloc_node+0x64/0xd0 [ 42.110352] alloc_netdev_mqs+0x16e/0xed0 [ 42.114468] __tun_chr_ioctl+0x12be/0x3d20 [ 42.118674] tun_chr_ioctl+0x2a/0x40 [ 42.122359] do_vfs_ioctl+0x1b1/0x1530 [ 42.126219] SyS_ioctl+0x8f/0xc0 [ 42.129557] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.134279] [ 42.135879] Freed by task 2982: [ 42.139142] save_stack_trace+0x16/0x20 [ 42.143468] save_stack+0x43/0xd0 [ 42.146892] kasan_slab_free+0x71/0xc0 [ 42.150749] kfree+0xca/0x250 [ 42.153827] kvfree+0x36/0x60 [ 42.156908] free_netdev+0x2cf/0x360 [ 42.160593] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.164796] tun_chr_ioctl+0x2a/0x40 [ 42.168478] do_vfs_ioctl+0x1b1/0x1530 [ 42.172343] SyS_ioctl+0x8f/0xc0 [ 42.175685] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.180407] [ 42.182007] The buggy address belongs to the object at ffff8801ce7983c0 [ 42.182007] which belongs to the cache kmalloc-16384 of size 16384 [ 42.194989] The buggy address is located 13312 bytes inside of [ 42.194989] 16384-byte region [ffff8801ce7983c0, ffff8801ce79c3c0) [ 42.207180] The buggy address belongs to the page: [ 42.212083] page:ffffea000739e600 count:1 mapcount:0 mapping:ffff8801ce7983c0 index:0x0 compound_mapcount: 0 [ 42.222028] flags: 0x200000000008100(slab|head) [ 42.226669] raw: 0200000000008100 ffff8801ce7983c0 0000000000000000 0000000100000001 [ 42.234524] raw: ffffea0007386220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.242375] page dumped because: kasan: bad access detected [ 42.248055] [ 42.249654] Memory state around the buggy address: [ 42.254551] ffff8801ce79b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.261881] ffff8801ce79b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.269210] >ffff8801ce79b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.276539] ^ [ 42.281976] ffff8801ce79b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.289306] ffff8801ce79b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.296634] ================================================================== [ 42.303961] Disabling lock debugging due to kernel taint [ 42.309375] Kernel panic - not syncing: panic_on_warn set ... [ 42.309375] [ 42.316702] CPU: 1 PID: 2982 Comm: syzkaller494527 Tainted: G B 4.13.0-next-20170906+ #16 [ 42.326108] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.335426] Call Trace: [ 42.337994] dump_stack+0x194/0x257 [ 42.341600] ? arch_local_irq_restore+0x53/0x53 [ 42.346238] ? vprintk_default+0x28/0x30 [ 42.350268] ? detach_if_pending+0x530/0x610 [ 42.354642] panic+0x1e4/0x417 [ 42.357801] ? __warn+0x1d9/0x1d9 [ 42.361232] ? detach_if_pending+0x557/0x610 [ 42.365608] kasan_end_report+0x50/0x50 [ 42.369548] kasan_report+0x137/0x340 [ 42.373317] __asan_report_store8_noabort+0x17/0x20 [ 42.378311] detach_if_pending+0x557/0x610 [ 42.382515] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.387679] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.392320] ? lock_timer_base+0x1a3/0x2b0 [ 42.396519] ? lock_timer_base+0x1eb/0x2b0 [ 42.400722] ? __internal_add_timer+0x2d0/0x2d0 [ 42.405358] ? trace_hardirqs_on+0xd/0x10 [ 42.409477] try_to_del_timer_sync+0xa2/0x120 [ 42.413937] ? del_timer+0x130/0x130 [ 42.417617] ? del_timer_sync+0xeb/0x240 [ 42.421647] del_timer_sync+0x18a/0x240 [ 42.425589] tun_free_netdev+0x105/0x1b0 [ 42.429617] ? tun_xdp+0x410/0x410 [ 42.433123] ? cpumask_next+0x24/0x30 [ 42.436892] ? netdev_refcnt_read+0xed/0x150 [ 42.441267] ? tun_xdp+0x410/0x410 [ 42.444783] netdev_run_todo+0x870/0xca0 [ 42.448808] ? do_group_exit+0x149/0x400 [ 42.452846] ? register_netdev+0x30/0x30 [ 42.456880] ? lock_downgrade+0x990/0x990 [ 42.460997] ? trace_hardirqs_on+0xd/0x10 [ 42.465122] ? refcount_sub_and_test+0x115/0x1b0 [ 42.469854] ? refcount_inc+0x50/0x50 [ 42.473624] ? refcount_inc+0x50/0x50 [ 42.477393] ? sk_destruct+0x4c/0x80 [ 42.481080] ? __sk_free+0x5c/0x230 [ 42.484674] ? sk_free+0x2f/0x40 [ 42.488022] ? __tun_detach+0x176/0x1390 [ 42.492056] ? tun_attach+0xf90/0xf90 [ 42.495830] ? locks_remove_file+0x3fa/0x5a0 [ 42.500205] ? fcntl_setlk+0x10d0/0x10d0 [ 42.504236] ? __fsnotify_parent+0xb4/0x3a0 [ 42.508526] ? fsnotify+0x1af0/0x1af0 [ 42.512301] ? __tun_detach+0x1390/0x1390 [ 42.516417] ? __tun_detach+0x1390/0x1390 [ 42.520534] rtnl_unlock+0xe/0x10 [ 42.523957] tun_chr_close+0x49/0x60 [ 42.527637] __fput+0x333/0x7f0 [ 42.530887] ? fput+0x140/0x140 [ 42.534137] ? check_same_owner+0x320/0x320 [ 42.538428] ____fput+0x15/0x20 [ 42.541683] task_work_run+0x199/0x270 [ 42.545540] ? task_work_cancel+0x210/0x210 [ 42.549829] ? free_nsproxy+0x185/0x1f0 [ 42.553771] ? switch_task_namespaces+0xa2/0xc0 [ 42.558410] do_exit+0xa52/0x1b40 [ 42.561837] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.566820] ? trace_hardirqs_on+0xd/0x10 [ 42.570940] ? kvfree+0x3b/0x60 [ 42.574187] ? mm_update_next_owner+0x930/0x930 [ 42.578821] ? rtnl_unlock+0xe/0x10 [ 42.582416] ? __tun_chr_ioctl+0x27a/0x3d20 [ 42.586706] ? unwind_get_return_address+0x84/0xa0 [ 42.591615] ? tun_chr_read_iter+0x1e0/0x1e0 [ 42.595991] ? putname+0xee/0x130 [ 42.599411] ? save_stack+0xa3/0xd0 [ 42.603005] ? save_stack_trace+0x16/0x20 [ 42.607291] ? save_stack+0x43/0xd0 [ 42.610885] ? kasan_slab_free+0x71/0xc0 [ 42.614911] ? kmem_cache_free+0x77/0x280 [ 42.619024] ? putname+0xee/0x130 [ 42.622448] ? __lock_is_held+0xbc/0x140 [ 42.626486] ? check_same_owner+0x320/0x320 [ 42.630777] ? tun_chr_compat_ioctl+0x30/0x30 [ 42.635236] ? tun_chr_ioctl+0x2a/0x40 [ 42.639088] ? tun_chr_ioctl+0x2a/0x40 [ 42.642944] ? do_vfs_ioctl+0x492/0x1530 [ 42.646974] ? ioctl_preallocate+0x2b0/0x2b0