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-1,10.128.0.12' (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: [ 31.578436] ================================================================== [ 31.579636] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.580531] Write of size 8 at addr ffff8801ce22b7c0 by task syzkaller248883/2982 [ 31.581546] [ 31.581785] CPU: 0 PID: 2982 Comm: syzkaller248883 Not tainted 4.14.0-rc2+ #14 [ 31.582755] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.583979] Call Trace: [ 31.584380] dump_stack+0x194/0x257 [ 31.584895] ? arch_local_irq_restore+0x53/0x53 [ 31.585558] ? show_regs_print_info+0x65/0x65 [ 31.586163] ? lock_timer_base+0x1a3/0x2b0 [ 31.586752] ? detach_if_pending+0x557/0x610 [ 31.587364] print_address_description+0x73/0x250 [ 31.588014] ? detach_if_pending+0x557/0x610 [ 31.588607] kasan_report+0x25b/0x340 [ 31.589128] __asan_report_store8_noabort+0x17/0x20 [ 31.589798] detach_if_pending+0x557/0x610 [ 31.590371] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.591070] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.591755] ? lock_timer_base+0x1a3/0x2b0 [ 31.592326] ? lock_timer_base+0x1eb/0x2b0 [ 31.592903] ? __internal_add_timer+0x2d0/0x2d0 [ 31.593530] ? trace_hardirqs_on+0xd/0x10 [ 31.594096] try_to_del_timer_sync+0xa2/0x120 [ 31.594715] ? del_timer+0x130/0x130 [ 31.595220] ? del_timer_sync+0xeb/0x240 [ 31.595776] del_timer_sync+0x18a/0x240 [ 31.596330] tun_free_netdev+0x105/0x1b0 [ 31.596879] ? tun_xdp+0x410/0x410 [ 31.597380] ? cpumask_next+0x24/0x30 [ 31.597914] ? netdev_refcnt_read+0xed/0x150 [ 31.598510] ? tun_xdp+0x410/0x410 [ 31.601379] netdev_run_todo+0x870/0xca0 [ 31.605413] ? do_group_exit+0x149/0x400 [ 31.609450] ? register_netdev+0x30/0x30 [ 31.613488] ? lock_downgrade+0x990/0x990 [ 31.617606] ? trace_hardirqs_on+0xd/0x10 [ 31.621740] ? refcount_sub_and_test+0x115/0x1b0 [ 31.626469] ? refcount_inc+0x50/0x50 [ 31.630240] ? refcount_inc+0x50/0x50 [ 31.634016] ? sk_destruct+0x4c/0x80 [ 31.637701] ? __sk_free+0x5c/0x230 [ 31.641301] ? sk_free+0x2f/0x40 [ 31.644638] ? __tun_detach+0x176/0x1390 [ 31.648681] ? tun_attach+0xf90/0xf90 [ 31.652462] ? locks_remove_file+0x3fa/0x5a0 [ 31.656846] ? fcntl_setlk+0x10d0/0x10d0 [ 31.660880] ? __fsnotify_parent+0xb4/0x3a0 [ 31.665175] ? fsnotify+0x1af0/0x1af0 [ 31.668951] ? __tun_detach+0x1390/0x1390 [ 31.673070] ? __tun_detach+0x1390/0x1390 [ 31.677190] rtnl_unlock+0xe/0x10 [ 31.680610] tun_chr_close+0x49/0x60 [ 31.684294] __fput+0x333/0x7f0 [ 31.687552] ? fput+0x140/0x140 [ 31.690803] ? check_same_owner+0x320/0x320 [ 31.695101] ____fput+0x15/0x20 [ 31.698352] task_work_run+0x199/0x270 [ 31.702213] ? task_work_cancel+0x210/0x210 [ 31.706506] ? free_nsproxy+0x185/0x1f0 [ 31.710461] ? switch_task_namespaces+0xa2/0xc0 [ 31.715106] do_exit+0x9d2/0x1af0 [ 31.718544] ? trace_hardirqs_on+0xd/0x10 [ 31.722668] ? mm_update_next_owner+0x930/0x930 [ 31.727308] ? lock_acquire+0x1d5/0x580 [ 31.731252] ? __handle_mm_fault+0xf07/0x39c0 [ 31.735726] ? lock_release+0xd70/0xd70 [ 31.739671] ? check_noncircular+0x20/0x20 [ 31.743880] ? kvfree+0x3b/0x60 [ 31.747137] ? rtnl_unlock+0xe/0x10 [ 31.750735] ? check_noncircular+0x20/0x20 [ 31.754943] ? __handle_mm_fault+0x587/0x39c0 [ 31.759413] ? __pmd_alloc+0x4e0/0x4e0 [ 31.763281] ? find_held_lock+0x39/0x1d0 [ 31.767323] ? lock_downgrade+0x990/0x990 [ 31.771469] do_group_exit+0x149/0x400 [ 31.775325] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.779877] ? vmacache_find+0x5f/0x280 [ 31.783820] ? SyS_exit+0x30/0x30 [ 31.787252] ? do_fast_syscall_32+0x158/0xf05 [ 31.791720] ? do_group_exit+0x400/0x400 [ 31.795750] SyS_exit_group+0x1d/0x20 [ 31.799522] do_fast_syscall_32+0x3f2/0xf05 [ 31.803821] ? do_int80_syscall_32+0x940/0x940 [ 31.808378] ? lockdep_sys_exit+0x47/0xf0 [ 31.812494] ? syscall_return_slowpath+0x2b3/0x510 [ 31.817392] ? finish_task_switch+0x1aa/0x740 [ 31.821860] ? lockdep_sys_exit+0x47/0xf0 [ 31.825981] ? retint_user+0x18/0x20 [ 31.829669] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 31.834489] entry_SYSENTER_compat+0x51/0x60 [ 31.838866] RIP: 0023:0xf7f60c79 [ 31.842198] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 31.849878] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 31.857117] RDX: 0000000000000001 RSI: 0000000020982fd8 RDI: 00000000400454ca [ 31.864357] RBP: 0000000008072cf6 R08: 0000000000000000 R09: 0000000000000000 [ 31.871596] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 31.878836] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 31.886095] [ 31.887695] Allocated by task 2982: [ 31.891296] save_stack_trace+0x16/0x20 [ 31.895242] save_stack+0x43/0xd0 [ 31.898664] kasan_kmalloc+0xad/0xe0 [ 31.902346] __kmalloc_node+0x47/0x70 [ 31.906127] kvmalloc_node+0x64/0xd0 [ 31.909817] alloc_netdev_mqs+0x16e/0xed0 [ 31.913936] __tun_chr_ioctl+0x12be/0x3d20 [ 31.918138] tun_chr_compat_ioctl+0x29/0x30 [ 31.922428] compat_SyS_ioctl+0x1d7/0x3290 [ 31.926638] do_fast_syscall_32+0x3f2/0xf05 [ 31.930933] entry_SYSENTER_compat+0x51/0x60 [ 31.935306] [ 31.936903] Freed by task 2982: [ 31.940153] save_stack_trace+0x16/0x20 [ 31.944100] save_stack+0x43/0xd0 [ 31.947520] kasan_slab_free+0x71/0xc0 [ 31.951378] kfree+0xca/0x250 [ 31.954454] kvfree+0x36/0x60 [ 31.957528] free_netdev+0x2cf/0x360 [ 31.961209] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.965412] tun_chr_compat_ioctl+0x29/0x30 [ 31.969702] compat_SyS_ioctl+0x1d7/0x3290 [ 31.973907] do_fast_syscall_32+0x3f2/0xf05 [ 31.978198] entry_SYSENTER_compat+0x51/0x60 [ 31.982571] [ 31.984170] The buggy address belongs to the object at ffff8801ce2283c0 [ 31.984170] which belongs to the cache kmalloc-16384 of size 16384 [ 31.997143] The buggy address is located 13312 bytes inside of [ 31.997143] 16384-byte region [ffff8801ce2283c0, ffff8801ce22c3c0) [ 32.009330] The buggy address belongs to the page: [ 32.014231] page:ffffea0007388a00 count:1 mapcount:0 mapping:ffff8801ce2283c0 index:0x0 compound_mapcount: 0 [ 32.024174] flags: 0x200000000008100(slab|head) [ 32.028813] raw: 0200000000008100 ffff8801ce2283c0 0000000000000000 0000000100000001 [ 32.036662] raw: ffffea000738a820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.044509] page dumped because: kasan: bad access detected [ 32.050184] [ 32.051779] Memory state around the buggy address: [ 32.056677] ffff8801ce22b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.064005] ffff8801ce22b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.071330] >ffff8801ce22b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.079189] ^ [ 32.084611] ffff8801ce22b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.091946] ffff8801ce22b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.099272] ================================================================== [ 32.106597] Disabling lock debugging due to kernel taint [ 32.112010] Kernel panic - not syncing: panic_on_warn set ... [ 32.112010] [ 32.119336] CPU: 0 PID: 2982 Comm: syzkaller248883 Tainted: G B 4.14.0-rc2+ #14 [ 32.127874] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.137192] Call Trace: [ 32.139749] dump_stack+0x194/0x257 [ 32.143342] ? arch_local_irq_restore+0x53/0x53 [ 32.147976] ? vprintk_default+0x28/0x30 [ 32.152007] ? detach_if_pending+0x540/0x610 [ 32.156385] panic+0x1e4/0x417 [ 32.159541] ? __warn+0x1d9/0x1d9 [ 32.162966] ? detach_if_pending+0x557/0x610 [ 32.167341] kasan_end_report+0x50/0x50 [ 32.171279] kasan_report+0x144/0x340 [ 32.175045] __asan_report_store8_noabort+0x17/0x20 [ 32.180024] detach_if_pending+0x557/0x610 [ 32.184223] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.189378] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.194008] ? lock_timer_base+0x1a3/0x2b0 [ 32.198206] ? lock_timer_base+0x1eb/0x2b0 [ 32.202405] ? __internal_add_timer+0x2d0/0x2d0 [ 32.207043] ? trace_hardirqs_on+0xd/0x10 [ 32.211161] try_to_del_timer_sync+0xa2/0x120 [ 32.215619] ? del_timer+0x130/0x130 [ 32.219296] ? del_timer_sync+0xeb/0x240 [ 32.223322] del_timer_sync+0x18a/0x240 [ 32.227261] tun_free_netdev+0x105/0x1b0 [ 32.231284] ? tun_xdp+0x410/0x410 [ 32.234788] ? cpumask_next+0x24/0x30 [ 32.238556] ? netdev_refcnt_read+0xed/0x150 [ 32.242929] ? tun_xdp+0x410/0x410 [ 32.246436] netdev_run_todo+0x870/0xca0 [ 32.250469] ? do_group_exit+0x149/0x400 [ 32.254500] ? register_netdev+0x30/0x30 [ 32.258528] ? lock_downgrade+0x990/0x990 [ 32.262641] ? trace_hardirqs_on+0xd/0x10 [ 32.266765] ? refcount_sub_and_test+0x115/0x1b0 [ 32.271484] ? refcount_inc+0x50/0x50 [ 32.275248] ? refcount_inc+0x50/0x50 [ 32.279015] ? sk_destruct+0x4c/0x80 [ 32.282693] ? __sk_free+0x5c/0x230 [ 32.286284] ? sk_free+0x2f/0x40 [ 32.289613] ? __tun_detach+0x176/0x1390 [ 32.293646] ? tun_attach+0xf90/0xf90 [ 32.297419] ? locks_remove_file+0x3fa/0x5a0 [ 32.301793] ? fcntl_setlk+0x10d0/0x10d0 [ 32.305820] ? __fsnotify_parent+0xb4/0x3a0 [ 32.310105] ? fsnotify+0x1af0/0x1af0 [ 32.313872] ? __tun_detach+0x1390/0x1390 [ 32.317983] ? __tun_detach+0x1390/0x1390 [ 32.322094] rtnl_unlock+0xe/0x10 [ 32.325510] tun_chr_close+0x49/0x60 [ 32.329188] __fput+0x333/0x7f0 [ 32.332435] ? fput+0x140/0x140 [ 32.335678] ? check_same_owner+0x320/0x320 [ 32.339966] ____fput+0x15/0x20 [ 32.343210] task_work_run+0x199/0x270 [ 32.347064] ? task_work_cancel+0x210/0x210 [ 32.351349] ? free_nsproxy+0x185/0x1f0 [ 32.355287] ? switch_task_namespaces+0xa2/0xc0 [ 32.359923] do_exit+0x9d2/0x1af0 [ 32.363339] ? trace_hardirqs_on+0xd/0x10 [ 32.367454] ? mm_update_next_owner+0x930/0x930 [ 32.372084] ? lock_acquire+0x1d5/0x580 [ 32.376022] ? __handle_mm_fault+0xf07/0x39c0 [ 32.380482] ? lock_release+0xd70/0xd70 [ 32.384419] ? check_noncircular+0x20/0x20 [ 32.388622] ? kvfree+0x3b/0x60 [ 32.391867] ? rtnl_unlock+0xe/0x10 [ 32.395459] ? check_noncircular+0x20/0x20 [ 32.399657] ? __handle_mm_fault+0x587/0x39c0 [ 32.404121] ? __pmd_alloc+0x4e0/0x4e0 [ 32.407977] ? find_held_lock+0x39/0x1d0 [ 32.412007] ? lock_downgrade+0x990/0x990 [ 32.416130] do_group_exit+0x149/0x400 [ 32.419979] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.424526] ? vmacache_find+0x5f/0x280 [ 32.428463] ? SyS_exit+0x30/0x30 [ 32.431883] ? do_fast_syscall_32+0x158/0xf05 [ 32.436340] ? do_group_exit+0x400/0x400 [ 32.440364] SyS_exit_group+0x1d/0x20 [ 32.444129] do_fast_syscall_32+0x3f2/0xf05 [ 32.448419] ? do_int80_syscall_32+0x940/0x940 [ 32.452967] ? lockdep_sys_exit+0x47/0xf0 [ 32.457078] ? syscall_return_slowpath+0x2b3/0x510 [ 32.461972] ? finish_task_switch+0x1aa/0x740 [ 32.466435] ? lockdep_sys_exit+0x47/0xf0 [ 32.470546] ? retint_user+0x18/0x20 [ 32.474226] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.479037] entry_SYSENTER_compat+0x51/0x60 [ 32.483411] RIP: 0023:0xf7f60c79 [ 32.486738] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 32.494407] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 32.501642] RDX: 0000000000000001 RSI: 0000000020982fd8 RDI: 00000000400454ca [ 32.508874] RBP: 0000000008072cf6 R08: 0000000000000000 R09: 0000000000000000 [ 32.516108] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.523343] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000