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.24' (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: [ 45.362430] ================================================================== [ 45.369902] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.376632] Write of size 8 at addr ffff8801ce663780 by task syzkaller555388/2987 [ 45.384218] [ 45.385820] CPU: 1 PID: 2987 Comm: syzkaller555388 Not tainted 4.13.0-next-20170914+ #22 [ 45.394015] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.403339] Call Trace: [ 45.405899] dump_stack+0x194/0x257 [ 45.409502] ? arch_local_irq_restore+0x53/0x53 [ 45.414140] ? show_regs_print_info+0x65/0x65 [ 45.418608] ? lock_timer_base+0x1a3/0x2b0 [ 45.422819] ? detach_if_pending+0x557/0x610 [ 45.427202] print_address_description+0x73/0x250 [ 45.432016] ? detach_if_pending+0x557/0x610 [ 45.436405] kasan_report+0x24e/0x340 [ 45.440178] __asan_report_store8_noabort+0x17/0x20 [ 45.445248] detach_if_pending+0x557/0x610 [ 45.449454] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.454623] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.459259] ? lock_timer_base+0x1a3/0x2b0 [ 45.463464] ? lock_timer_base+0x1eb/0x2b0 [ 45.467672] ? __internal_add_timer+0x2d0/0x2d0 [ 45.472314] ? trace_hardirqs_on+0xd/0x10 [ 45.476439] try_to_del_timer_sync+0xa2/0x120 [ 45.480902] ? del_timer+0x130/0x130 [ 45.484586] ? del_timer_sync+0xeb/0x240 [ 45.488636] del_timer_sync+0x18a/0x240 [ 45.492583] tun_free_netdev+0x105/0x1b0 [ 45.496614] ? tun_xdp+0x410/0x410 [ 45.500123] ? cpumask_next+0x24/0x30 [ 45.503894] ? netdev_refcnt_read+0xed/0x150 [ 45.508276] ? tun_xdp+0x410/0x410 [ 45.511787] netdev_run_todo+0x870/0xca0 [ 45.515819] ? do_group_exit+0x149/0x400 [ 45.519857] ? register_netdev+0x30/0x30 [ 45.523890] ? lock_downgrade+0x990/0x990 [ 45.528009] ? trace_hardirqs_on+0xd/0x10 [ 45.532143] ? refcount_sub_and_test+0x115/0x1b0 [ 45.536868] ? refcount_inc+0x50/0x50 [ 45.540637] ? refcount_inc+0x50/0x50 [ 45.544411] ? sk_destruct+0x4c/0x80 [ 45.548093] ? __sk_free+0x5c/0x230 [ 45.551692] ? sk_free+0x2f/0x40 [ 45.555044] ? __tun_detach+0x176/0x1390 [ 45.559087] ? tun_attach+0xf90/0xf90 [ 45.562868] ? locks_remove_file+0x3fa/0x5a0 [ 45.567248] ? fcntl_setlk+0x10d0/0x10d0 [ 45.571284] ? __fsnotify_parent+0xb4/0x3a0 [ 45.575580] ? fsnotify+0x1af0/0x1af0 [ 45.579355] ? __tun_detach+0x1390/0x1390 [ 45.583472] ? __tun_detach+0x1390/0x1390 [ 45.587590] rtnl_unlock+0xe/0x10 [ 45.591014] tun_chr_close+0x49/0x60 [ 45.594699] __fput+0x333/0x7f0 [ 45.597957] ? fput+0x140/0x140 [ 45.601209] ? check_same_owner+0x320/0x320 [ 45.605506] ____fput+0x15/0x20 [ 45.608756] task_work_run+0x199/0x270 [ 45.612615] ? task_work_cancel+0x210/0x210 [ 45.616908] ? free_nsproxy+0x185/0x1f0 [ 45.620854] ? switch_task_namespaces+0xa2/0xc0 [ 45.625500] do_exit+0xa52/0x1b40 [ 45.628927] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.633913] ? trace_hardirqs_on+0xd/0x10 [ 45.638036] ? kvfree+0x3b/0x60 [ 45.641291] ? mm_update_next_owner+0x930/0x930 [ 45.645928] ? rtnl_unlock+0xe/0x10 [ 45.649526] ? __tun_chr_ioctl+0x27a/0x3d20 [ 45.653828] ? tun_chr_read_iter+0x1e0/0x1e0 [ 45.658217] ? lock_downgrade+0x990/0x990 [ 45.662376] ? check_same_owner+0x320/0x320 [ 45.666669] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.671220] ? vmacache_find+0x61/0x270 [ 45.675165] ? tun_chr_compat_ioctl+0x30/0x30 [ 45.679627] ? tun_chr_ioctl+0x2a/0x40 [ 45.683482] ? tun_chr_ioctl+0x2a/0x40 [ 45.687345] ? do_vfs_ioctl+0x492/0x1530 [ 45.691380] ? ioctl_preallocate+0x2b0/0x2b0 [ 45.695761] ? selinux_capable+0x40/0x40 [ 45.699794] ? putname+0xf3/0x130 [ 45.703225] do_group_exit+0x149/0x400 [ 45.707084] ? SyS_exit+0x30/0x30 [ 45.710510] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.715498] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.720226] SyS_exit_group+0x1d/0x20 [ 45.723999] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.728723] RIP: 0033:0x445599 [ 45.731883] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 45.739563] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445599 [ 45.746803] RDX: 0000000000445599 RSI: 0000000020822000 RDI: 0000000000000001 [ 45.754042] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 45.761282] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bf0 [ 45.768523] R13: 0000000000402c80 R14: 0000000000000000 R15: 0000000000000000 [ 45.775779] [ 45.777377] Allocated by task 2987: [ 45.780974] save_stack_trace+0x16/0x20 [ 45.784920] save_stack+0x43/0xd0 [ 45.788341] kasan_kmalloc+0xad/0xe0 [ 45.792024] __kmalloc_node+0x47/0x70 [ 45.795794] kvmalloc_node+0x64/0xd0 [ 45.799477] alloc_netdev_mqs+0x16e/0xed0 [ 45.803596] __tun_chr_ioctl+0x12be/0x3d20 [ 45.807806] tun_chr_ioctl+0x2a/0x40 [ 45.811489] do_vfs_ioctl+0x1b1/0x1530 [ 45.815343] SyS_ioctl+0x8f/0xc0 [ 45.818680] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.823399] [ 45.824998] Freed by task 2987: [ 45.828243] save_stack_trace+0x16/0x20 [ 45.832184] save_stack+0x43/0xd0 [ 45.835607] kasan_slab_free+0x71/0xc0 [ 45.839464] kfree+0xca/0x250 [ 45.842542] kvfree+0x36/0x60 [ 45.845618] free_netdev+0x2cf/0x360 [ 45.849298] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.853500] tun_chr_ioctl+0x2a/0x40 [ 45.857182] do_vfs_ioctl+0x1b1/0x1530 [ 45.861036] SyS_ioctl+0x8f/0xc0 [ 45.864372] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.869091] [ 45.870895] The buggy address belongs to the object at ffff8801ce660380 [ 45.870895] which belongs to the cache kmalloc-16384 of size 16384 [ 45.883870] The buggy address is located 13312 bytes inside of [ 45.883870] 16384-byte region [ffff8801ce660380, ffff8801ce664380) [ 45.896060] The buggy address belongs to the page: [ 45.900961] page:ffffea0007399800 count:1 mapcount:0 mapping:ffff8801ce660380 index:0x0 compound_mapcount: 0 [ 45.910906] flags: 0x200000000008100(slab|head) [ 45.915545] raw: 0200000000008100 ffff8801ce660380 0000000000000000 0000000100000001 [ 45.923394] raw: ffffea000738bc20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.931241] page dumped because: kasan: bad access detected [ 45.936917] [ 45.938514] Memory state around the buggy address: [ 45.943410] ffff8801ce663680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.950740] ffff8801ce663700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.958071] >ffff8801ce663780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.965396] ^ [ 45.968730] ffff8801ce663800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.976056] ffff8801ce663880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.983383] ================================================================== [ 45.990707] Disabling lock debugging due to kernel taint [ 45.996122] Kernel panic - not syncing: panic_on_warn set ... [ 45.996122] [ 46.003449] CPU: 1 PID: 2987 Comm: syzkaller555388 Tainted: G B 4.13.0-next-20170914+ #22 [ 46.012853] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.022170] Call Trace: [ 46.024729] dump_stack+0x194/0x257 [ 46.028321] ? arch_local_irq_restore+0x53/0x53 [ 46.032959] ? vprintk_default+0x28/0x30 [ 46.036987] ? detach_if_pending+0x4f0/0x610 [ 46.041361] panic+0x1e4/0x417 [ 46.044517] ? __warn+0x1d9/0x1d9 [ 46.047940] ? detach_if_pending+0x557/0x610 [ 46.052314] kasan_end_report+0x50/0x50 [ 46.056254] kasan_report+0x137/0x340 [ 46.060021] __asan_report_store8_noabort+0x17/0x20 [ 46.065001] detach_if_pending+0x557/0x610 [ 46.069201] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.074354] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.078984] ? lock_timer_base+0x1a3/0x2b0 [ 46.083182] ? lock_timer_base+0x1eb/0x2b0 [ 46.087382] ? __internal_add_timer+0x2d0/0x2d0 [ 46.092019] ? trace_hardirqs_on+0xd/0x10 [ 46.096133] try_to_del_timer_sync+0xa2/0x120 [ 46.100592] ? del_timer+0x130/0x130 [ 46.104270] ? del_timer_sync+0xeb/0x240 [ 46.108297] del_timer_sync+0x18a/0x240 [ 46.112239] tun_free_netdev+0x105/0x1b0 [ 46.116269] ? tun_xdp+0x410/0x410 [ 46.119780] ? cpumask_next+0x24/0x30 [ 46.123547] ? netdev_refcnt_read+0xed/0x150 [ 46.127920] ? tun_xdp+0x410/0x410 [ 46.131426] netdev_run_todo+0x870/0xca0 [ 46.135451] ? do_group_exit+0x149/0x400 [ 46.139478] ? register_netdev+0x30/0x30 [ 46.143504] ? lock_downgrade+0x990/0x990 [ 46.147616] ? trace_hardirqs_on+0xd/0x10 [ 46.151740] ? refcount_sub_and_test+0x115/0x1b0 [ 46.156459] ? refcount_inc+0x50/0x50 [ 46.160222] ? refcount_inc+0x50/0x50 [ 46.163991] ? sk_destruct+0x4c/0x80 [ 46.167667] ? __sk_free+0x5c/0x230 [ 46.171260] ? sk_free+0x2f/0x40 [ 46.174591] ? __tun_detach+0x176/0x1390 [ 46.178621] ? tun_attach+0xf90/0xf90 [ 46.182393] ? locks_remove_file+0x3fa/0x5a0 [ 46.186766] ? fcntl_setlk+0x10d0/0x10d0 [ 46.190793] ? __fsnotify_parent+0xb4/0x3a0 [ 46.195081] ? fsnotify+0x1af0/0x1af0 [ 46.198848] ? __tun_detach+0x1390/0x1390 [ 46.202958] ? __tun_detach+0x1390/0x1390 [ 46.207073] rtnl_unlock+0xe/0x10 [ 46.210490] tun_chr_close+0x49/0x60 [ 46.214167] __fput+0x333/0x7f0 [ 46.217414] ? fput+0x140/0x140 [ 46.220657] ? check_same_owner+0x320/0x320 [ 46.224946] ____fput+0x15/0x20 [ 46.228193] task_work_run+0x199/0x270 [ 46.232049] ? task_work_cancel+0x210/0x210 [ 46.236336] ? free_nsproxy+0x185/0x1f0 [ 46.240276] ? switch_task_namespaces+0xa2/0xc0 [ 46.244910] do_exit+0xa52/0x1b40 [ 46.248327] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.253307] ? trace_hardirqs_on+0xd/0x10 [ 46.257424] ? kvfree+0x3b/0x60 [ 46.260670] ? mm_update_next_owner+0x930/0x930 [ 46.265304] ? rtnl_unlock+0xe/0x10 [ 46.268895] ? __tun_chr_ioctl+0x27a/0x3d20 [ 46.273183] ? tun_chr_read_iter+0x1e0/0x1e0 [ 46.277561] ? lock_downgrade+0x990/0x990 [ 46.281698] ? check_same_owner+0x320/0x320 [ 46.285995] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.290554] ? vmacache_find+0x61/0x270 [ 46.294498] ? tun_chr_compat_ioctl+0x30/0x30 [ 46.298962] ? tun_chr_ioctl+0x2a/0x40 [ 46.302813] ? tun_chr_ioctl+0x2a/0x40 [ 46.306666] ? do_vfs_ioctl+0x492/0x1530 [ 46.310703] ? ioctl_preallocate+0x2b0/0x2b0 [ 46.315082] ? selinux_capable+0x40/0x40 [ 46.319110] ? putname+0xf3/0x130 [ 46.322539] do_group_exit+0x149/0x400 [ 46.326395] ? SyS_exit+0x30/0x30 [ 46.329820] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.334811] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.339537] SyS_exit_group+0x1d/0x20 [ 46.343311] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.348031] RIP: 0033:0x445599 [ 46.351188] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.358859] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445599