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-4,10.128.0.19' (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: [ 48.278435] ================================================================== [ 48.279514] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 48.280400] Write of size 8 at addr ffff8801d1ac3678 by task syzkaller743322/2977 [ 48.281398] [ 48.281628] CPU: 0 PID: 2977 Comm: syzkaller743322 Not tainted 4.14.0-rc5+ #135 [ 48.282639] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 48.283871] Call Trace: [ 48.284249] dump_stack+0x194/0x257 [ 48.284758] ? arch_local_irq_restore+0x53/0x53 [ 48.285378] ? show_regs_print_info+0x65/0x65 [ 48.285978] ? lock_timer_base+0x1a3/0x2b0 [ 48.286561] ? detach_if_pending+0x557/0x610 [ 48.287150] print_address_description+0x73/0x250 [ 48.287793] ? detach_if_pending+0x557/0x610 [ 48.288381] kasan_report+0x25b/0x340 [ 48.288911] __asan_report_store8_noabort+0x17/0x20 [ 48.289591] detach_if_pending+0x557/0x610 [ 48.290159] ? trace_raw_output_tick_stop+0x130/0x130 [ 48.290863] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 48.291481] ? lock_timer_base+0x1a3/0x2b0 [ 48.292050] ? lock_timer_base+0x1eb/0x2b0 [ 48.292622] ? __internal_add_timer+0x2d0/0x2d0 [ 48.293244] ? lock_downgrade+0x990/0x990 [ 48.293798] ? trace_hardirqs_on+0xd/0x10 [ 48.294358] try_to_del_timer_sync+0xa2/0x120 [ 48.294968] ? del_timer+0x130/0x130 [ 48.295468] ? del_timer_sync+0xeb/0x240 [ 48.296019] del_timer_sync+0x18a/0x240 [ 48.296554] tun_free_netdev+0x105/0x1b0 [ 48.297098] ? tun_xdp+0x410/0x410 [ 48.297573] ? cpumask_next+0x24/0x30 [ 48.298087] ? netdev_refcnt_read+0xed/0x150 [ 48.298677] ? tun_xdp+0x410/0x410 [ 48.302181] netdev_run_todo+0x870/0xca0 [ 48.306207] ? do_group_exit+0x149/0x400 [ 48.310234] ? mark_held_locks+0xaf/0x100 [ 48.314348] ? register_netdev+0x30/0x30 [ 48.318377] ? find_held_lock+0x35/0x1d0 [ 48.322416] ? lock_downgrade+0x990/0x990 [ 48.326533] ? refcount_sub_and_test+0x115/0x1b0 [ 48.331253] ? refcount_inc+0x50/0x50 [ 48.335017] ? refcount_inc+0x50/0x50 [ 48.338791] ? sk_destruct+0x4c/0x80 [ 48.342471] ? __sk_free+0x5c/0x230 [ 48.346064] ? sk_free+0x2f/0x40 [ 48.349395] ? __tun_detach+0x176/0x1390 [ 48.353433] ? tun_attach+0xfa0/0xfa0 [ 48.357211] ? locks_remove_file+0x3fa/0x5a0 [ 48.361587] ? fcntl_setlk+0x10c0/0x10c0 [ 48.365615] ? __fsnotify_parent+0xb4/0x3a0 [ 48.369902] ? fsnotify+0x1af0/0x1af0 [ 48.373673] ? __tun_detach+0x1390/0x1390 [ 48.377786] rtnl_unlock+0xe/0x10 [ 48.381202] tun_chr_close+0x49/0x60 [ 48.384882] __fput+0x327/0x7e0 [ 48.388132] ? fput+0x140/0x140 [ 48.391380] ? check_same_owner+0x320/0x320 [ 48.395674] ____fput+0x15/0x20 [ 48.398919] task_work_run+0x199/0x270 [ 48.402773] ? task_work_cancel+0x210/0x210 [ 48.407062] ? free_nsproxy+0x185/0x1f0 [ 48.411002] ? switch_task_namespaces+0xa2/0xc0 [ 48.415639] do_exit+0x9b5/0x1ad0 [ 48.419063] ? kvfree+0x3b/0x60 [ 48.422309] ? mm_update_next_owner+0x930/0x930 [ 48.426945] ? rtnl_unlock+0xe/0x10 [ 48.430537] ? __tun_chr_ioctl+0x27a/0x3d20 [ 48.434835] ? tun_chr_read_iter+0x1e0/0x1e0 [ 48.439207] ? find_held_lock+0x35/0x1d0 [ 48.443240] ? __do_page_fault+0x64c/0xd60 [ 48.447439] ? lock_downgrade+0x990/0x990 [ 48.451559] ? handle_mm_fault+0x410/0x8d0 [ 48.455774] ? check_same_owner+0x320/0x320 [ 48.460058] ? up_read+0x1a/0x40 [ 48.463389] ? __do_page_fault+0x3d6/0xd60 [ 48.467589] ? tun_chr_compat_ioctl+0x30/0x30 [ 48.472047] ? tun_chr_ioctl+0x2a/0x40 [ 48.475897] ? tun_chr_ioctl+0x2a/0x40 [ 48.479753] ? do_vfs_ioctl+0x486/0x1520 [ 48.483783] ? ioctl_preallocate+0x2b0/0x2b0 [ 48.488159] ? selinux_capable+0x40/0x40 [ 48.492186] ? putname+0xf3/0x130 [ 48.495609] do_group_exit+0x149/0x400 [ 48.499464] ? SyS_exit+0x30/0x30 [ 48.502886] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.507867] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 48.512592] SyS_exit_group+0x1d/0x20 [ 48.516359] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.521078] RIP: 0033:0x445479 [ 48.524235] RSP: 002b:00007ffc8842ab48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 48.531907] RAX: ffffffffffffffda RBX: 00007ffc8842ab80 RCX: 0000000000445479 [ 48.539140] RDX: 0000000000445479 RSI: 000000002027afd8 RDI: 0000000000000001 [ 48.546376] RBP: 0000000000000082 R08: 00007ffc8842ab80 R09: 00007ffc8842ab80 [ 48.553611] R10: 00007ffc8842ab80 R11: 0000000000000206 R12: 00000000004027c0 [ 48.560843] R13: 0000000000402850 R14: 0000000000000000 R15: 0000000000000000 [ 48.568093] [ 48.569689] Allocated by task 2977: [ 48.573280] save_stack_trace+0x16/0x20 [ 48.577220] save_stack+0x43/0xd0 [ 48.580635] kasan_kmalloc+0xad/0xe0 [ 48.584310] __kmalloc_node+0x47/0x70 [ 48.588075] kvmalloc_node+0x64/0xd0 [ 48.591752] alloc_netdev_mqs+0x16e/0xed0 [ 48.595864] __tun_chr_ioctl+0x12b2/0x3d20 [ 48.600061] tun_chr_ioctl+0x2a/0x40 [ 48.603736] do_vfs_ioctl+0x1b1/0x1520 [ 48.607585] SyS_ioctl+0x8f/0xc0 [ 48.610915] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.615632] [ 48.617225] Freed by task 2977: [ 48.620471] save_stack_trace+0x16/0x20 [ 48.624406] save_stack+0x43/0xd0 [ 48.627824] kasan_slab_free+0x71/0xc0 [ 48.631676] kfree+0xca/0x250 [ 48.634742] kvfree+0x36/0x60 [ 48.637811] free_netdev+0x2cf/0x360 [ 48.641489] __tun_chr_ioctl+0x2cea/0x3d20 [ 48.645684] tun_chr_ioctl+0x2a/0x40 [ 48.649363] do_vfs_ioctl+0x1b1/0x1520 [ 48.653211] SyS_ioctl+0x8f/0xc0 [ 48.656545] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.661259] [ 48.662851] The buggy address belongs to the object at ffff8801d1ac0340 [ 48.662851] which belongs to the cache kmalloc-16384 of size 16384 [ 48.675818] The buggy address is located 13112 bytes inside of [ 48.675818] 16384-byte region [ffff8801d1ac0340, ffff8801d1ac4340) [ 48.688007] The buggy address belongs to the page: [ 48.692898] page:ffffea000746b000 count:1 mapcount:0 mapping:ffff8801d1ac0340 index:0x0 compound_mapcount: 0 [ 48.702831] flags: 0x200000000008100(slab|head) [ 48.707465] raw: 0200000000008100 ffff8801d1ac0340 0000000000000000 0000000100000001 [ 48.715309] raw: ffffea0007475620 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 48.723151] page dumped because: kasan: bad access detected [ 48.728825] [ 48.730420] Memory state around the buggy address: [ 48.735312] ffff8801d1ac3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 48.742632] ffff8801d1ac3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 48.749953] >ffff8801d1ac3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 48.757274] ^ [ 48.764512] ffff8801d1ac3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 48.771835] ffff8801d1ac3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 48.779155] ================================================================== [ 48.786477] Disabling lock debugging due to kernel taint [ 48.791888] Kernel panic - not syncing: panic_on_warn set ... [ 48.791888] [ 48.799213] CPU: 0 PID: 2977 Comm: syzkaller743322 Tainted: G B 4.14.0-rc5+ #135 [ 48.807834] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 48.817148] Call Trace: [ 48.819704] dump_stack+0x194/0x257 [ 48.823294] ? arch_local_irq_restore+0x53/0x53 [ 48.827927] ? kasan_end_report+0x32/0x50 [ 48.832040] ? lock_downgrade+0x990/0x990 [ 48.836152] ? detach_if_pending+0x510/0x610 [ 48.840525] panic+0x1e4/0x417 [ 48.843681] ? __warn+0x1d9/0x1d9 [ 48.847101] ? detach_if_pending+0x557/0x610 [ 48.851470] kasan_end_report+0x50/0x50 [ 48.855408] kasan_report+0x144/0x340 [ 48.859174] __asan_report_store8_noabort+0x17/0x20 [ 48.864152] detach_if_pending+0x557/0x610 [ 48.868350] ? trace_raw_output_tick_stop+0x130/0x130 [ 48.873503] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 48.878132] ? lock_timer_base+0x1a3/0x2b0 [ 48.882329] ? lock_timer_base+0x1eb/0x2b0 [ 48.886528] ? __internal_add_timer+0x2d0/0x2d0 [ 48.891159] ? lock_downgrade+0x990/0x990 [ 48.895267] ? trace_hardirqs_on+0xd/0x10 [ 48.899381] try_to_del_timer_sync+0xa2/0x120 [ 48.903837] ? del_timer+0x130/0x130 [ 48.907516] ? del_timer_sync+0xeb/0x240 [ 48.911544] del_timer_sync+0x18a/0x240 [ 48.915482] tun_free_netdev+0x105/0x1b0 [ 48.919505] ? tun_xdp+0x410/0x410 [ 48.923009] ? cpumask_next+0x24/0x30 [ 48.926773] ? netdev_refcnt_read+0xed/0x150 [ 48.931147] ? tun_xdp+0x410/0x410 [ 48.934649] netdev_run_todo+0x870/0xca0 [ 48.938672] ? do_group_exit+0x149/0x400 [ 48.942697] ? mark_held_locks+0xaf/0x100 [ 48.946805] ? register_netdev+0x30/0x30 [ 48.950829] ? find_held_lock+0x35/0x1d0 [ 48.954857] ? lock_downgrade+0x990/0x990 [ 48.958972] ? refcount_sub_and_test+0x115/0x1b0 [ 48.963696] ? refcount_inc+0x50/0x50 [ 48.967459] ? refcount_inc+0x50/0x50 [ 48.971224] ? sk_destruct+0x4c/0x80 [ 48.974899] ? __sk_free+0x5c/0x230 [ 48.978487] ? sk_free+0x2f/0x40 [ 48.981818] ? __tun_detach+0x176/0x1390 [ 48.985847] ? tun_attach+0xfa0/0xfa0 [ 48.989614] ? locks_remove_file+0x3fa/0x5a0 [ 48.993986] ? fcntl_setlk+0x10c0/0x10c0 [ 48.998011] ? __fsnotify_parent+0xb4/0x3a0 [ 49.002295] ? fsnotify+0x1af0/0x1af0 [ 49.006063] ? __tun_detach+0x1390/0x1390 [ 49.010173] rtnl_unlock+0xe/0x10 [ 49.013588] tun_chr_close+0x49/0x60 [ 49.017263] __fput+0x327/0x7e0 [ 49.020508] ? fput+0x140/0x140 [ 49.023753] ? check_same_owner+0x320/0x320 [ 49.028039] ____fput+0x15/0x20 [ 49.031282] task_work_run+0x199/0x270 [ 49.035133] ? task_work_cancel+0x210/0x210 [ 49.039418] ? free_nsproxy+0x185/0x1f0 [ 49.043358] ? switch_task_namespaces+0xa2/0xc0 [ 49.047989] do_exit+0x9b5/0x1ad0 [ 49.051405] ? kvfree+0x3b/0x60 [ 49.054648] ? mm_update_next_owner+0x930/0x930 [ 49.059277] ? rtnl_unlock+0xe/0x10 [ 49.062865] ? __tun_chr_ioctl+0x27a/0x3d20 [ 49.067154] ? tun_chr_read_iter+0x1e0/0x1e0 [ 49.071673] ? find_held_lock+0x35/0x1d0 [ 49.075710] ? __do_page_fault+0x64c/0xd60 [ 49.079913] ? lock_downgrade+0x990/0x990 [ 49.084036] ? handle_mm_fault+0x410/0x8d0 [ 49.088246] ? check_same_owner+0x320/0x320 [ 49.092535] ? up_read+0x1a/0x40 [ 49.095866] ? __do_page_fault+0x3d6/0xd60 [ 49.100068] ? tun_chr_compat_ioctl+0x30/0x30 [ 49.104525] ? tun_chr_ioctl+0x2a/0x40 [ 49.108377] ? tun_chr_ioctl+0x2a/0x40 [ 49.112230] ? do_vfs_ioctl+0x486/0x1520 [ 49.116257] ? ioctl_preallocate+0x2b0/0x2b0 [ 49.120628] ? selinux_capable+0x40/0x40 [ 49.124651] ? putname+0xf3/0x130 [ 49.128070] do_group_exit+0x149/0x400 [ 49.131920] ? SyS_exit+0x30/0x30 [ 49.135337] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.140317] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.145035] SyS_exit_group+0x1d/0x20 [ 49.148801] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.153519] RIP: 0033:0x445479 [ 49.156673] RSP: 002b:00007ffc8842ab48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 49.164342] RAX: ffffffffffffffda RBX: 00007ffc8842ab80 RCX: 0000000000445479 [ 49.171577] RDX: 0000000000445479 RSI: 000000002027afd8 RDI: 0000000000000001 [ 49.178809] RBP: 0000000000000082 R08: 00007ffc8842ab80 R09: 00007ffc8842ab80 [ 49.186046] R10: 00007ffc8842ab80 R11: 0000000000000206 R12: 00000000004027c0 [ 49.193280] R13: 0000000000402850 R14: 0000000000000000 R15: 0000000000000000