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-0,10.128.0.17' (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: [ 40.820304] ================================================================== [ 40.827735] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.834572] Write of size 8 at addr ffff8801ce66b740 by task syzkaller850345/2985 [ 40.842256] [ 40.843859] CPU: 0 PID: 2985 Comm: syzkaller850345 Not tainted 4.14.0-rc2+ #17 [ 40.851194] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.860530] Call Trace: [ 40.863101] dump_stack+0x194/0x257 [ 40.866715] ? arch_local_irq_restore+0x53/0x53 [ 40.871445] ? show_regs_print_info+0x65/0x65 [ 40.876008] ? lock_timer_base+0x1a3/0x2b0 [ 40.880217] ? detach_if_pending+0x557/0x610 [ 40.884614] print_address_description+0x73/0x250 [ 40.889439] ? detach_if_pending+0x557/0x610 [ 40.893821] kasan_report+0x25b/0x340 [ 40.897609] __asan_report_store8_noabort+0x17/0x20 [ 40.902609] detach_if_pending+0x557/0x610 [ 40.906819] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.911983] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.916623] ? lock_timer_base+0x1a3/0x2b0 [ 40.920832] ? lock_timer_base+0x1eb/0x2b0 [ 40.925061] ? __internal_add_timer+0x2d0/0x2d0 [ 40.929705] ? trace_hardirqs_on+0xd/0x10 [ 40.933834] try_to_del_timer_sync+0xa2/0x120 [ 40.938300] ? del_timer+0x130/0x130 [ 40.942080] ? del_timer_sync+0xeb/0x240 [ 40.946120] del_timer_sync+0x18a/0x240 [ 40.950159] tun_free_netdev+0x105/0x1b0 [ 40.954200] ? tun_xdp+0x410/0x410 [ 40.957709] ? cpumask_next+0x24/0x30 [ 40.961486] ? netdev_refcnt_read+0xed/0x150 [ 40.965871] ? tun_xdp+0x410/0x410 [ 40.969391] netdev_run_todo+0x870/0xca0 [ 40.973437] ? do_group_exit+0x149/0x400 [ 40.977491] ? register_netdev+0x30/0x30 [ 40.981534] ? lock_downgrade+0x990/0x990 [ 40.985668] ? trace_hardirqs_on+0xd/0x10 [ 40.989815] ? refcount_sub_and_test+0x115/0x1b0 [ 40.994549] ? refcount_inc+0x50/0x50 [ 40.998322] ? refcount_inc+0x50/0x50 [ 41.002099] ? sk_destruct+0x4c/0x80 [ 41.005787] ? __sk_free+0x5c/0x230 [ 41.009400] ? sk_free+0x2f/0x40 [ 41.012758] ? __tun_detach+0x176/0x1390 [ 41.016804] ? tun_attach+0xf90/0xf90 [ 41.020594] ? locks_remove_file+0x3fa/0x5a0 [ 41.024979] ? fcntl_setlk+0x10d0/0x10d0 [ 41.029017] ? __fsnotify_parent+0xb4/0x3a0 [ 41.033316] ? fsnotify+0x1af0/0x1af0 [ 41.037105] ? __tun_detach+0x1390/0x1390 [ 41.041240] ? __tun_detach+0x1390/0x1390 [ 41.045375] rtnl_unlock+0xe/0x10 [ 41.048811] tun_chr_close+0x49/0x60 [ 41.052498] __fput+0x333/0x7f0 [ 41.055761] ? fput+0x140/0x140 [ 41.059027] ? check_same_owner+0x320/0x320 [ 41.063331] ____fput+0x15/0x20 [ 41.066670] task_work_run+0x199/0x270 [ 41.070539] ? task_work_cancel+0x210/0x210 [ 41.074833] ? free_nsproxy+0x185/0x1f0 [ 41.078784] ? switch_task_namespaces+0xa2/0xc0 [ 41.083429] do_exit+0x9d2/0x1af0 [ 41.086864] ? trace_hardirqs_on+0xd/0x10 [ 41.090992] ? mm_update_next_owner+0x930/0x930 [ 41.095636] ? lock_acquire+0x1d5/0x580 [ 41.099586] ? __handle_mm_fault+0xf07/0x39c0 [ 41.104070] ? lock_release+0xd70/0xd70 [ 41.108117] ? check_noncircular+0x20/0x20 [ 41.112331] ? kvfree+0x3b/0x60 [ 41.115589] ? rtnl_unlock+0xe/0x10 [ 41.119193] ? check_noncircular+0x20/0x20 [ 41.123403] ? __handle_mm_fault+0x587/0x39c0 [ 41.127885] ? __pmd_alloc+0x4e0/0x4e0 [ 41.131755] ? find_held_lock+0x39/0x1d0 [ 41.135800] ? lock_downgrade+0x990/0x990 [ 41.139946] do_group_exit+0x149/0x400 [ 41.143980] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.148533] ? vmacache_find+0x5f/0x280 [ 41.152482] ? SyS_exit+0x30/0x30 [ 41.155913] ? do_fast_syscall_32+0x158/0xf05 [ 41.160379] ? do_group_exit+0x400/0x400 [ 41.164412] SyS_exit_group+0x1d/0x20 [ 41.168184] do_fast_syscall_32+0x3f2/0xf05 [ 41.172485] ? do_int80_syscall_32+0x940/0x940 [ 41.177037] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.181769] ? lockdep_sys_exit+0x47/0xf0 [ 41.185889] ? syscall_return_slowpath+0x2b3/0x510 [ 41.190792] ? lockdep_sys_exit+0x47/0xf0 [ 41.194927] ? retint_user+0x18/0x20 [ 41.198618] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 41.203447] entry_SYSENTER_compat+0x51/0x60 [ 41.207825] RIP: 0023:0xf7fb9c79 [ 41.211158] RSP: 002b:00000000ff90884c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 41.218927] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ff9089b8 [ 41.226167] RDX: 0000000008048e84 RSI: 0000000000000036 RDI: 0000000000000005 [ 41.233409] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 41.240662] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 41.247905] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 41.255173] [ 41.256773] Allocated by task 2985: [ 41.260374] save_stack_trace+0x16/0x20 [ 41.264320] save_stack+0x43/0xd0 [ 41.267742] kasan_kmalloc+0xad/0xe0 [ 41.271426] __kmalloc_node+0x47/0x70 [ 41.275195] kvmalloc_node+0x64/0xd0 [ 41.278879] alloc_netdev_mqs+0x16e/0xed0 [ 41.283084] __tun_chr_ioctl+0x12be/0x3d20 [ 41.287299] tun_chr_compat_ioctl+0x29/0x30 [ 41.291590] compat_SyS_ioctl+0x1d7/0x3290 [ 41.295799] do_fast_syscall_32+0x3f2/0xf05 [ 41.300091] entry_SYSENTER_compat+0x51/0x60 [ 41.304468] [ 41.306079] Freed by task 2985: [ 41.309330] save_stack_trace+0x16/0x20 [ 41.313274] save_stack+0x43/0xd0 [ 41.316695] kasan_slab_free+0x71/0xc0 [ 41.320639] kfree+0xca/0x250 [ 41.323722] kvfree+0x36/0x60 [ 41.326798] free_netdev+0x2cf/0x360 [ 41.330531] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.334744] tun_chr_compat_ioctl+0x29/0x30 [ 41.339037] compat_SyS_ioctl+0x1d7/0x3290 [ 41.343240] do_fast_syscall_32+0x3f2/0xf05 [ 41.347532] entry_SYSENTER_compat+0x51/0x60 [ 41.351905] [ 41.353507] The buggy address belongs to the object at ffff8801ce668340 [ 41.353507] which belongs to the cache kmalloc-16384 of size 16384 [ 41.366479] The buggy address is located 13312 bytes inside of [ 41.366479] 16384-byte region [ffff8801ce668340, ffff8801ce66c340) [ 41.378759] The buggy address belongs to the page: [ 41.383663] page:ffffea0007399a00 count:1 mapcount:0 mapping:ffff8801ce668340 index:0x0 compound_mapcount: 0 [ 41.393617] flags: 0x200000000008100(slab|head) [ 41.398259] raw: 0200000000008100 ffff8801ce668340 0000000000000000 0000000100000001 [ 41.406118] raw: ffffea0007322820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.414438] page dumped because: kasan: bad access detected [ 41.420120] [ 41.421718] Memory state around the buggy address: [ 41.426618] ffff8801ce66b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.433948] ffff8801ce66b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.441371] >ffff8801ce66b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.448709] ^ [ 41.454129] ffff8801ce66b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.461464] ffff8801ce66b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.468792] ================================================================== [ 41.476129] Disabling lock debugging due to kernel taint [ 41.481544] Kernel panic - not syncing: panic_on_warn set ... [ 41.481544] [ 41.488870] CPU: 0 PID: 2985 Comm: syzkaller850345 Tainted: G B 4.14.0-rc2+ #17 [ 41.497409] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.506731] Call Trace: [ 41.509288] dump_stack+0x194/0x257 [ 41.512899] ? arch_local_irq_restore+0x53/0x53 [ 41.517534] ? vprintk_default+0x28/0x30 [ 41.521997] ? detach_if_pending+0x540/0x610 [ 41.526457] panic+0x1e4/0x417 [ 41.529615] ? __warn+0x1d9/0x1d9 [ 41.533039] ? detach_if_pending+0x557/0x610 [ 41.537413] kasan_end_report+0x50/0x50 [ 41.541351] kasan_report+0x144/0x340 [ 41.545117] __asan_report_store8_noabort+0x17/0x20 [ 41.550097] detach_if_pending+0x557/0x610 [ 41.554299] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.559455] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.564087] ? lock_timer_base+0x1a3/0x2b0 [ 41.568285] ? lock_timer_base+0x1eb/0x2b0 [ 41.572491] ? __internal_add_timer+0x2d0/0x2d0 [ 41.577127] ? trace_hardirqs_on+0xd/0x10 [ 41.581243] try_to_del_timer_sync+0xa2/0x120 [ 41.585705] ? del_timer+0x130/0x130 [ 41.589393] ? del_timer_sync+0xeb/0x240 [ 41.593422] del_timer_sync+0x18a/0x240 [ 41.597362] tun_free_netdev+0x105/0x1b0 [ 41.601488] ? tun_xdp+0x410/0x410 [ 41.605001] ? cpumask_next+0x24/0x30 [ 41.608778] ? netdev_refcnt_read+0xed/0x150 [ 41.613156] ? tun_xdp+0x410/0x410 [ 41.616661] netdev_run_todo+0x870/0xca0 [ 41.620704] ? do_group_exit+0x149/0x400 [ 41.624731] ? register_netdev+0x30/0x30 [ 41.628769] ? lock_downgrade+0x990/0x990 [ 41.632881] ? trace_hardirqs_on+0xd/0x10 [ 41.637006] ? refcount_sub_and_test+0x115/0x1b0 [ 41.641728] ? refcount_inc+0x50/0x50 [ 41.645503] ? refcount_inc+0x50/0x50 [ 41.649275] ? sk_destruct+0x4c/0x80 [ 41.652954] ? __sk_free+0x5c/0x230 [ 41.656553] ? sk_free+0x2f/0x40 [ 41.659883] ? __tun_detach+0x176/0x1390 [ 41.664002] ? tun_attach+0xf90/0xf90 [ 41.667783] ? locks_remove_file+0x3fa/0x5a0 [ 41.672165] ? fcntl_setlk+0x10d0/0x10d0 [ 41.676192] ? __fsnotify_parent+0xb4/0x3a0 [ 41.680483] ? fsnotify+0x1af0/0x1af0 [ 41.684250] ? __tun_detach+0x1390/0x1390 [ 41.688361] ? __tun_detach+0x1390/0x1390 [ 41.692479] rtnl_unlock+0xe/0x10 [ 41.695897] tun_chr_close+0x49/0x60 [ 41.699585] __fput+0x333/0x7f0 [ 41.702832] ? fput+0x140/0x140 [ 41.706314] ? check_same_owner+0x320/0x320 [ 41.710603] ____fput+0x15/0x20 [ 41.713848] task_work_run+0x199/0x270 [ 41.717703] ? task_work_cancel+0x210/0x210 [ 41.722001] ? free_nsproxy+0x185/0x1f0 [ 41.725951] ? switch_task_namespaces+0xa2/0xc0 [ 41.730608] do_exit+0x9d2/0x1af0 [ 41.734027] ? trace_hardirqs_on+0xd/0x10 [ 41.738143] ? mm_update_next_owner+0x930/0x930 [ 41.742796] ? lock_acquire+0x1d5/0x580 [ 41.746741] ? __handle_mm_fault+0xf07/0x39c0 [ 41.751213] ? lock_release+0xd70/0xd70 [ 41.755172] ? check_noncircular+0x20/0x20 [ 41.759689] ? kvfree+0x3b/0x60 [ 41.762948] ? rtnl_unlock+0xe/0x10 [ 41.766558] ? check_noncircular+0x20/0x20 [ 41.770808] ? __handle_mm_fault+0x587/0x39c0 [ 41.775269] ? __pmd_alloc+0x4e0/0x4e0 [ 41.779130] ? find_held_lock+0x39/0x1d0 [ 41.783252] ? lock_downgrade+0x990/0x990 [ 41.787395] do_group_exit+0x149/0x400 [ 41.791250] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.795797] ? vmacache_find+0x5f/0x280 [ 41.799737] ? SyS_exit+0x30/0x30 [ 41.803170] ? do_fast_syscall_32+0x158/0xf05 [ 41.807636] ? do_group_exit+0x400/0x400 [ 41.812740] SyS_exit_group+0x1d/0x20 [ 41.816516] do_fast_syscall_32+0x3f2/0xf05