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-386-3,10.128.0.15' (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: [ 35.493335] ================================================================== [ 35.500754] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.507482] Write of size 8 at addr ffff8801cd4f3780 by task syzkaller762857/2991 [ 35.515098] [ 35.516702] CPU: 1 PID: 2991 Comm: syzkaller762857 Not tainted 4.14.0-rc2+ #17 [ 35.524029] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.533351] Call Trace: [ 35.535923] dump_stack+0x194/0x257 [ 35.539530] ? arch_local_irq_restore+0x53/0x53 [ 35.544172] ? show_regs_print_info+0x65/0x65 [ 35.548641] ? lock_timer_base+0x1a3/0x2b0 [ 35.552850] ? detach_if_pending+0x557/0x610 [ 35.557233] print_address_description+0x73/0x250 [ 35.562048] ? detach_if_pending+0x557/0x610 [ 35.566436] kasan_report+0x25b/0x340 [ 35.570212] __asan_report_store8_noabort+0x17/0x20 [ 35.575198] detach_if_pending+0x557/0x610 [ 35.579407] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.584570] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.589207] ? lock_timer_base+0x1a3/0x2b0 [ 35.593414] ? lock_timer_base+0x1eb/0x2b0 [ 35.597625] ? __internal_add_timer+0x2d0/0x2d0 [ 35.602266] ? trace_hardirqs_on+0xd/0x10 [ 35.606399] try_to_del_timer_sync+0xa2/0x120 [ 35.610865] ? del_timer+0x130/0x130 [ 35.614551] ? del_timer_sync+0xeb/0x240 [ 35.618592] del_timer_sync+0x18a/0x240 [ 35.622543] tun_free_netdev+0x105/0x1b0 [ 35.626581] ? tun_xdp+0x410/0x410 [ 35.630091] ? cpumask_next+0x24/0x30 [ 35.633881] ? netdev_refcnt_read+0xed/0x150 [ 35.638262] ? tun_xdp+0x410/0x410 [ 35.641772] netdev_run_todo+0x870/0xca0 [ 35.645802] ? do_group_exit+0x149/0x400 [ 35.649837] ? register_netdev+0x30/0x30 [ 35.653873] ? lock_downgrade+0x990/0x990 [ 35.657991] ? trace_hardirqs_on+0xd/0x10 [ 35.662126] ? refcount_sub_and_test+0x115/0x1b0 [ 35.666855] ? refcount_inc+0x50/0x50 [ 35.670624] ? refcount_inc+0x50/0x50 [ 35.674397] ? sk_destruct+0x4c/0x80 [ 35.678081] ? __sk_free+0x5c/0x230 [ 35.681679] ? sk_free+0x2f/0x40 [ 35.685018] ? __tun_detach+0x176/0x1390 [ 35.689061] ? tun_attach+0xf90/0xf90 [ 35.692834] ? do_raw_spin_trylock+0x190/0x190 [ 35.697388] ? locks_remove_file+0x3fa/0x5a0 [ 35.701768] ? fcntl_setlk+0x10d0/0x10d0 [ 35.705801] ? __fsnotify_parent+0xb4/0x3a0 [ 35.710097] ? fsnotify+0x1af0/0x1af0 [ 35.713877] ? __tun_detach+0x1390/0x1390 [ 35.717994] ? __tun_detach+0x1390/0x1390 [ 35.722119] rtnl_unlock+0xe/0x10 [ 35.725540] tun_chr_close+0x49/0x60 [ 35.729226] __fput+0x333/0x7f0 [ 35.732482] ? fput+0x140/0x140 [ 35.735733] ? check_same_owner+0x320/0x320 [ 35.740024] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.744495] ____fput+0x15/0x20 [ 35.747746] task_work_run+0x199/0x270 [ 35.751608] ? task_work_cancel+0x210/0x210 [ 35.755901] ? _raw_spin_unlock+0x22/0x30 [ 35.760022] ? switch_task_namespaces+0x87/0xc0 [ 35.764669] do_exit+0x9d2/0x1af0 [ 35.768097] ? mm_update_next_owner+0x930/0x930 [ 35.772735] ? lock_acquire+0x1d5/0x580 [ 35.776677] ? __handle_mm_fault+0xf07/0x39c0 [ 35.781147] ? lock_release+0xd70/0xd70 [ 35.785104] ? check_noncircular+0x20/0x20 [ 35.789311] ? kvfree+0x3b/0x60 [ 35.792569] ? rtnl_unlock+0xe/0x10 [ 35.796189] ? check_noncircular+0x20/0x20 [ 35.800399] ? __handle_mm_fault+0x587/0x39c0 [ 35.804868] ? __pmd_alloc+0x4e0/0x4e0 [ 35.808735] ? find_held_lock+0x39/0x1d0 [ 35.812784] ? lock_downgrade+0x990/0x990 [ 35.816930] do_group_exit+0x149/0x400 [ 35.820783] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.825333] ? vmacache_find+0x5f/0x280 [ 35.829278] ? SyS_exit+0x30/0x30 [ 35.832707] ? do_fast_syscall_32+0x158/0xf05 [ 35.837172] ? do_group_exit+0x400/0x400 [ 35.841208] SyS_exit_group+0x1d/0x20 [ 35.844977] do_fast_syscall_32+0x3f2/0xf05 [ 35.849273] ? do_int80_syscall_32+0x940/0x940 [ 35.853829] ? kasan_check_read+0x11/0x20 [ 35.857952] ? syscall_return_slowpath+0x510/0x510 [ 35.862854] ? SyS_rt_sigaction+0x94/0x1b0 [ 35.867060] ? lockdep_sys_exit+0x47/0xf0 [ 35.871176] ? retint_user+0x18/0x20 [ 35.874864] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 35.879684] entry_SYSENTER_compat+0x51/0x60 [ 35.884060] RIP: 0023:0xf7fa8c79 [ 35.887394] RSP: 002b:00000000ff8b9c6c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 35.895077] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 35.902319] RDX: 0000000000000000 RSI: 00000000080db4d8 RDI: 00000000080f22a0 [ 35.909561] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 35.916801] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 35.924041] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 35.931300] [ 35.932909] Allocated by task 2991: [ 35.936507] save_stack_trace+0x16/0x20 [ 35.940451] save_stack+0x43/0xd0 [ 35.943877] kasan_kmalloc+0xad/0xe0 [ 35.947557] __kmalloc_node+0x47/0x70 [ 35.951327] kvmalloc_node+0x64/0xd0 [ 35.955008] alloc_netdev_mqs+0x16e/0xed0 [ 35.959124] __tun_chr_ioctl+0x12be/0x3d20 [ 35.963325] tun_chr_compat_ioctl+0x29/0x30 [ 35.967615] compat_SyS_ioctl+0x1d7/0x3290 [ 35.971820] do_fast_syscall_32+0x3f2/0xf05 [ 35.976109] entry_SYSENTER_compat+0x51/0x60 [ 35.980484] [ 35.982080] Freed by task 2991: [ 35.985325] save_stack_trace+0x16/0x20 [ 35.989268] save_stack+0x43/0xd0 [ 35.992703] kasan_slab_free+0x71/0xc0 [ 35.996556] kfree+0xca/0x250 [ 35.999627] kvfree+0x36/0x60 [ 36.002706] free_netdev+0x2cf/0x360 [ 36.006385] __tun_chr_ioctl+0x2cf6/0x3d20 [ 36.010585] tun_chr_compat_ioctl+0x29/0x30 [ 36.014874] compat_SyS_ioctl+0x1d7/0x3290 [ 36.019079] do_fast_syscall_32+0x3f2/0xf05 [ 36.023367] entry_SYSENTER_compat+0x51/0x60 [ 36.027741] [ 36.029338] The buggy address belongs to the object at ffff8801cd4f0380 [ 36.029338] which belongs to the cache kmalloc-16384 of size 16384 [ 36.042315] The buggy address is located 13312 bytes inside of [ 36.042315] 16384-byte region [ffff8801cd4f0380, ffff8801cd4f4380) [ 36.054500] The buggy address belongs to the page: [ 36.059397] page:ffffea0007353c00 count:1 mapcount:0 mapping:ffff8801cd4f0380 index:0x0 compound_mapcount: 0 [ 36.069337] flags: 0x200000000008100(slab|head) [ 36.073976] raw: 0200000000008100 ffff8801cd4f0380 0000000000000000 0000000100000001 [ 36.081829] raw: ffffea0007353e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 36.089674] page dumped because: kasan: bad access detected [ 36.095347] [ 36.096941] Memory state around the buggy address: [ 36.101836] ffff8801cd4f3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.109162] ffff8801cd4f3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.116494] >ffff8801cd4f3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.123817] ^ [ 36.127151] ffff8801cd4f3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.134477] ffff8801cd4f3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.141806] ================================================================== [ 36.149129] Disabling lock debugging due to kernel taint [ 36.154541] Kernel panic - not syncing: panic_on_warn set ... [ 36.154541] [ 36.161864] CPU: 1 PID: 2991 Comm: syzkaller762857 Tainted: G B 4.14.0-rc2+ #17 [ 36.170404] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.179730] Call Trace: [ 36.182286] dump_stack+0x194/0x257 [ 36.185881] ? arch_local_irq_restore+0x53/0x53 [ 36.190515] ? vprintk_default+0x28/0x30 [ 36.194542] ? detach_if_pending+0x540/0x610 [ 36.198914] panic+0x1e4/0x417 [ 36.202069] ? __warn+0x1d9/0x1d9 [ 36.205492] ? detach_if_pending+0x557/0x610 [ 36.209863] kasan_end_report+0x50/0x50 [ 36.213803] kasan_report+0x144/0x340 [ 36.217571] __asan_report_store8_noabort+0x17/0x20 [ 36.222551] detach_if_pending+0x557/0x610 [ 36.226752] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.231905] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.236552] ? lock_timer_base+0x1a3/0x2b0 [ 36.240752] ? lock_timer_base+0x1eb/0x2b0 [ 36.244952] ? __internal_add_timer+0x2d0/0x2d0 [ 36.249585] ? trace_hardirqs_on+0xd/0x10 [ 36.253700] try_to_del_timer_sync+0xa2/0x120 [ 36.258159] ? del_timer+0x130/0x130 [ 36.261837] ? del_timer_sync+0xeb/0x240 [ 36.265865] del_timer_sync+0x18a/0x240 [ 36.269808] tun_free_netdev+0x105/0x1b0 [ 36.273841] ? tun_xdp+0x410/0x410 [ 36.277345] ? cpumask_next+0x24/0x30 [ 36.281111] ? netdev_refcnt_read+0xed/0x150 [ 36.285483] ? tun_xdp+0x410/0x410 [ 36.288988] netdev_run_todo+0x870/0xca0 [ 36.293014] ? do_group_exit+0x149/0x400 [ 36.297041] ? register_netdev+0x30/0x30 [ 36.301066] ? lock_downgrade+0x990/0x990 [ 36.305176] ? trace_hardirqs_on+0xd/0x10 [ 36.309297] ? refcount_sub_and_test+0x115/0x1b0 [ 36.314016] ? refcount_inc+0x50/0x50 [ 36.317780] ? refcount_inc+0x50/0x50 [ 36.321547] ? sk_destruct+0x4c/0x80 [ 36.325227] ? __sk_free+0x5c/0x230 [ 36.328819] ? sk_free+0x2f/0x40 [ 36.332148] ? __tun_detach+0x176/0x1390 [ 36.336177] ? tun_attach+0xf90/0xf90 [ 36.339948] ? do_raw_spin_trylock+0x190/0x190 [ 36.344498] ? locks_remove_file+0x3fa/0x5a0 [ 36.348882] ? fcntl_setlk+0x10d0/0x10d0 [ 36.352908] ? __fsnotify_parent+0xb4/0x3a0 [ 36.357196] ? fsnotify+0x1af0/0x1af0 [ 36.360963] ? __tun_detach+0x1390/0x1390 [ 36.365074] ? __tun_detach+0x1390/0x1390 [ 36.369188] rtnl_unlock+0xe/0x10 [ 36.372605] tun_chr_close+0x49/0x60 [ 36.376284] __fput+0x333/0x7f0 [ 36.379530] ? fput+0x140/0x140 [ 36.382775] ? check_same_owner+0x320/0x320 [ 36.387063] ? _raw_spin_unlock_irq+0x27/0x70 [ 36.391525] ____fput+0x15/0x20 [ 36.394768] task_work_run+0x199/0x270 [ 36.398620] ? task_work_cancel+0x210/0x210 [ 36.402905] ? _raw_spin_unlock+0x22/0x30 [ 36.407015] ? switch_task_namespaces+0x87/0xc0 [ 36.411649] do_exit+0x9d2/0x1af0 [ 36.415068] ? mm_update_next_owner+0x930/0x930 [ 36.419703] ? lock_acquire+0x1d5/0x580 [ 36.423640] ? __handle_mm_fault+0xf07/0x39c0 [ 36.428107] ? lock_release+0xd70/0xd70 [ 36.432044] ? check_noncircular+0x20/0x20 [ 36.436244] ? kvfree+0x3b/0x60 [ 36.439491] ? rtnl_unlock+0xe/0x10 [ 36.443082] ? check_noncircular+0x20/0x20 [ 36.447280] ? __handle_mm_fault+0x587/0x39c0 [ 36.451741] ? __pmd_alloc+0x4e0/0x4e0 [ 36.455598] ? find_held_lock+0x39/0x1d0 [ 36.459628] ? lock_downgrade+0x990/0x990 [ 36.463750] do_group_exit+0x149/0x400 [ 36.467598] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.472145] ? vmacache_find+0x5f/0x280 [ 36.476085] ? SyS_exit+0x30/0x30 [ 36.479504] ? do_fast_syscall_32+0x158/0xf05 [ 36.483963] ? do_group_exit+0x400/0x400 [ 36.487986] SyS_exit_group+0x1d/0x20 [ 36.491750] do_fast_syscall_32+0x3f2/0xf05