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-kasan-gce-6,10.128.15.227' (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: [ 54.856581] ================================================================== [ 54.857696] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 54.858627] Write of size 8 at addr ffff8801bf57b7c0 by task syzkaller857498/2984 [ 54.859660] [ 54.859909] CPU: 0 PID: 2984 Comm: syzkaller857498 Not tainted 4.14.0-rc4+ #128 [ 54.860912] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 54.862148] Call Trace: [ 54.862571] dump_stack+0x194/0x257 [ 54.863133] ? arch_local_irq_restore+0x53/0x53 [ 54.863799] ? show_regs_print_info+0x65/0x65 [ 54.864404] ? lock_timer_base+0x1a3/0x2b0 [ 54.865050] ? detach_if_pending+0x557/0x610 [ 54.865645] print_address_description+0x73/0x250 [ 54.866306] ? detach_if_pending+0x557/0x610 [ 54.866901] kasan_report+0x25b/0x340 [ 54.867443] __asan_report_store8_noabort+0x17/0x20 [ 54.868154] detach_if_pending+0x557/0x610 [ 54.868727] ? trace_raw_output_tick_stop+0x130/0x130 [ 54.869421] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 54.870064] ? lock_timer_base+0x1a3/0x2b0 [ 54.870634] ? lock_timer_base+0x1eb/0x2b0 [ 54.871208] ? __internal_add_timer+0x2d0/0x2d0 [ 54.871852] ? trace_hardirqs_on+0xd/0x10 [ 54.872421] try_to_del_timer_sync+0xa2/0x120 [ 54.873042] ? del_timer+0x130/0x130 [ 54.873548] ? del_timer_sync+0xeb/0x240 [ 54.874104] del_timer_sync+0x18a/0x240 [ 54.874646] tun_free_netdev+0x105/0x1b0 [ 54.875249] ? tun_xdp+0x410/0x410 [ 54.875728] ? cpumask_next+0x24/0x30 [ 54.876245] ? netdev_refcnt_read+0xed/0x150 [ 54.877474] ? tun_xdp+0x410/0x410 [ 54.880985] netdev_run_todo+0x870/0xca0 [ 54.885019] ? do_group_exit+0x149/0x400 [ 54.889056] ? register_netdev+0x30/0x30 [ 54.893090] ? lock_downgrade+0x990/0x990 [ 54.897210] ? trace_hardirqs_on+0xd/0x10 [ 54.901348] ? refcount_sub_and_test+0x115/0x1b0 [ 54.906082] ? refcount_inc+0x50/0x50 [ 54.909868] ? refcount_inc+0x50/0x50 [ 54.913643] ? sk_destruct+0x4c/0x80 [ 54.917327] ? __sk_free+0x5c/0x230 [ 54.920928] ? sk_free+0x2f/0x40 [ 54.924266] ? __tun_detach+0x176/0x1390 [ 54.928307] ? tun_attach+0xf90/0xf90 [ 54.932088] ? locks_remove_file+0x3fa/0x5a0 [ 54.936471] ? fcntl_setlk+0x10d0/0x10d0 [ 54.940505] ? __fsnotify_parent+0xb4/0x3a0 [ 54.944801] ? fsnotify+0x1af0/0x1af0 [ 54.948579] ? __tun_detach+0x1390/0x1390 [ 54.952698] rtnl_unlock+0xe/0x10 [ 54.956123] tun_chr_close+0x49/0x60 [ 54.959807] __fput+0x333/0x7f0 [ 54.963063] ? fput+0x140/0x140 [ 54.966316] ? check_same_owner+0x320/0x320 [ 54.970614] ____fput+0x15/0x20 [ 54.973864] task_work_run+0x199/0x270 [ 54.977724] ? task_work_cancel+0x210/0x210 [ 54.982017] ? free_nsproxy+0x185/0x1f0 [ 54.985962] ? switch_task_namespaces+0xa2/0xc0 [ 54.990604] do_exit+0x9d2/0x1af0 [ 54.994029] ? kvfree+0x3b/0x60 [ 54.997286] ? mm_update_next_owner+0x930/0x930 [ 55.001925] ? rtnl_unlock+0xe/0x10 [ 55.005522] ? __tun_chr_ioctl+0x27a/0x3d20 [ 55.009813] ? sched_set_itmt_core_prio+0x1b4/0x1d0 [ 55.014809] ? tun_chr_read_iter+0x1e0/0x1e0 [ 55.019190] ? putname+0xee/0x130 [ 55.022614] ? save_stack+0xa3/0xd0 [ 55.026212] ? save_stack_trace+0x16/0x20 [ 55.030328] ? save_stack+0x43/0xd0 [ 55.033922] ? kasan_slab_free+0x71/0xc0 [ 55.037963] ? kmem_cache_free+0x77/0x280 [ 55.042080] ? putname+0xee/0x130 [ 55.045511] ? __lock_is_held+0xbc/0x140 [ 55.049559] ? check_same_owner+0x320/0x320 [ 55.053858] ? tun_chr_compat_ioctl+0x30/0x30 [ 55.058326] ? tun_chr_ioctl+0x2a/0x40 [ 55.062188] ? tun_chr_ioctl+0x2a/0x40 [ 55.066047] ? do_vfs_ioctl+0x492/0x1530 [ 55.070085] ? ioctl_preallocate+0x2b0/0x2b0 [ 55.074467] ? selinux_capable+0x40/0x40 [ 55.078501] ? putname+0xf3/0x130 [ 55.081934] do_group_exit+0x149/0x400 [ 55.085793] ? SyS_exit+0x30/0x30 [ 55.089238] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 55.094225] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 55.098954] SyS_exit_group+0x1d/0x20 [ 55.102728] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 55.107452] RIP: 0033:0x445669 [ 55.110613] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 55.118292] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445669 [ 55.125531] RDX: 0000000000445669 RSI: 0000000020511fd8 RDI: 0000000000000001 [ 55.132775] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 55.140029] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402cc0 [ 55.147274] R13: 0000000000402d50 R14: 0000000000000000 R15: 0000000000000000 [ 55.154537] [ 55.156137] Allocated by task 2984: [ 55.159740] save_stack_trace+0x16/0x20 [ 55.163684] save_stack+0x43/0xd0 [ 55.167105] kasan_kmalloc+0xad/0xe0 [ 55.170788] __kmalloc_node+0x47/0x70 [ 55.174560] kvmalloc_node+0x64/0xd0 [ 55.178243] alloc_netdev_mqs+0x16e/0xed0 [ 55.182360] __tun_chr_ioctl+0x12be/0x3d20 [ 55.186566] tun_chr_ioctl+0x2a/0x40 [ 55.190249] do_vfs_ioctl+0x1b1/0x1530 [ 55.194103] SyS_ioctl+0x8f/0xc0 [ 55.197439] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 55.202160] [ 55.203758] Freed by task 2984: [ 55.207008] save_stack_trace+0x16/0x20 [ 55.210953] save_stack+0x43/0xd0 [ 55.214374] kasan_slab_free+0x71/0xc0 [ 55.218232] kfree+0xca/0x250 [ 55.221308] kvfree+0x36/0x60 [ 55.224385] free_netdev+0x2cf/0x360 [ 55.228065] __tun_chr_ioctl+0x2cf6/0x3d20 [ 55.232269] tun_chr_ioctl+0x2a/0x40 [ 55.235952] do_vfs_ioctl+0x1b1/0x1530 [ 55.239809] SyS_ioctl+0x8f/0xc0 [ 55.243144] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 55.247869] [ 55.249466] The buggy address belongs to the object at ffff8801bf5783c0 [ 55.249466] which belongs to the cache kmalloc-16384 of size 16384 [ 55.262438] The buggy address is located 13312 bytes inside of [ 55.262438] 16384-byte region [ffff8801bf5783c0, ffff8801bf57c3c0) [ 55.274626] The buggy address belongs to the page: [ 55.279524] page:ffffea0006fd5e00 count:1 mapcount:0 mapping:ffff8801bf5783c0 index:0x0 compound_mapcount: 0 [ 55.289468] flags: 0x200000000008100(slab|head) [ 55.294110] raw: 0200000000008100 ffff8801bf5783c0 0000000000000000 0000000100000001 [ 55.302134] raw: ffffea000738aa20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 55.309993] page dumped because: kasan: bad access detected [ 55.315671] [ 55.317458] Memory state around the buggy address: [ 55.322356] ffff8801bf57b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 55.329682] ffff8801bf57b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 55.337013] >ffff8801bf57b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 55.344341] ^ [ 55.349760] ffff8801bf57b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 55.357202] ffff8801bf57b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 55.364551] ================================================================== [ 55.371883] Disabling lock debugging due to kernel taint [ 55.377299] Kernel panic - not syncing: panic_on_warn set ... [ 55.377299] [ 55.384628] CPU: 0 PID: 2984 Comm: syzkaller857498 Tainted: G B 4.14.0-rc4+ #128 [ 55.393252] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 55.402582] Call Trace: [ 55.405147] dump_stack+0x194/0x257 [ 55.408742] ? arch_local_irq_restore+0x53/0x53 [ 55.413377] ? vprintk_default+0x28/0x30 [ 55.417408] ? detach_if_pending+0x540/0x610 [ 55.421784] panic+0x1e4/0x417 [ 55.424942] ? __warn+0x1d9/0x1d9 [ 55.428366] ? detach_if_pending+0x557/0x610 [ 55.432739] kasan_end_report+0x50/0x50 [ 55.436678] kasan_report+0x144/0x340 [ 55.440446] __asan_report_store8_noabort+0x17/0x20 [ 55.445425] detach_if_pending+0x557/0x610 [ 55.449627] ? trace_raw_output_tick_stop+0x130/0x130 [ 55.454785] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 55.459416] ? lock_timer_base+0x1a3/0x2b0 [ 55.463614] ? lock_timer_base+0x1eb/0x2b0 [ 55.467820] ? __internal_add_timer+0x2d0/0x2d0 [ 55.472456] ? trace_hardirqs_on+0xd/0x10 [ 55.476573] try_to_del_timer_sync+0xa2/0x120 [ 55.481034] ? del_timer+0x130/0x130 [ 55.484716] ? del_timer_sync+0xeb/0x240 [ 55.488756] del_timer_sync+0x18a/0x240 [ 55.492698] tun_free_netdev+0x105/0x1b0 [ 55.496726] ? tun_xdp+0x410/0x410 [ 55.500232] ? cpumask_next+0x24/0x30 [ 55.504000] ? netdev_refcnt_read+0xed/0x150 [ 55.508375] ? tun_xdp+0x410/0x410 [ 55.511882] netdev_run_todo+0x870/0xca0 [ 55.515908] ? do_group_exit+0x149/0x400 [ 55.519937] ? register_netdev+0x30/0x30 [ 55.523966] ? lock_downgrade+0x990/0x990 [ 55.528081] ? trace_hardirqs_on+0xd/0x10 [ 55.532203] ? refcount_sub_and_test+0x115/0x1b0 [ 55.536923] ? refcount_inc+0x50/0x50 [ 55.540690] ? refcount_inc+0x50/0x50 [ 55.544457] ? sk_destruct+0x4c/0x80 [ 55.548132] ? __sk_free+0x5c/0x230 [ 55.551725] ? sk_free+0x2f/0x40 [ 55.555056] ? __tun_detach+0x176/0x1390 [ 55.559086] ? tun_attach+0xf90/0xf90 [ 55.562869] ? locks_remove_file+0x3fa/0x5a0 [ 55.567244] ? fcntl_setlk+0x10d0/0x10d0 [ 55.571272] ? __fsnotify_parent+0xb4/0x3a0 [ 55.575562] ? fsnotify+0x1af0/0x1af0 [ 55.579332] ? __tun_detach+0x1390/0x1390 [ 55.583449] rtnl_unlock+0xe/0x10 [ 55.586866] tun_chr_close+0x49/0x60 [ 55.590546] __fput+0x333/0x7f0 [ 55.593795] ? fput+0x140/0x140 [ 55.597042] ? check_same_owner+0x320/0x320 [ 55.601331] ____fput+0x15/0x20 [ 55.604575] task_work_run+0x199/0x270 [ 55.608431] ? task_work_cancel+0x210/0x210 [ 55.612716] ? free_nsproxy+0x185/0x1f0 [ 55.616655] ? switch_task_namespaces+0xa2/0xc0 [ 55.621289] do_exit+0x9d2/0x1af0 [ 55.624732] ? kvfree+0x3b/0x60 [ 55.627984] ? mm_update_next_owner+0x930/0x930 [ 55.632618] ? rtnl_unlock+0xe/0x10 [ 55.636209] ? __tun_chr_ioctl+0x27a/0x3d20 [ 55.640494] ? sched_set_itmt_core_prio+0x1b4/0x1d0 [ 55.645480] ? tun_chr_read_iter+0x1e0/0x1e0 [ 55.649855] ? putname+0xee/0x130 [ 55.653273] ? save_stack+0xa3/0xd0 [ 55.656865] ? save_stack_trace+0x16/0x20 [ 55.660978] ? save_stack+0x43/0xd0 [ 55.664567] ? kasan_slab_free+0x71/0xc0 [ 55.668595] ? kmem_cache_free+0x77/0x280 [ 55.672715] ? putname+0xee/0x130 [ 55.676138] ? __lock_is_held+0xbc/0x140 [ 55.680172] ? check_same_owner+0x320/0x320 [ 55.684460] ? tun_chr_compat_ioctl+0x30/0x30 [ 55.688920] ? tun_chr_ioctl+0x2a/0x40 [ 55.692771] ? tun_chr_ioctl+0x2a/0x40 [ 55.696626] ? do_vfs_ioctl+0x492/0x1530 [ 55.700655] ? ioctl_preallocate+0x2b0/0x2b0 [ 55.705029] ? selinux_capable+0x40/0x40 [ 55.709055] ? putname+0xf3/0x130 [ 55.712476] do_group_exit+0x149/0x400 [ 55.716329] ? SyS_exit+0x30/0x30 [ 55.719754] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 55.724735] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 55.729455] SyS_exit_group+0x1d/0x20 [ 55.733230] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 55.737950] RIP: 0033:0x445669 [ 55.741105] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 55.748776] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445669 [ 55.756011] RDX: 0000000000445669 RSI: 0000000020511fd8 RDI: 0000000000000001 [ 55.763257] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 55.770501] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402cc0 [ 55.777749] R13: 0000000000402d50 R14: 0000000000000000 R15: 0000000000000000