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.15.220' (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: [ 50.479291] ================================================================== [ 50.480381] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 50.481272] Write of size 8 at addr ffff8801ce1bb780 by task syzkaller917921/2992 [ 50.482288] [ 50.482524] CPU: 1 PID: 2992 Comm: syzkaller917921 Not tainted 4.14.0-rc3+ #25 [ 50.483494] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.484715] Call Trace: [ 50.485077] dump_stack+0x194/0x257 [ 50.485574] ? arch_local_irq_restore+0x53/0x53 [ 50.486201] ? show_regs_print_info+0x65/0x65 [ 50.486862] ? lock_timer_base+0x1a3/0x2b0 [ 50.487437] ? detach_if_pending+0x557/0x610 [ 50.488031] print_address_description+0x73/0x250 [ 50.488679] ? detach_if_pending+0x557/0x610 [ 50.489319] kasan_report+0x25b/0x340 [ 50.489841] __asan_report_store8_noabort+0x17/0x20 [ 50.490526] detach_if_pending+0x557/0x610 [ 50.491100] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.491794] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.492419] ? lock_timer_base+0x1a3/0x2b0 [ 50.492990] ? lock_timer_base+0x1eb/0x2b0 [ 50.493565] ? __internal_add_timer+0x2d0/0x2d0 [ 50.494196] ? trace_hardirqs_on+0xd/0x10 [ 50.494791] try_to_del_timer_sync+0xa2/0x120 [ 50.495404] ? del_timer+0x130/0x130 [ 50.495909] ? del_timer_sync+0xeb/0x240 [ 50.496464] del_timer_sync+0x18a/0x240 [ 50.497003] tun_free_netdev+0x105/0x1b0 [ 50.497551] ? tun_xdp+0x410/0x410 [ 50.498031] ? cpumask_next+0x24/0x30 [ 50.498550] ? netdev_refcnt_read+0xed/0x150 [ 50.499147] ? tun_xdp+0x410/0x410 [ 50.499630] netdev_run_todo+0x870/0xca0 [ 50.503660] ? do_group_exit+0x149/0x400 [ 50.507699] ? register_netdev+0x30/0x30 [ 50.511735] ? lock_downgrade+0x990/0x990 [ 50.515854] ? trace_hardirqs_on+0xd/0x10 [ 50.519996] ? refcount_sub_and_test+0x115/0x1b0 [ 50.524727] ? refcount_inc+0x50/0x50 [ 50.528503] ? refcount_inc+0x50/0x50 [ 50.532285] ? sk_destruct+0x4c/0x80 [ 50.535974] ? __sk_free+0x5c/0x230 [ 50.539574] ? sk_free+0x2f/0x40 [ 50.542912] ? __tun_detach+0x176/0x1390 [ 50.546954] ? tun_attach+0xf90/0xf90 [ 50.550733] ? locks_remove_file+0x3fa/0x5a0 [ 50.555115] ? fcntl_setlk+0x10d0/0x10d0 [ 50.559148] ? __fsnotify_parent+0xb4/0x3a0 [ 50.563445] ? fsnotify+0x1af0/0x1af0 [ 50.567223] ? __tun_detach+0x1390/0x1390 [ 50.571342] ? __tun_detach+0x1390/0x1390 [ 50.575461] rtnl_unlock+0xe/0x10 [ 50.578881] tun_chr_close+0x49/0x60 [ 50.582566] __fput+0x333/0x7f0 [ 50.585821] ? fput+0x140/0x140 [ 50.589072] ? check_same_owner+0x320/0x320 [ 50.593499] ____fput+0x15/0x20 [ 50.596752] task_work_run+0x199/0x270 [ 50.600612] ? task_work_cancel+0x210/0x210 [ 50.604916] ? free_nsproxy+0x185/0x1f0 [ 50.608881] ? switch_task_namespaces+0xa2/0xc0 [ 50.613539] do_exit+0x9d2/0x1af0 [ 50.616969] ? __handle_mm_fault+0xf07/0x39c0 [ 50.621441] ? mm_update_next_owner+0x930/0x930 [ 50.626081] ? lock_release+0xd70/0xd70 [ 50.630027] ? check_noncircular+0x20/0x20 [ 50.634233] ? kfree+0xe4/0x250 [ 50.637491] ? kvfree+0x36/0x60 [ 50.640761] ? trace_hardirqs_on+0xd/0x10 [ 50.644885] ? check_noncircular+0x20/0x20 [ 50.649093] ? __handle_mm_fault+0x587/0x39c0 [ 50.653570] ? __pmd_alloc+0x4e0/0x4e0 [ 50.657438] ? find_held_lock+0x39/0x1d0 [ 50.661479] ? lock_downgrade+0x990/0x990 [ 50.665620] ? handle_mm_fault+0x410/0x8d0 [ 50.669825] ? down_read_trylock+0xdb/0x170 [ 50.674115] ? __do_page_fault+0x31e/0xd60 [ 50.678319] ? __handle_mm_fault+0x39c0/0x39c0 [ 50.682869] ? vmacache_find+0x5f/0x280 [ 50.686811] ? vmacache_update+0xfe/0x130 [ 50.690936] do_group_exit+0x149/0x400 [ 50.694792] ? __do_page_fault+0x3d6/0xd60 [ 50.698998] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 50.703374] ? SyS_exit+0x30/0x30 [ 50.706802] ? do_fast_syscall_32+0x158/0xf05 [ 50.711265] ? do_group_exit+0x400/0x400 [ 50.715297] SyS_exit_group+0x1d/0x20 [ 50.719067] do_fast_syscall_32+0x3f2/0xf05 [ 50.723366] ? do_int80_syscall_32+0x940/0x940 [ 50.727917] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 50.732649] ? lockdep_sys_exit+0x47/0xf0 [ 50.736766] ? syscall_return_slowpath+0x2b3/0x510 [ 50.741671] ? lockdep_sys_exit+0x47/0xf0 [ 50.745789] ? retint_user+0x18/0x20 [ 50.749476] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 50.754297] entry_SYSENTER_compat+0x51/0x60 [ 50.758673] RIP: 0023:0xf7f31c79 [ 50.762006] RSP: 002b:00000000ff95f44c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 50.769685] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 50.776926] RDX: 0000000000000000 RSI: 000000002025efd8 RDI: 00000000400454ca [ 50.784164] RBP: 0000000008072a96 R08: 0000000000000000 R09: 0000000000000000 [ 50.791405] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 50.798646] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 50.805904] [ 50.807502] Allocated by task 2992: [ 50.811098] save_stack_trace+0x16/0x20 [ 50.815041] save_stack+0x43/0xd0 [ 50.818464] kasan_kmalloc+0xad/0xe0 [ 50.822146] __kmalloc_node+0x47/0x70 [ 50.825920] kvmalloc_node+0x64/0xd0 [ 50.829602] alloc_netdev_mqs+0x16e/0xed0 [ 50.833719] __tun_chr_ioctl+0x12be/0x3d20 [ 50.837921] tun_chr_compat_ioctl+0x29/0x30 [ 50.842212] compat_SyS_ioctl+0x1d7/0x3290 [ 50.846413] do_fast_syscall_32+0x3f2/0xf05 [ 50.850702] entry_SYSENTER_compat+0x51/0x60 [ 50.855074] [ 50.856670] Freed by task 2992: [ 50.859920] save_stack_trace+0x16/0x20 [ 50.863861] save_stack+0x43/0xd0 [ 50.867281] kasan_slab_free+0x71/0xc0 [ 50.871135] kfree+0xca/0x250 [ 50.874208] kvfree+0x36/0x60 [ 50.877282] free_netdev+0x2cf/0x360 [ 50.880964] __tun_chr_ioctl+0x2cf6/0x3d20 [ 50.885165] tun_chr_compat_ioctl+0x29/0x30 [ 50.889460] compat_SyS_ioctl+0x1d7/0x3290 [ 50.893664] do_fast_syscall_32+0x3f2/0xf05 [ 50.898749] entry_SYSENTER_compat+0x51/0x60 [ 50.903124] [ 50.904725] The buggy address belongs to the object at ffff8801ce1b8380 [ 50.904725] which belongs to the cache kmalloc-16384 of size 16384 [ 50.917695] The buggy address is located 13312 bytes inside of [ 50.917695] 16384-byte region [ffff8801ce1b8380, ffff8801ce1bc380) [ 50.929883] The buggy address belongs to the page: [ 50.934782] page:ffffea0007386e00 count:1 mapcount:0 mapping:ffff8801ce1b8380 index:0x0 compound_mapcount: 0 [ 50.944724] flags: 0x200000000008100(slab|head) [ 50.949363] raw: 0200000000008100 ffff8801ce1b8380 0000000000000000 0000000100000001 [ 50.957211] raw: ffffea000739a420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 50.965060] page dumped because: kasan: bad access detected [ 50.970737] [ 50.972332] Memory state around the buggy address: [ 50.977227] ffff8801ce1bb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.984556] ffff8801ce1bb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.991884] >ffff8801ce1bb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.999211] ^ [ 51.002545] ffff8801ce1bb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.009873] ffff8801ce1bb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.017200] ================================================================== [ 51.024526] Disabling lock debugging due to kernel taint [ 51.029943] Kernel panic - not syncing: panic_on_warn set ... [ 51.029943] [ 51.037267] CPU: 1 PID: 2992 Comm: syzkaller917921 Tainted: G B 4.14.0-rc3+ #25 [ 51.045805] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.055120] Call Trace: [ 51.057673] dump_stack+0x194/0x257 [ 51.061268] ? arch_local_irq_restore+0x53/0x53 [ 51.065903] ? vprintk_default+0x28/0x30 [ 51.069934] ? detach_if_pending+0x470/0x610 [ 51.074308] panic+0x1e4/0x417 [ 51.077464] ? __warn+0x1d9/0x1d9 [ 51.080886] ? detach_if_pending+0x557/0x610 [ 51.085256] kasan_end_report+0x50/0x50 [ 51.089193] kasan_report+0x144/0x340 [ 51.092962] __asan_report_store8_noabort+0x17/0x20 [ 51.097939] detach_if_pending+0x557/0x610 [ 51.102137] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.107291] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.111921] ? lock_timer_base+0x1a3/0x2b0 [ 51.116118] ? lock_timer_base+0x1eb/0x2b0 [ 51.120317] ? __internal_add_timer+0x2d0/0x2d0 [ 51.124949] ? trace_hardirqs_on+0xd/0x10 [ 51.129064] try_to_del_timer_sync+0xa2/0x120 [ 51.133521] ? del_timer+0x130/0x130 [ 51.137198] ? del_timer_sync+0xeb/0x240 [ 51.141223] del_timer_sync+0x18a/0x240 [ 51.145165] tun_free_netdev+0x105/0x1b0 [ 51.149189] ? tun_xdp+0x410/0x410 [ 51.152695] ? cpumask_next+0x24/0x30 [ 51.156462] ? netdev_refcnt_read+0xed/0x150 [ 51.160834] ? tun_xdp+0x410/0x410 [ 51.164340] netdev_run_todo+0x870/0xca0 [ 51.168364] ? do_group_exit+0x149/0x400 [ 51.172394] ? register_netdev+0x30/0x30 [ 51.176422] ? lock_downgrade+0x990/0x990 [ 51.180531] ? trace_hardirqs_on+0xd/0x10 [ 51.184653] ? refcount_sub_and_test+0x115/0x1b0 [ 51.189371] ? refcount_inc+0x50/0x50 [ 51.193133] ? refcount_inc+0x50/0x50 [ 51.196901] ? sk_destruct+0x4c/0x80 [ 51.200583] ? __sk_free+0x5c/0x230 [ 51.204179] ? sk_free+0x2f/0x40 [ 51.207511] ? __tun_detach+0x176/0x1390 [ 51.211540] ? tun_attach+0xf90/0xf90 [ 51.215310] ? locks_remove_file+0x3fa/0x5a0 [ 51.219682] ? fcntl_setlk+0x10d0/0x10d0 [ 51.223708] ? __fsnotify_parent+0xb4/0x3a0 [ 51.227997] ? fsnotify+0x1af0/0x1af0 [ 51.231762] ? __tun_detach+0x1390/0x1390 [ 51.235872] ? __tun_detach+0x1390/0x1390 [ 51.239984] rtnl_unlock+0xe/0x10 [ 51.243399] tun_chr_close+0x49/0x60 [ 51.247078] __fput+0x333/0x7f0 [ 51.250324] ? fput+0x140/0x140 [ 51.253570] ? check_same_owner+0x320/0x320 [ 51.257858] ____fput+0x15/0x20 [ 51.261101] task_work_run+0x199/0x270 [ 51.264969] ? task_work_cancel+0x210/0x210 [ 51.269255] ? free_nsproxy+0x185/0x1f0 [ 51.273193] ? switch_task_namespaces+0xa2/0xc0 [ 51.277827] do_exit+0x9d2/0x1af0 [ 51.281244] ? __handle_mm_fault+0xf07/0x39c0 [ 51.285705] ? mm_update_next_owner+0x930/0x930 [ 51.290339] ? lock_release+0xd70/0xd70 [ 51.294275] ? check_noncircular+0x20/0x20 [ 51.298475] ? kfree+0xe4/0x250 [ 51.301719] ? kvfree+0x36/0x60 [ 51.304964] ? trace_hardirqs_on+0xd/0x10 [ 51.309078] ? check_noncircular+0x20/0x20 [ 51.313276] ? __handle_mm_fault+0x587/0x39c0 [ 51.317735] ? __pmd_alloc+0x4e0/0x4e0 [ 51.321594] ? find_held_lock+0x39/0x1d0 [ 51.325625] ? lock_downgrade+0x990/0x990 [ 51.329749] ? handle_mm_fault+0x410/0x8d0 [ 51.333945] ? down_read_trylock+0xdb/0x170 [ 51.338230] ? __do_page_fault+0x31e/0xd60 [ 51.342427] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.346971] ? vmacache_find+0x5f/0x280 [ 51.350914] ? vmacache_update+0xfe/0x130 [ 51.355030] do_group_exit+0x149/0x400 [ 51.358880] ? __do_page_fault+0x3d6/0xd60 [ 51.363076] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 51.367447] ? SyS_exit+0x30/0x30 [ 51.370866] ? do_fast_syscall_32+0x158/0xf05 [ 51.375322] ? do_group_exit+0x400/0x400 [ 51.379345] SyS_exit_group+0x1d/0x20 [ 51.383108] do_fast_syscall_32+0x3f2/0xf05 [ 51.387396] ? do_int80_syscall_32+0x940/0x940 [ 51.391941] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.396662] ? lockdep_sys_exit+0x47/0xf0 [ 51.400772] ? syscall_return_slowpath+0x2b3/0x510 [ 51.405667] ? lockdep_sys_exit+0x47/0xf0 [ 51.409778] ? retint_user+0x18/0x20 [ 51.413459] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 51.418269] entry_SYSENTER_compat+0x51/0x60 [ 51.422641] RIP: 0023:0xf7f31c79 [ 51.425967] RSP: 002b:00000000ff95f44c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 51.433646] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 51.440891] RDX: 0000000000000000 RSI: 000000002025efd8 RDI: 00000000400454ca [ 51.448129] RBP: 0000000008072a96 R08: 0000000000000000 R09: 0000000000000000 [ 51.455364] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 51.462597] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000