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-mmots-kasan-gce-2,10.128.0.53' (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.322398] ================================================================== [ 45.329860] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.336587] Write of size 8 at addr ffff8801cea3b740 by task syzkaller406252/2984 [ 45.344177] [ 45.345781] CPU: 0 PID: 2984 Comm: syzkaller406252 Not tainted 4.13.0-mm1+ #7 [ 45.353023] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.362350] Call Trace: [ 45.364914] dump_stack+0x194/0x257 [ 45.368519] ? arch_local_irq_restore+0x53/0x53 [ 45.373160] ? show_regs_print_info+0x65/0x65 [ 45.377634] ? lock_timer_base+0x1a3/0x2b0 [ 45.381844] ? detach_if_pending+0x557/0x610 [ 45.386227] print_address_description+0x73/0x250 [ 45.391044] ? detach_if_pending+0x557/0x610 [ 45.395427] kasan_report+0x24e/0x340 [ 45.399204] __asan_report_store8_noabort+0x17/0x20 [ 45.404192] detach_if_pending+0x557/0x610 [ 45.408400] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.413567] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.418206] ? lock_timer_base+0x1a3/0x2b0 [ 45.422412] ? lock_timer_base+0x1eb/0x2b0 [ 45.426624] ? __internal_add_timer+0x2d0/0x2d0 [ 45.431269] ? trace_hardirqs_on+0xd/0x10 [ 45.435395] try_to_del_timer_sync+0xa2/0x120 [ 45.439862] ? del_timer+0x130/0x130 [ 45.443550] ? del_timer_sync+0xeb/0x240 [ 45.447589] del_timer_sync+0x18a/0x240 [ 45.451540] tun_free_netdev+0x105/0x1b0 [ 45.455572] ? tun_xdp+0x410/0x410 [ 45.459083] ? cpumask_next+0x24/0x30 [ 45.462855] ? netdev_refcnt_read+0xed/0x150 [ 45.467236] ? tun_xdp+0x410/0x410 [ 45.470752] netdev_run_todo+0x870/0xca0 [ 45.474783] ? do_group_exit+0x149/0x400 [ 45.478820] ? register_netdev+0x30/0x30 [ 45.482857] ? do_raw_spin_trylock+0x190/0x190 [ 45.487425] ? refcount_sub_and_test+0x115/0x1b0 [ 45.492152] ? refcount_inc+0x50/0x50 [ 45.495924] ? refcount_inc+0x50/0x50 [ 45.499701] ? sk_destruct+0x4c/0x80 [ 45.503383] ? __sk_free+0x5c/0x230 [ 45.506980] ? sk_free+0x2f/0x40 [ 45.510317] ? __tun_detach+0x176/0x1390 [ 45.514369] ? tun_attach+0xf90/0xf90 [ 45.518151] ? locks_remove_file+0x3fa/0x5a0 [ 45.522532] ? fcntl_setlk+0x10d0/0x10d0 [ 45.526566] ? __fsnotify_parent+0xb4/0x3a0 [ 45.530864] ? fsnotify+0x1af0/0x1af0 [ 45.534639] ? __tun_detach+0x1390/0x1390 [ 45.538756] ? __tun_detach+0x1390/0x1390 [ 45.542876] rtnl_unlock+0xe/0x10 [ 45.546306] tun_chr_close+0x49/0x60 [ 45.549992] __fput+0x333/0x7f0 [ 45.553247] ? fput+0x140/0x140 [ 45.556499] ? check_same_owner+0x320/0x320 [ 45.560797] ____fput+0x15/0x20 [ 45.564048] task_work_run+0x199/0x270 [ 45.567909] ? task_work_cancel+0x210/0x210 [ 45.572204] ? free_nsproxy+0x185/0x1f0 [ 45.576149] ? switch_task_namespaces+0xa2/0xc0 [ 45.580793] do_exit+0xa52/0x1b40 [ 45.584221] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.589209] ? trace_hardirqs_on+0xd/0x10 [ 45.593337] ? kvfree+0x3b/0x60 [ 45.596595] ? mm_update_next_owner+0x930/0x930 [ 45.601234] ? rtnl_unlock+0xe/0x10 [ 45.604830] ? __tun_chr_ioctl+0x27a/0x3d20 [ 45.609132] ? tun_chr_read_iter+0x1e0/0x1e0 [ 45.613522] ? lock_downgrade+0x990/0x990 [ 45.617669] ? check_same_owner+0x320/0x320 [ 45.621970] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.626524] ? vmacache_find+0x61/0x270 [ 45.630472] ? tun_chr_compat_ioctl+0x30/0x30 [ 45.634936] ? tun_chr_ioctl+0x2a/0x40 [ 45.638791] ? tun_chr_ioctl+0x2a/0x40 [ 45.642654] ? do_vfs_ioctl+0x492/0x1530 [ 45.646708] ? ioctl_preallocate+0x2b0/0x2b0 [ 45.651092] ? selinux_capable+0x40/0x40 [ 45.655125] ? putname+0xf3/0x130 [ 45.658555] do_group_exit+0x149/0x400 [ 45.662417] ? SyS_exit+0x30/0x30 [ 45.665844] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.670833] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.675560] SyS_exit_group+0x1d/0x20 [ 45.679337] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.684061] RIP: 0033:0x4454e9 [ 45.687221] RSP: 002b:00007ffd4b20c368 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 45.694901] RAX: ffffffffffffffda RBX: 00007ffd4b20c3a0 RCX: 00000000004454e9 [ 45.702141] RDX: 00000000004454e9 RSI: 0000000020982fd8 RDI: 0000000000000001 [ 45.709393] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffd4b20c3a0 [ 45.716633] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402830 [ 45.723871] R13: 00000000004028c0 R14: 0000000000000000 R15: 0000000000000000 [ 45.731130] [ 45.732733] Allocated by task 2984: [ 45.736335] save_stack_trace+0x16/0x20 [ 45.740279] save_stack+0x43/0xd0 [ 45.743700] kasan_kmalloc+0xad/0xe0 [ 45.747383] __kmalloc_node+0x47/0x70 [ 45.751152] kvmalloc_node+0x64/0xd0 [ 45.754838] alloc_netdev_mqs+0x16e/0xed0 [ 45.758956] __tun_chr_ioctl+0x12be/0x3d20 [ 45.763171] tun_chr_ioctl+0x2a/0x40 [ 45.766866] do_vfs_ioctl+0x1b1/0x1530 [ 45.770720] SyS_ioctl+0x8f/0xc0 [ 45.774058] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.778777] [ 45.780373] Freed by task 2984: [ 45.783623] save_stack_trace+0x16/0x20 [ 45.787566] save_stack+0x43/0xd0 [ 45.790990] kasan_slab_free+0x71/0xc0 [ 45.794844] kfree+0xca/0x250 [ 45.797920] kvfree+0x36/0x60 [ 45.800995] free_netdev+0x2cf/0x360 [ 45.804676] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.808879] tun_chr_ioctl+0x2a/0x40 [ 45.812564] do_vfs_ioctl+0x1b1/0x1530 [ 45.816422] SyS_ioctl+0x8f/0xc0 [ 45.819761] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.824484] [ 45.826082] The buggy address belongs to the object at ffff8801cea38340 [ 45.826082] which belongs to the cache kmalloc-16384 of size 16384 [ 45.839059] The buggy address is located 13312 bytes inside of [ 45.839059] 16384-byte region [ffff8801cea38340, ffff8801cea3c340) [ 45.851251] The buggy address belongs to the page: [ 45.856150] page:ffffea00073a8e00 count:1 mapcount:0 mapping:ffff8801cea38340 index:0x0 compound_mapcount: 0 [ 45.866095] flags: 0x200000000008100(slab|head) [ 45.870733] raw: 0200000000008100 ffff8801cea38340 0000000000000000 0000000100000001 [ 45.878582] raw: ffffea0007371e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.886428] page dumped because: kasan: bad access detected [ 45.892105] [ 45.893701] Memory state around the buggy address: [ 45.898600] ffff8801cea3b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.905927] ffff8801cea3b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.913256] >ffff8801cea3b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.920583] ^ [ 45.926000] ffff8801cea3b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.933326] ffff8801cea3b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.940654] ================================================================== [ 45.947982] Disabling lock debugging due to kernel taint [ 45.953396] Kernel panic - not syncing: panic_on_warn set ... [ 45.953396] [ 45.960725] CPU: 0 PID: 2984 Comm: syzkaller406252 Tainted: G B 4.13.0-mm1+ #7 [ 45.969177] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.978497] Call Trace: [ 45.981059] dump_stack+0x194/0x257 [ 45.984656] ? arch_local_irq_restore+0x53/0x53 [ 45.989290] ? vprintk_default+0x28/0x30 [ 45.993319] ? detach_if_pending+0x550/0x610 [ 45.997694] panic+0x1e4/0x417 [ 46.000861] ? __warn+0x1d9/0x1d9 [ 46.004286] ? detach_if_pending+0x557/0x610 [ 46.008659] kasan_end_report+0x50/0x50 [ 46.012599] kasan_report+0x137/0x340 [ 46.016365] __asan_report_store8_noabort+0x17/0x20 [ 46.021348] detach_if_pending+0x557/0x610 [ 46.025548] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.030718] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.035351] ? lock_timer_base+0x1a3/0x2b0 [ 46.039589] ? lock_timer_base+0x1eb/0x2b0 [ 46.043791] ? __internal_add_timer+0x2d0/0x2d0 [ 46.048427] ? trace_hardirqs_on+0xd/0x10 [ 46.052545] try_to_del_timer_sync+0xa2/0x120 [ 46.057006] ? del_timer+0x130/0x130 [ 46.060686] ? del_timer_sync+0xeb/0x240 [ 46.064713] del_timer_sync+0x18a/0x240 [ 46.068657] tun_free_netdev+0x105/0x1b0 [ 46.072682] ? tun_xdp+0x410/0x410 [ 46.076190] ? cpumask_next+0x24/0x30 [ 46.079959] ? netdev_refcnt_read+0xed/0x150 [ 46.084337] ? tun_xdp+0x410/0x410 [ 46.087842] netdev_run_todo+0x870/0xca0 [ 46.091868] ? do_group_exit+0x149/0x400 [ 46.095905] ? register_netdev+0x30/0x30 [ 46.099935] ? do_raw_spin_trylock+0x190/0x190 [ 46.104491] ? refcount_sub_and_test+0x115/0x1b0 [ 46.109210] ? refcount_inc+0x50/0x50 [ 46.112973] ? refcount_inc+0x50/0x50 [ 46.116740] ? sk_destruct+0x4c/0x80 [ 46.120419] ? __sk_free+0x5c/0x230 [ 46.124011] ? sk_free+0x2f/0x40 [ 46.127342] ? __tun_detach+0x176/0x1390 [ 46.131375] ? tun_attach+0xf90/0xf90 [ 46.135146] ? locks_remove_file+0x3fa/0x5a0 [ 46.139522] ? fcntl_setlk+0x10d0/0x10d0 [ 46.143551] ? __fsnotify_parent+0xb4/0x3a0 [ 46.147842] ? fsnotify+0x1af0/0x1af0 [ 46.151608] ? __tun_detach+0x1390/0x1390 [ 46.155721] ? __tun_detach+0x1390/0x1390 [ 46.159843] rtnl_unlock+0xe/0x10 [ 46.163260] tun_chr_close+0x49/0x60 [ 46.166937] __fput+0x333/0x7f0 [ 46.170184] ? fput+0x140/0x140 [ 46.173431] ? check_same_owner+0x320/0x320 [ 46.177731] ____fput+0x15/0x20 [ 46.180976] task_work_run+0x199/0x270 [ 46.184829] ? task_work_cancel+0x210/0x210 [ 46.189116] ? free_nsproxy+0x185/0x1f0 [ 46.193057] ? switch_task_namespaces+0xa2/0xc0 [ 46.197693] do_exit+0xa52/0x1b40 [ 46.201115] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.207067] ? trace_hardirqs_on+0xd/0x10 [ 46.211197] ? kvfree+0x3b/0x60 [ 46.214457] ? mm_update_next_owner+0x930/0x930 [ 46.219095] ? rtnl_unlock+0xe/0x10 [ 46.222688] ? __tun_chr_ioctl+0x27a/0x3d20 [ 46.226981] ? tun_chr_read_iter+0x1e0/0x1e0 [ 46.231358] ? lock_downgrade+0x990/0x990 [ 46.235485] ? check_same_owner+0x320/0x320 [ 46.239772] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.244330] ? vmacache_find+0x61/0x270 [ 46.248271] ? tun_chr_compat_ioctl+0x30/0x30 [ 46.252728] ? tun_chr_ioctl+0x2a/0x40 [ 46.256588] ? tun_chr_ioctl+0x2a/0x40 [ 46.260704] ? do_vfs_ioctl+0x492/0x1530 [ 46.264740] ? ioctl_preallocate+0x2b0/0x2b0 [ 46.269118] ? selinux_capable+0x40/0x40 [ 46.273144] ? putname+0xf3/0x130 [ 46.276568] do_group_exit+0x149/0x400 [ 46.280420] ? SyS_exit+0x30/0x30 [ 46.283841] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.288827] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.293553] SyS_exit_group+0x1d/0x20 [ 46.297322] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.302056] RIP: 0033:0x4454e9 [ 46.305211] RSP: 002b:00007ffd4b20c368 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 46.312883] RAX: ffffffffffffffda RBX: 00007ffd4b20c3a0 RCX: 00000000004454e9