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.15.212' (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: [ 22.977269] ================================================================== [ 22.978371] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 22.979272] Write of size 8 at addr ffff8801ce5fb780 by task syzkaller845496/2975 [ 22.980270] [ 22.980505] CPU: 1 PID: 2975 Comm: syzkaller845496 Not tainted 4.14.0-rc2+ #20 [ 22.981471] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 22.982694] Call Trace: [ 22.983055] dump_stack+0x194/0x257 [ 22.983551] ? arch_local_irq_restore+0x53/0x53 [ 22.984176] ? show_regs_print_info+0x65/0x65 [ 22.984792] ? lock_timer_base+0x1a3/0x2b0 [ 22.985366] ? detach_if_pending+0x557/0x610 [ 22.985961] print_address_description+0x73/0x250 [ 22.986608] ? detach_if_pending+0x557/0x610 [ 22.987227] kasan_report+0x25b/0x340 [ 22.987748] __asan_report_store8_noabort+0x17/0x20 [ 22.988446] detach_if_pending+0x557/0x610 [ 22.989070] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.989788] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.990426] ? lock_timer_base+0x1a3/0x2b0 [ 22.991279] ? lock_timer_base+0x1eb/0x2b0 [ 22.992032] ? __internal_add_timer+0x2d0/0x2d0 [ 22.992659] ? trace_hardirqs_on+0xd/0x10 [ 22.993226] try_to_del_timer_sync+0xa2/0x120 [ 22.993841] ? del_timer+0x130/0x130 [ 22.994345] ? del_timer_sync+0xeb/0x240 [ 22.994899] del_timer_sync+0x18a/0x240 [ 22.995442] tun_free_netdev+0x105/0x1b0 [ 22.995989] ? tun_xdp+0x410/0x410 [ 22.996467] ? cpumask_next+0x24/0x30 [ 22.996984] ? netdev_refcnt_read+0xed/0x150 [ 22.997578] ? tun_xdp+0x410/0x410 [ 23.001088] netdev_run_todo+0x870/0xca0 [ 23.005120] ? do_group_exit+0x149/0x400 [ 23.009161] ? register_netdev+0x30/0x30 [ 23.013198] ? lock_downgrade+0x990/0x990 [ 23.017330] ? trace_hardirqs_on+0xd/0x10 [ 23.021475] ? refcount_sub_and_test+0x115/0x1b0 [ 23.026204] ? refcount_inc+0x50/0x50 [ 23.029980] ? refcount_inc+0x50/0x50 [ 23.033758] ? sk_destruct+0x4c/0x80 [ 23.037444] ? __sk_free+0x5c/0x230 [ 23.041042] ? sk_free+0x2f/0x40 [ 23.044384] ? __tun_detach+0x176/0x1390 [ 23.048427] ? tun_attach+0xf90/0xf90 [ 23.052203] ? do_raw_spin_trylock+0x190/0x190 [ 23.056758] ? locks_remove_file+0x3fa/0x5a0 [ 23.061138] ? fcntl_setlk+0x10d0/0x10d0 [ 23.065171] ? __fsnotify_parent+0xb4/0x3a0 [ 23.069468] ? fsnotify+0x1af0/0x1af0 [ 23.073243] ? __tun_detach+0x1390/0x1390 [ 23.077373] ? __tun_detach+0x1390/0x1390 [ 23.081499] rtnl_unlock+0xe/0x10 [ 23.084921] tun_chr_close+0x49/0x60 [ 23.088605] __fput+0x333/0x7f0 [ 23.091859] ? fput+0x140/0x140 [ 23.095112] ? check_same_owner+0x320/0x320 [ 23.099403] ? _raw_spin_unlock_irq+0x27/0x70 [ 23.103873] ____fput+0x15/0x20 [ 23.107126] task_work_run+0x199/0x270 [ 23.110987] ? task_work_cancel+0x210/0x210 [ 23.115317] ? _raw_spin_unlock+0x22/0x30 [ 23.119437] ? switch_task_namespaces+0x87/0xc0 [ 23.124080] do_exit+0x9d2/0x1af0 [ 23.127508] ? mm_update_next_owner+0x930/0x930 [ 23.132148] ? lock_acquire+0x1d5/0x580 [ 23.136094] ? __handle_mm_fault+0xf07/0x39c0 [ 23.140565] ? lock_release+0xd70/0xd70 [ 23.144509] ? check_noncircular+0x20/0x20 [ 23.148716] ? kvfree+0x3b/0x60 [ 23.151973] ? rtnl_unlock+0xe/0x10 [ 23.155571] ? check_noncircular+0x20/0x20 [ 23.159778] ? __handle_mm_fault+0x587/0x39c0 [ 23.164258] ? __pmd_alloc+0x4e0/0x4e0 [ 23.168128] ? find_held_lock+0x39/0x1d0 [ 23.172169] ? lock_downgrade+0x990/0x990 [ 23.176311] do_group_exit+0x149/0x400 [ 23.180167] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.184719] ? vmacache_find+0x5f/0x280 [ 23.188664] ? SyS_exit+0x30/0x30 [ 23.192092] ? do_fast_syscall_32+0x158/0xf05 [ 23.196557] ? do_group_exit+0x400/0x400 [ 23.200587] SyS_exit_group+0x1d/0x20 [ 23.204356] do_fast_syscall_32+0x3f2/0xf05 [ 23.208653] ? do_int80_syscall_32+0x940/0x940 [ 23.213212] ? kasan_check_read+0x11/0x20 [ 23.217340] ? syscall_return_slowpath+0x510/0x510 [ 23.222242] ? SyS_rt_sigaction+0x94/0x1b0 [ 23.226450] ? lockdep_sys_exit+0x47/0xf0 [ 23.230566] ? retint_user+0x18/0x20 [ 23.234255] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 23.239076] entry_SYSENTER_compat+0x51/0x60 [ 23.243452] RIP: 0023:0xf7f8ec79 [ 23.246786] RSP: 002b:00000000ff8fe2dc EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 23.254468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 23.261709] RDX: 0000000000000000 RSI: 00000000080db718 RDI: 00000000080f22a0 [ 23.268949] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 23.276361] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 23.283600] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 23.290861] [ 23.292460] Allocated by task 2975: [ 23.296067] save_stack_trace+0x16/0x20 [ 23.300016] save_stack+0x43/0xd0 [ 23.303444] kasan_kmalloc+0xad/0xe0 [ 23.307183] __kmalloc_node+0x47/0x70 [ 23.310952] kvmalloc_node+0x64/0xd0 [ 23.314635] alloc_netdev_mqs+0x16e/0xed0 [ 23.318751] __tun_chr_ioctl+0x12be/0x3d20 [ 23.322958] tun_chr_compat_ioctl+0x29/0x30 [ 23.327250] compat_SyS_ioctl+0x1d7/0x3290 [ 23.331453] do_fast_syscall_32+0x3f2/0xf05 [ 23.335744] entry_SYSENTER_compat+0x51/0x60 [ 23.340118] [ 23.341715] Freed by task 2975: [ 23.344962] save_stack_trace+0x16/0x20 [ 23.348912] save_stack+0x43/0xd0 [ 23.352333] kasan_slab_free+0x71/0xc0 [ 23.356189] kfree+0xca/0x250 [ 23.359262] kvfree+0x36/0x60 [ 23.362336] free_netdev+0x2cf/0x360 [ 23.366015] __tun_chr_ioctl+0x2cf6/0x3d20 [ 23.370225] tun_chr_compat_ioctl+0x29/0x30 [ 23.374515] compat_SyS_ioctl+0x1d7/0x3290 [ 23.378718] do_fast_syscall_32+0x3f2/0xf05 [ 23.383007] entry_SYSENTER_compat+0x51/0x60 [ 23.387382] [ 23.388982] The buggy address belongs to the object at ffff8801ce5f8380 [ 23.388982] which belongs to the cache kmalloc-16384 of size 16384 [ 23.401953] The buggy address is located 13312 bytes inside of [ 23.401953] 16384-byte region [ffff8801ce5f8380, ffff8801ce5fc380) [ 23.414139] The buggy address belongs to the page: [ 23.419037] page:ffffea0007397e00 count:1 mapcount:0 mapping:ffff8801ce5f8380 index:0x0 compound_mapcount: 0 [ 23.428977] flags: 0x200000000008100(slab|head) [ 23.433616] raw: 0200000000008100 ffff8801ce5f8380 0000000000000000 0000000100000001 [ 23.441463] raw: ffffea00073d1020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 23.449309] page dumped because: kasan: bad access detected [ 23.454985] [ 23.456582] Memory state around the buggy address: [ 23.461479] ffff8801ce5fb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.468803] ffff8801ce5fb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.476130] >ffff8801ce5fb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.483454] ^ [ 23.486788] ffff8801ce5fb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.494115] ffff8801ce5fb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.501439] ================================================================== [ 23.508762] Disabling lock debugging due to kernel taint [ 23.514173] Kernel panic - not syncing: panic_on_warn set ... [ 23.514173] [ 23.521498] CPU: 1 PID: 2975 Comm: syzkaller845496 Tainted: G B 4.14.0-rc2+ #20 [ 23.530031] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 23.539782] Call Trace: [ 23.542339] dump_stack+0x194/0x257 [ 23.545938] ? arch_local_irq_restore+0x53/0x53 [ 23.550571] ? vprintk_default+0x28/0x30 [ 23.554598] ? detach_if_pending+0x4d0/0x610 [ 23.558976] panic+0x1e4/0x417 [ 23.562136] ? __warn+0x1d9/0x1d9 [ 23.565568] ? detach_if_pending+0x557/0x610 [ 23.569946] kasan_end_report+0x50/0x50 [ 23.573884] kasan_report+0x144/0x340 [ 23.577654] __asan_report_store8_noabort+0x17/0x20 [ 23.582645] detach_if_pending+0x557/0x610 [ 23.586861] ? trace_raw_output_tick_stop+0x130/0x130 [ 23.592028] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 23.596659] ? lock_timer_base+0x1a3/0x2b0 [ 23.600860] ? lock_timer_base+0x1eb/0x2b0 [ 23.605059] ? __internal_add_timer+0x2d0/0x2d0 [ 23.609693] ? trace_hardirqs_on+0xd/0x10 [ 23.613809] try_to_del_timer_sync+0xa2/0x120 [ 23.618537] ? del_timer+0x130/0x130 [ 23.622214] ? del_timer_sync+0xeb/0x240 [ 23.626242] del_timer_sync+0x18a/0x240 [ 23.630183] tun_free_netdev+0x105/0x1b0 [ 23.634206] ? tun_xdp+0x410/0x410 [ 23.637710] ? cpumask_next+0x24/0x30 [ 23.641476] ? netdev_refcnt_read+0xed/0x150 [ 23.645847] ? tun_xdp+0x410/0x410 [ 23.649353] netdev_run_todo+0x870/0xca0 [ 23.653377] ? do_group_exit+0x149/0x400 [ 23.657403] ? register_netdev+0x30/0x30 [ 23.661429] ? lock_downgrade+0x990/0x990 [ 23.665539] ? trace_hardirqs_on+0xd/0x10 [ 23.669661] ? refcount_sub_and_test+0x115/0x1b0 [ 23.674382] ? refcount_inc+0x50/0x50 [ 23.678147] ? refcount_inc+0x50/0x50 [ 23.681912] ? sk_destruct+0x4c/0x80 [ 23.685587] ? __sk_free+0x5c/0x230 [ 23.689178] ? sk_free+0x2f/0x40 [ 23.692509] ? __tun_detach+0x176/0x1390 [ 23.696547] ? tun_attach+0xf90/0xf90 [ 23.700316] ? do_raw_spin_trylock+0x190/0x190 [ 23.704862] ? locks_remove_file+0x3fa/0x5a0 [ 23.709236] ? fcntl_setlk+0x10d0/0x10d0 [ 23.713265] ? __fsnotify_parent+0xb4/0x3a0 [ 23.717551] ? fsnotify+0x1af0/0x1af0 [ 23.721317] ? __tun_detach+0x1390/0x1390 [ 23.725437] ? __tun_detach+0x1390/0x1390 [ 23.729549] rtnl_unlock+0xe/0x10 [ 23.732965] tun_chr_close+0x49/0x60 [ 23.736644] __fput+0x333/0x7f0 [ 23.739893] ? fput+0x140/0x140 [ 23.743140] ? check_same_owner+0x320/0x320 [ 23.747426] ? _raw_spin_unlock_irq+0x27/0x70 [ 23.751887] ____fput+0x15/0x20 [ 23.755129] task_work_run+0x199/0x270 [ 23.758982] ? task_work_cancel+0x210/0x210 [ 23.763267] ? _raw_spin_unlock+0x22/0x30 [ 23.767378] ? switch_task_namespaces+0x87/0xc0 [ 23.772014] do_exit+0x9d2/0x1af0 [ 23.775435] ? mm_update_next_owner+0x930/0x930 [ 23.780069] ? lock_acquire+0x1d5/0x580 [ 23.784013] ? __handle_mm_fault+0xf07/0x39c0 [ 23.788481] ? lock_release+0xd70/0xd70 [ 23.792418] ? check_noncircular+0x20/0x20 [ 23.796616] ? kvfree+0x3b/0x60 [ 23.799861] ? rtnl_unlock+0xe/0x10 [ 23.803465] ? check_noncircular+0x20/0x20 [ 23.807667] ? __handle_mm_fault+0x587/0x39c0 [ 23.812129] ? __pmd_alloc+0x4e0/0x4e0 [ 23.815985] ? find_held_lock+0x39/0x1d0 [ 23.820017] ? lock_downgrade+0x990/0x990 [ 23.824141] do_group_exit+0x149/0x400 [ 23.827991] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.832538] ? vmacache_find+0x5f/0x280 [ 23.836473] ? SyS_exit+0x30/0x30 [ 23.839901] ? do_fast_syscall_32+0x158/0xf05 [ 23.844360] ? do_group_exit+0x400/0x400 [ 23.848382] SyS_exit_group+0x1d/0x20 [ 23.852147] do_fast_syscall_32+0x3f2/0xf05 [ 23.856435] ? do_int80_syscall_32+0x940/0x940 [ 23.860986] ? kasan_check_read+0x11/0x20 [ 23.865100] ? syscall_return_slowpath+0x510/0x510 [ 23.869995] ? SyS_rt_sigaction+0x94/0x1b0 [ 23.874198] ? lockdep_sys_exit+0x47/0xf0 [ 23.878310] ? retint_user+0x18/0x20 [ 23.881990] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 23.886807] entry_SYSENTER_compat+0x51/0x60 [ 23.891180] RIP: 0023:0xf7f8ec79 [ 23.894507] RSP: 002b:00000000ff8fe2dc EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 23.902177] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 23.909409] RDX: 0000000000000000 RSI: 00000000080db718 RDI: 00000000080f22a0 [ 23.916642] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 23.923878] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 23.931120] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000