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.21' (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: [ 42.237288] ================================================================== [ 42.244733] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.251460] Write of size 8 at addr ffff8801cd893740 by task syzkaller203241/2992 [ 42.259049] [ 42.260657] CPU: 1 PID: 2992 Comm: syzkaller203241 Not tainted 4.14.0-rc2+ #19 [ 42.267987] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.277312] Call Trace: [ 42.279877] dump_stack+0x194/0x257 [ 42.283481] ? arch_local_irq_restore+0x53/0x53 [ 42.288129] ? show_regs_print_info+0x65/0x65 [ 42.292601] ? lock_timer_base+0x1a3/0x2b0 [ 42.296809] ? detach_if_pending+0x557/0x610 [ 42.301192] print_address_description+0x73/0x250 [ 42.306015] ? detach_if_pending+0x557/0x610 [ 42.310396] kasan_report+0x25b/0x340 [ 42.314172] __asan_report_store8_noabort+0x17/0x20 [ 42.319158] detach_if_pending+0x557/0x610 [ 42.323366] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.328528] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.333162] ? lock_timer_base+0x1a3/0x2b0 [ 42.337367] ? lock_timer_base+0x1eb/0x2b0 [ 42.341574] ? __internal_add_timer+0x2d0/0x2d0 [ 42.346218] ? trace_hardirqs_on+0xd/0x10 [ 42.350343] try_to_del_timer_sync+0xa2/0x120 [ 42.354807] ? del_timer+0x130/0x130 [ 42.358493] ? del_timer_sync+0xeb/0x240 [ 42.362529] del_timer_sync+0x18a/0x240 [ 42.366478] tun_free_netdev+0x105/0x1b0 [ 42.370512] ? tun_xdp+0x410/0x410 [ 42.374024] ? cpumask_next+0x24/0x30 [ 42.377798] ? netdev_refcnt_read+0xed/0x150 [ 42.382180] ? tun_xdp+0x410/0x410 [ 42.385705] netdev_run_todo+0x870/0xca0 [ 42.389738] ? do_group_exit+0x149/0x400 [ 42.393776] ? register_netdev+0x30/0x30 [ 42.397821] ? lock_downgrade+0x990/0x990 [ 42.401940] ? trace_hardirqs_on+0xd/0x10 [ 42.406080] ? refcount_sub_and_test+0x115/0x1b0 [ 42.410811] ? refcount_inc+0x50/0x50 [ 42.414583] ? refcount_inc+0x50/0x50 [ 42.418363] ? sk_destruct+0x4c/0x80 [ 42.422049] ? __sk_free+0x5c/0x230 [ 42.425650] ? sk_free+0x2f/0x40 [ 42.428988] ? __tun_detach+0x176/0x1390 [ 42.433033] ? tun_attach+0xf90/0xf90 [ 42.436813] ? do_raw_spin_trylock+0x190/0x190 [ 42.441370] ? locks_remove_file+0x3fa/0x5a0 [ 42.445754] ? fcntl_setlk+0x10d0/0x10d0 [ 42.449803] ? __fsnotify_parent+0xb4/0x3a0 [ 42.454111] ? fsnotify+0x1af0/0x1af0 [ 42.457900] ? __tun_detach+0x1390/0x1390 [ 42.462024] ? __tun_detach+0x1390/0x1390 [ 42.466151] rtnl_unlock+0xe/0x10 [ 42.469575] tun_chr_close+0x49/0x60 [ 42.473258] __fput+0x333/0x7f0 [ 42.476515] ? fput+0x140/0x140 [ 42.479768] ? check_same_owner+0x320/0x320 [ 42.484060] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.488533] ____fput+0x15/0x20 [ 42.491786] task_work_run+0x199/0x270 [ 42.495649] ? task_work_cancel+0x210/0x210 [ 42.499949] ? _raw_spin_unlock+0x22/0x30 [ 42.504080] ? switch_task_namespaces+0x87/0xc0 [ 42.508726] do_exit+0x9d2/0x1af0 [ 42.512157] ? mm_update_next_owner+0x930/0x930 [ 42.516801] ? lock_acquire+0x1d5/0x580 [ 42.520749] ? __handle_mm_fault+0xf07/0x39c0 [ 42.525222] ? lock_release+0xd70/0xd70 [ 42.529166] ? check_noncircular+0x20/0x20 [ 42.533386] ? kvfree+0x3b/0x60 [ 42.536663] ? rtnl_unlock+0xe/0x10 [ 42.540280] ? check_noncircular+0x20/0x20 [ 42.544508] ? __handle_mm_fault+0x587/0x39c0 [ 42.548999] ? __pmd_alloc+0x4e0/0x4e0 [ 42.552881] ? find_held_lock+0x39/0x1d0 [ 42.556929] ? lock_downgrade+0x990/0x990 [ 42.561075] do_group_exit+0x149/0x400 [ 42.564933] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.569492] ? vmacache_find+0x5f/0x280 [ 42.573436] ? SyS_exit+0x30/0x30 [ 42.576869] ? do_fast_syscall_32+0x158/0xf05 [ 42.581335] ? do_group_exit+0x400/0x400 [ 42.585367] SyS_exit_group+0x1d/0x20 [ 42.589141] do_fast_syscall_32+0x3f2/0xf05 [ 42.593439] ? do_int80_syscall_32+0x940/0x940 [ 42.597993] ? kasan_check_read+0x11/0x20 [ 42.602114] ? syscall_return_slowpath+0x510/0x510 [ 42.607018] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.611226] ? lockdep_sys_exit+0x47/0xf0 [ 42.615348] ? retint_user+0x18/0x20 [ 42.619038] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.623860] entry_SYSENTER_compat+0x51/0x60 [ 42.628241] RIP: 0023:0xf7f42c79 [ 42.631575] RSP: 002b:00000000ff94e25c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 42.639256] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 42.646496] RDX: 0000000000000000 RSI: 00000000080db898 RDI: 00000000080f22a0 [ 42.653738] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.660976] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.668215] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.675473] [ 42.677071] Allocated by task 2992: [ 42.680670] save_stack_trace+0x16/0x20 [ 42.684612] save_stack+0x43/0xd0 [ 42.688039] kasan_kmalloc+0xad/0xe0 [ 42.691724] __kmalloc_node+0x47/0x70 [ 42.695496] kvmalloc_node+0x64/0xd0 [ 42.699180] alloc_netdev_mqs+0x16e/0xed0 [ 42.703297] __tun_chr_ioctl+0x12be/0x3d20 [ 42.707499] tun_chr_compat_ioctl+0x29/0x30 [ 42.711790] compat_SyS_ioctl+0x1d7/0x3290 [ 42.715996] do_fast_syscall_32+0x3f2/0xf05 [ 42.720288] entry_SYSENTER_compat+0x51/0x60 [ 42.724663] [ 42.726260] Freed by task 2992: [ 42.729508] save_stack_trace+0x16/0x20 [ 42.733452] save_stack+0x43/0xd0 [ 42.736873] kasan_slab_free+0x71/0xc0 [ 42.740729] kfree+0xca/0x250 [ 42.743803] kvfree+0x36/0x60 [ 42.746883] free_netdev+0x2cf/0x360 [ 42.750566] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.754771] tun_chr_compat_ioctl+0x29/0x30 [ 42.759062] compat_SyS_ioctl+0x1d7/0x3290 [ 42.763265] do_fast_syscall_32+0x3f2/0xf05 [ 42.767555] entry_SYSENTER_compat+0x51/0x60 [ 42.771928] [ 42.773528] The buggy address belongs to the object at ffff8801cd890340 [ 42.773528] which belongs to the cache kmalloc-16384 of size 16384 [ 42.786499] The buggy address is located 13312 bytes inside of [ 42.786499] 16384-byte region [ffff8801cd890340, ffff8801cd894340) [ 42.798688] The buggy address belongs to the page: [ 42.803586] page:ffffea0007362400 count:1 mapcount:0 mapping:ffff8801cd890340 index:0x0 compound_mapcount: 0 [ 42.813532] flags: 0x200000000008100(slab|head) [ 42.818174] raw: 0200000000008100 ffff8801cd890340 0000000000000000 0000000100000001 [ 42.826030] raw: ffffea0007345c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.833882] page dumped because: kasan: bad access detected [ 42.839560] [ 42.841157] Memory state around the buggy address: [ 42.846072] ffff8801cd893600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.853414] ffff8801cd893680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.860743] >ffff8801cd893700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.868069] ^ [ 42.873490] ffff8801cd893780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.880914] ffff8801cd893800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.888251] ================================================================== [ 42.895580] Disabling lock debugging due to kernel taint [ 42.900994] Kernel panic - not syncing: panic_on_warn set ... [ 42.900994] [ 42.908325] CPU: 1 PID: 2992 Comm: syzkaller203241 Tainted: G B 4.14.0-rc2+ #19 [ 42.916862] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.926186] Call Trace: [ 42.928744] dump_stack+0x194/0x257 [ 42.932338] ? arch_local_irq_restore+0x53/0x53 [ 42.936973] ? vprintk_default+0x28/0x30 [ 42.941003] ? detach_if_pending+0x4d0/0x610 [ 42.945378] panic+0x1e4/0x417 [ 42.948534] ? __warn+0x1d9/0x1d9 [ 42.951959] ? detach_if_pending+0x557/0x610 [ 42.956334] kasan_end_report+0x50/0x50 [ 42.960276] kasan_report+0x144/0x340 [ 42.964045] __asan_report_store8_noabort+0x17/0x20 [ 42.969031] detach_if_pending+0x557/0x610 [ 42.973233] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.978392] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.983028] ? lock_timer_base+0x1a3/0x2b0 [ 42.987230] ? lock_timer_base+0x1eb/0x2b0 [ 42.991435] ? __internal_add_timer+0x2d0/0x2d0 [ 42.996075] ? trace_hardirqs_on+0xd/0x10 [ 43.000193] try_to_del_timer_sync+0xa2/0x120 [ 43.004664] ? del_timer+0x130/0x130 [ 43.008351] ? del_timer_sync+0xeb/0x240 [ 43.012385] del_timer_sync+0x18a/0x240 [ 43.016332] tun_free_netdev+0x105/0x1b0 [ 43.020361] ? tun_xdp+0x410/0x410 [ 43.023875] ? cpumask_next+0x24/0x30 [ 43.027655] ? netdev_refcnt_read+0xed/0x150 [ 43.032045] ? tun_xdp+0x410/0x410 [ 43.035558] netdev_run_todo+0x870/0xca0 [ 43.039590] ? do_group_exit+0x149/0x400 [ 43.043625] ? register_netdev+0x30/0x30 [ 43.047667] ? lock_downgrade+0x990/0x990 [ 43.051789] ? trace_hardirqs_on+0xd/0x10 [ 43.055913] ? refcount_sub_and_test+0x115/0x1b0 [ 43.060644] ? refcount_inc+0x50/0x50 [ 43.064408] ? refcount_inc+0x50/0x50 [ 43.068174] ? sk_destruct+0x4c/0x80 [ 43.071854] ? __sk_free+0x5c/0x230 [ 43.075448] ? sk_free+0x2f/0x40 [ 43.078779] ? __tun_detach+0x176/0x1390 [ 43.082809] ? tun_attach+0xf90/0xf90 [ 43.086579] ? do_raw_spin_trylock+0x190/0x190 [ 43.091128] ? locks_remove_file+0x3fa/0x5a0 [ 43.095501] ? fcntl_setlk+0x10d0/0x10d0 [ 43.099531] ? __fsnotify_parent+0xb4/0x3a0 [ 43.103817] ? fsnotify+0x1af0/0x1af0 [ 43.107582] ? __tun_detach+0x1390/0x1390 [ 43.111694] ? __tun_detach+0x1390/0x1390 [ 43.115808] rtnl_unlock+0xe/0x10 [ 43.119224] tun_chr_close+0x49/0x60 [ 43.122903] __fput+0x333/0x7f0 [ 43.126148] ? fput+0x140/0x140 [ 43.129392] ? check_same_owner+0x320/0x320 [ 43.133681] ? _raw_spin_unlock_irq+0x27/0x70 [ 43.138141] ____fput+0x15/0x20 [ 43.141384] task_work_run+0x199/0x270 [ 43.145237] ? task_work_cancel+0x210/0x210 [ 43.149523] ? _raw_spin_unlock+0x22/0x30 [ 43.153635] ? switch_task_namespaces+0x87/0xc0 [ 43.158271] do_exit+0x9d2/0x1af0 [ 43.161694] ? mm_update_next_owner+0x930/0x930 [ 43.166329] ? lock_acquire+0x1d5/0x580 [ 43.170267] ? __handle_mm_fault+0xf07/0x39c0 [ 43.174729] ? lock_release+0xd70/0xd70 [ 43.178671] ? check_noncircular+0x20/0x20 [ 43.182881] ? kvfree+0x3b/0x60 [ 43.186134] ? rtnl_unlock+0xe/0x10 [ 43.189730] ? check_noncircular+0x20/0x20 [ 43.193930] ? __handle_mm_fault+0x587/0x39c0 [ 43.198392] ? __pmd_alloc+0x4e0/0x4e0 [ 43.202261] ? find_held_lock+0x39/0x1d0 [ 43.206293] ? lock_downgrade+0x990/0x990 [ 43.210422] do_group_exit+0x149/0x400 [ 43.214274] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.218828] ? vmacache_find+0x5f/0x280 [ 43.222769] ? SyS_exit+0x30/0x30 [ 43.226194] ? do_fast_syscall_32+0x158/0xf05 [ 43.230653] ? do_group_exit+0x400/0x400 [ 43.234681] SyS_exit_group+0x1d/0x20