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.4' (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: [ 41.353293] ================================================================== [ 41.360746] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.367471] Write of size 8 at addr ffff8801ce20b740 by task syzkaller172162/2986 [ 41.375059] [ 41.376660] CPU: 0 PID: 2986 Comm: syzkaller172162 Not tainted 4.14.0-rc2+ #20 [ 41.383999] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.393324] Call Trace: [ 41.395886] dump_stack+0x194/0x257 [ 41.399486] ? arch_local_irq_restore+0x53/0x53 [ 41.404127] ? show_regs_print_info+0x65/0x65 [ 41.408597] ? lock_timer_base+0x1a3/0x2b0 [ 41.412804] ? detach_if_pending+0x557/0x610 [ 41.417191] print_address_description+0x73/0x250 [ 41.422006] ? detach_if_pending+0x557/0x610 [ 41.426387] kasan_report+0x25b/0x340 [ 41.430162] __asan_report_store8_noabort+0x17/0x20 [ 41.435151] detach_if_pending+0x557/0x610 [ 41.439363] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.444527] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.449164] ? lock_timer_base+0x1a3/0x2b0 [ 41.453372] ? lock_timer_base+0x1eb/0x2b0 [ 41.457582] ? __internal_add_timer+0x2d0/0x2d0 [ 41.462226] ? trace_hardirqs_on+0xd/0x10 [ 41.466353] try_to_del_timer_sync+0xa2/0x120 [ 41.470818] ? del_timer+0x130/0x130 [ 41.474504] ? del_timer_sync+0xeb/0x240 [ 41.478544] del_timer_sync+0x18a/0x240 [ 41.482493] tun_free_netdev+0x105/0x1b0 [ 41.486525] ? tun_xdp+0x410/0x410 [ 41.490034] ? cpumask_next+0x24/0x30 [ 41.493817] ? netdev_refcnt_read+0xed/0x150 [ 41.498201] ? tun_xdp+0x410/0x410 [ 41.501712] netdev_run_todo+0x870/0xca0 [ 41.505744] ? do_group_exit+0x149/0x400 [ 41.509779] ? register_netdev+0x30/0x30 [ 41.513814] ? lock_downgrade+0x990/0x990 [ 41.517935] ? trace_hardirqs_on+0xd/0x10 [ 41.522072] ? refcount_sub_and_test+0x115/0x1b0 [ 41.526797] ? refcount_inc+0x50/0x50 [ 41.530572] ? refcount_inc+0x50/0x50 [ 41.534349] ? sk_destruct+0x4c/0x80 [ 41.538033] ? __sk_free+0x5c/0x230 [ 41.541631] ? sk_free+0x2f/0x40 [ 41.544971] ? __tun_detach+0x176/0x1390 [ 41.549014] ? tun_attach+0xf90/0xf90 [ 41.552787] ? do_raw_spin_trylock+0x190/0x190 [ 41.557343] ? locks_remove_file+0x3fa/0x5a0 [ 41.561728] ? fcntl_setlk+0x10d0/0x10d0 [ 41.565761] ? __fsnotify_parent+0xb4/0x3a0 [ 41.570055] ? fsnotify+0x1af0/0x1af0 [ 41.573828] ? __tun_detach+0x1390/0x1390 [ 41.577947] ? __tun_detach+0x1390/0x1390 [ 41.582066] rtnl_unlock+0xe/0x10 [ 41.585486] tun_chr_close+0x49/0x60 [ 41.589171] __fput+0x333/0x7f0 [ 41.592429] ? fput+0x140/0x140 [ 41.595681] ? check_same_owner+0x320/0x320 [ 41.599970] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.604444] ____fput+0x15/0x20 [ 41.607695] task_work_run+0x199/0x270 [ 41.611557] ? task_work_cancel+0x210/0x210 [ 41.615851] ? _raw_spin_unlock+0x22/0x30 [ 41.619969] ? switch_task_namespaces+0x87/0xc0 [ 41.624611] do_exit+0x9d2/0x1af0 [ 41.628042] ? mm_update_next_owner+0x930/0x930 [ 41.632682] ? lock_acquire+0x1d5/0x580 [ 41.636627] ? __handle_mm_fault+0xf07/0x39c0 [ 41.641109] ? lock_release+0xd70/0xd70 [ 41.645054] ? check_noncircular+0x20/0x20 [ 41.649264] ? kvfree+0x3b/0x60 [ 41.652521] ? rtnl_unlock+0xe/0x10 [ 41.656118] ? check_noncircular+0x20/0x20 [ 41.660327] ? __handle_mm_fault+0x587/0x39c0 [ 41.664802] ? __pmd_alloc+0x4e0/0x4e0 [ 41.668669] ? find_held_lock+0x39/0x1d0 [ 41.672710] ? lock_downgrade+0x990/0x990 [ 41.676855] do_group_exit+0x149/0x400 [ 41.680709] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.685259] ? vmacache_find+0x5f/0x280 [ 41.689203] ? SyS_exit+0x30/0x30 [ 41.692631] ? do_fast_syscall_32+0x158/0xf05 [ 41.697096] ? do_group_exit+0x400/0x400 [ 41.701127] SyS_exit_group+0x1d/0x20 [ 41.704899] do_fast_syscall_32+0x3f2/0xf05 [ 41.709196] ? do_int80_syscall_32+0x940/0x940 [ 41.713749] ? kasan_check_read+0x11/0x20 [ 41.717868] ? syscall_return_slowpath+0x510/0x510 [ 41.722769] ? SyS_rt_sigaction+0x94/0x1b0 [ 41.726977] ? lockdep_sys_exit+0x47/0xf0 [ 41.731093] ? retint_user+0x18/0x20 [ 41.734782] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 41.739602] entry_SYSENTER_compat+0x51/0x60 [ 41.743991] RIP: 0023:0xf7f17c79 [ 41.747326] RSP: 002b:00000000ffe57e6c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 41.755009] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 41.762251] RDX: 0000000000000000 RSI: 00000000080dae18 RDI: 00000000080f12a0 [ 41.769491] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 41.776730] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 41.783978] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 41.791238] [ 41.792837] Allocated by task 2986: [ 41.796437] save_stack_trace+0x16/0x20 [ 41.800383] save_stack+0x43/0xd0 [ 41.803803] kasan_kmalloc+0xad/0xe0 [ 41.807484] __kmalloc_node+0x47/0x70 [ 41.811254] kvmalloc_node+0x64/0xd0 [ 41.814941] alloc_netdev_mqs+0x16e/0xed0 [ 41.819067] __tun_chr_ioctl+0x12be/0x3d20 [ 41.823271] tun_chr_compat_ioctl+0x29/0x30 [ 41.827562] compat_SyS_ioctl+0x1d7/0x3290 [ 41.831767] do_fast_syscall_32+0x3f2/0xf05 [ 41.836061] entry_SYSENTER_compat+0x51/0x60 [ 41.840434] [ 41.842031] Freed by task 2986: [ 41.845279] save_stack_trace+0x16/0x20 [ 41.849220] save_stack+0x43/0xd0 [ 41.852652] kasan_slab_free+0x71/0xc0 [ 41.856509] kfree+0xca/0x250 [ 41.859585] kvfree+0x36/0x60 [ 41.862659] free_netdev+0x2cf/0x360 [ 41.866343] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.870545] tun_chr_compat_ioctl+0x29/0x30 [ 41.874837] compat_SyS_ioctl+0x1d7/0x3290 [ 41.879040] do_fast_syscall_32+0x3f2/0xf05 [ 41.883347] entry_SYSENTER_compat+0x51/0x60 [ 41.887722] [ 41.889320] The buggy address belongs to the object at ffff8801ce208340 [ 41.889320] which belongs to the cache kmalloc-16384 of size 16384 [ 41.902293] The buggy address is located 13312 bytes inside of [ 41.902293] 16384-byte region [ffff8801ce208340, ffff8801ce20c340) [ 41.914480] The buggy address belongs to the page: [ 41.919380] page:ffffea0007388200 count:1 mapcount:0 mapping:ffff8801ce208340 index:0x0 compound_mapcount: 0 [ 41.929324] flags: 0x200000000008100(slab|head) [ 41.933967] raw: 0200000000008100 ffff8801ce208340 0000000000000000 0000000100000001 [ 41.941818] raw: ffffea000741e420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.949797] page dumped because: kasan: bad access detected [ 41.955478] [ 41.957075] Memory state around the buggy address: [ 41.961973] ffff8801ce20b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.969301] ffff8801ce20b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.976631] >ffff8801ce20b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.983959] ^ [ 41.989377] ffff8801ce20b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.996705] ffff8801ce20b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.004031] ================================================================== [ 42.011357] Disabling lock debugging due to kernel taint [ 42.016770] Kernel panic - not syncing: panic_on_warn set ... [ 42.016770] [ 42.024097] CPU: 0 PID: 2986 Comm: syzkaller172162 Tainted: G B 4.14.0-rc2+ #20 [ 42.032634] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.041950] Call Trace: [ 42.044511] dump_stack+0x194/0x257 [ 42.048105] ? arch_local_irq_restore+0x53/0x53 [ 42.052740] ? vprintk_default+0x28/0x30 [ 42.056768] ? detach_if_pending+0x4d0/0x610 [ 42.061145] panic+0x1e4/0x417 [ 42.064303] ? __warn+0x1d9/0x1d9 [ 42.067727] ? detach_if_pending+0x557/0x610 [ 42.072100] kasan_end_report+0x50/0x50 [ 42.076038] kasan_report+0x144/0x340 [ 42.079803] __asan_report_store8_noabort+0x17/0x20 [ 42.084781] detach_if_pending+0x557/0x610 [ 42.088980] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.094135] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.098766] ? lock_timer_base+0x1a3/0x2b0 [ 42.102964] ? lock_timer_base+0x1eb/0x2b0 [ 42.107164] ? __internal_add_timer+0x2d0/0x2d0 [ 42.111802] ? trace_hardirqs_on+0xd/0x10 [ 42.115920] try_to_del_timer_sync+0xa2/0x120 [ 42.120379] ? del_timer+0x130/0x130 [ 42.124058] ? del_timer_sync+0xeb/0x240 [ 42.128087] del_timer_sync+0x18a/0x240 [ 42.132029] tun_free_netdev+0x105/0x1b0 [ 42.136053] ? tun_xdp+0x410/0x410 [ 42.139558] ? cpumask_next+0x24/0x30 [ 42.143329] ? netdev_refcnt_read+0xed/0x150 [ 42.147705] ? tun_xdp+0x410/0x410 [ 42.151212] netdev_run_todo+0x870/0xca0 [ 42.155237] ? do_group_exit+0x149/0x400 [ 42.159265] ? register_netdev+0x30/0x30 [ 42.163294] ? lock_downgrade+0x990/0x990 [ 42.167410] ? trace_hardirqs_on+0xd/0x10 [ 42.171534] ? refcount_sub_and_test+0x115/0x1b0 [ 42.176255] ? refcount_inc+0x50/0x50 [ 42.180021] ? refcount_inc+0x50/0x50 [ 42.183790] ? sk_destruct+0x4c/0x80 [ 42.187467] ? __sk_free+0x5c/0x230 [ 42.191060] ? sk_free+0x2f/0x40 [ 42.194392] ? __tun_detach+0x176/0x1390 [ 42.198422] ? tun_attach+0xf90/0xf90 [ 42.202190] ? do_raw_spin_trylock+0x190/0x190 [ 42.206741] ? locks_remove_file+0x3fa/0x5a0 [ 42.211115] ? fcntl_setlk+0x10d0/0x10d0 [ 42.215142] ? __fsnotify_parent+0xb4/0x3a0 [ 42.219431] ? fsnotify+0x1af0/0x1af0 [ 42.223196] ? __tun_detach+0x1390/0x1390 [ 42.227307] ? __tun_detach+0x1390/0x1390 [ 42.231422] rtnl_unlock+0xe/0x10 [ 42.234840] tun_chr_close+0x49/0x60 [ 42.238522] __fput+0x333/0x7f0 [ 42.241769] ? fput+0x140/0x140 [ 42.245015] ? check_same_owner+0x320/0x320 [ 42.249301] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.253761] ____fput+0x15/0x20 [ 42.257007] task_work_run+0x199/0x270 [ 42.260858] ? task_work_cancel+0x210/0x210 [ 42.265145] ? _raw_spin_unlock+0x22/0x30 [ 42.269260] ? switch_task_namespaces+0x87/0xc0 [ 42.273898] do_exit+0x9d2/0x1af0 [ 42.277319] ? mm_update_next_owner+0x930/0x930 [ 42.281951] ? lock_acquire+0x1d5/0x580 [ 42.285889] ? __handle_mm_fault+0xf07/0x39c0 [ 42.290355] ? lock_release+0xd70/0xd70 [ 42.294292] ? check_noncircular+0x20/0x20 [ 42.298494] ? kvfree+0x3b/0x60 [ 42.301743] ? rtnl_unlock+0xe/0x10 [ 42.305335] ? check_noncircular+0x20/0x20 [ 42.309534] ? __handle_mm_fault+0x587/0x39c0 [ 42.313996] ? __pmd_alloc+0x4e0/0x4e0 [ 42.317854] ? find_held_lock+0x39/0x1d0 [ 42.321886] ? lock_downgrade+0x990/0x990 [ 42.326013] do_group_exit+0x149/0x400 [ 42.329863] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.334410] ? vmacache_find+0x5f/0x280 [ 42.338349] ? SyS_exit+0x30/0x30 [ 42.341770] ? do_fast_syscall_32+0x158/0xf05 [ 42.346230] ? do_group_exit+0x400/0x400 [ 42.350255] SyS_exit_group+0x1d/0x20