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-4,10.128.15.225' (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: [ 30.535296] ================================================================== [ 30.542733] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 30.549460] Write of size 8 at addr ffff8801ccd63780 by task syzkaller713489/2981 [ 30.557056] [ 30.558658] CPU: 1 PID: 2981 Comm: syzkaller713489 Not tainted 4.14.0-rc2+ #20 [ 30.565990] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 30.575325] Call Trace: [ 30.577902] dump_stack+0x194/0x257 [ 30.581518] ? arch_local_irq_restore+0x53/0x53 [ 30.586172] ? show_regs_print_info+0x65/0x65 [ 30.590641] ? lock_timer_base+0x1a3/0x2b0 [ 30.594847] ? detach_if_pending+0x557/0x610 [ 30.599228] print_address_description+0x73/0x250 [ 30.604041] ? detach_if_pending+0x557/0x610 [ 30.608423] kasan_report+0x25b/0x340 [ 30.612199] __asan_report_store8_noabort+0x17/0x20 [ 30.617186] detach_if_pending+0x557/0x610 [ 30.621395] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.626560] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.631196] ? lock_timer_base+0x1a3/0x2b0 [ 30.635404] ? lock_timer_base+0x1eb/0x2b0 [ 30.639613] ? __internal_add_timer+0x2d0/0x2d0 [ 30.644256] ? trace_hardirqs_on+0xd/0x10 [ 30.648383] try_to_del_timer_sync+0xa2/0x120 [ 30.652850] ? del_timer+0x130/0x130 [ 30.656536] ? del_timer_sync+0xeb/0x240 [ 30.660593] del_timer_sync+0x18a/0x240 [ 30.664575] tun_free_netdev+0x105/0x1b0 [ 30.668608] ? tun_xdp+0x410/0x410 [ 30.672117] ? cpumask_next+0x24/0x30 [ 30.675890] ? netdev_refcnt_read+0xed/0x150 [ 30.680273] ? tun_xdp+0x410/0x410 [ 30.683786] netdev_run_todo+0x870/0xca0 [ 30.687818] ? do_group_exit+0x149/0x400 [ 30.691855] ? register_netdev+0x30/0x30 [ 30.695899] ? do_raw_spin_trylock+0x190/0x190 [ 30.700491] ? refcount_sub_and_test+0x115/0x1b0 [ 30.705233] ? refcount_inc+0x50/0x50 [ 30.709006] ? refcount_inc+0x50/0x50 [ 30.712783] ? sk_destruct+0x4c/0x80 [ 30.716469] ? __sk_free+0x5c/0x230 [ 30.720069] ? sk_free+0x2f/0x40 [ 30.723413] ? __tun_detach+0x176/0x1390 [ 30.727468] ? tun_attach+0xf90/0xf90 [ 30.731251] ? do_raw_spin_trylock+0x190/0x190 [ 30.735816] ? locks_remove_file+0x3fa/0x5a0 [ 30.740200] ? fcntl_setlk+0x10d0/0x10d0 [ 30.744238] ? __fsnotify_parent+0xb4/0x3a0 [ 30.748532] ? fsnotify+0x1af0/0x1af0 [ 30.752308] ? __tun_detach+0x1390/0x1390 [ 30.756438] ? __tun_detach+0x1390/0x1390 [ 30.760561] rtnl_unlock+0xe/0x10 [ 30.763989] tun_chr_close+0x49/0x60 [ 30.767682] __fput+0x333/0x7f0 [ 30.770940] ? fput+0x140/0x140 [ 30.774197] ? check_same_owner+0x320/0x320 [ 30.778496] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.782967] ____fput+0x15/0x20 [ 30.786240] task_work_run+0x199/0x270 [ 30.790101] ? task_work_cancel+0x210/0x210 [ 30.794393] ? _raw_spin_unlock+0x22/0x30 [ 30.798515] ? switch_task_namespaces+0x87/0xc0 [ 30.803161] do_exit+0x9d2/0x1af0 [ 30.806592] ? mm_update_next_owner+0x930/0x930 [ 30.811234] ? lock_acquire+0x1d5/0x580 [ 30.815180] ? __handle_mm_fault+0xf07/0x39c0 [ 30.819654] ? lock_release+0xd70/0xd70 [ 30.823598] ? check_noncircular+0x20/0x20 [ 30.827808] ? kvfree+0x3b/0x60 [ 30.831068] ? rtnl_unlock+0xe/0x10 [ 30.834667] ? check_noncircular+0x20/0x20 [ 30.838877] ? __handle_mm_fault+0x587/0x39c0 [ 30.843347] ? __pmd_alloc+0x4e0/0x4e0 [ 30.847216] ? find_held_lock+0x39/0x1d0 [ 30.851259] ? lock_downgrade+0x990/0x990 [ 30.855403] do_group_exit+0x149/0x400 [ 30.859259] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.863813] ? vmacache_find+0x5f/0x280 [ 30.867758] ? SyS_exit+0x30/0x30 [ 30.871190] ? do_fast_syscall_32+0x158/0xf05 [ 30.875657] ? do_group_exit+0x400/0x400 [ 30.879689] SyS_exit_group+0x1d/0x20 [ 30.883461] do_fast_syscall_32+0x3f2/0xf05 [ 30.887759] ? do_int80_syscall_32+0x940/0x940 [ 30.892313] ? kasan_check_read+0x11/0x20 [ 30.896445] ? syscall_return_slowpath+0x510/0x510 [ 30.901347] ? SyS_rt_sigaction+0x94/0x1b0 [ 30.905555] ? lockdep_sys_exit+0x47/0xf0 [ 30.909674] ? retint_user+0x18/0x20 [ 30.913365] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.918186] entry_SYSENTER_compat+0x51/0x60 [ 30.922565] RIP: 0023:0xf7f0dc79 [ 30.925898] RSP: 002b:00000000ffec847c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 30.933583] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 30.940823] RDX: 0000000000000000 RSI: 00000000080db818 RDI: 00000000080f22a0 [ 30.948073] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 30.955313] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 30.962553] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 30.969811] [ 30.971410] Allocated by task 2981: [ 30.975009] save_stack_trace+0x16/0x20 [ 30.978953] save_stack+0x43/0xd0 [ 30.982378] kasan_kmalloc+0xad/0xe0 [ 30.986060] __kmalloc_node+0x47/0x70 [ 30.989828] kvmalloc_node+0x64/0xd0 [ 30.993513] alloc_netdev_mqs+0x16e/0xed0 [ 30.997631] __tun_chr_ioctl+0x12be/0x3d20 [ 31.001834] tun_chr_compat_ioctl+0x29/0x30 [ 31.006128] compat_SyS_ioctl+0x1d7/0x3290 [ 31.010330] do_fast_syscall_32+0x3f2/0xf05 [ 31.014620] entry_SYSENTER_compat+0x51/0x60 [ 31.018996] [ 31.020592] Freed by task 2981: [ 31.023841] save_stack_trace+0x16/0x20 [ 31.027781] save_stack+0x43/0xd0 [ 31.031206] kasan_slab_free+0x71/0xc0 [ 31.035062] kfree+0xca/0x250 [ 31.038143] kvfree+0x36/0x60 [ 31.041220] free_netdev+0x2cf/0x360 [ 31.044906] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.049108] tun_chr_compat_ioctl+0x29/0x30 [ 31.053398] compat_SyS_ioctl+0x1d7/0x3290 [ 31.057602] do_fast_syscall_32+0x3f2/0xf05 [ 31.061895] entry_SYSENTER_compat+0x51/0x60 [ 31.066269] [ 31.067871] The buggy address belongs to the object at ffff8801ccd60380 [ 31.067871] which belongs to the cache kmalloc-16384 of size 16384 [ 31.080842] The buggy address is located 13312 bytes inside of [ 31.080842] 16384-byte region [ffff8801ccd60380, ffff8801ccd64380) [ 31.093032] The buggy address belongs to the page: [ 31.097934] page:ffffea0007335800 count:1 mapcount:0 mapping:ffff8801ccd60380 index:0x0 compound_mapcount: 0 [ 31.107880] flags: 0x200000000008100(slab|head) [ 31.112520] raw: 0200000000008100 ffff8801ccd60380 0000000000000000 0000000100000001 [ 31.120821] raw: ffffea0007394820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.128669] page dumped because: kasan: bad access detected [ 31.134345] [ 31.135943] Memory state around the buggy address: [ 31.140842] ffff8801ccd63680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.148173] ffff8801ccd63700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.155500] >ffff8801ccd63780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.162827] ^ [ 31.166163] ffff8801ccd63800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.173491] ffff8801ccd63880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.180816] ================================================================== [ 31.188141] Disabling lock debugging due to kernel taint [ 31.193556] Kernel panic - not syncing: panic_on_warn set ... [ 31.193556] [ 31.200884] CPU: 1 PID: 2981 Comm: syzkaller713489 Tainted: G B 4.14.0-rc2+ #20 [ 31.209421] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.218740] Call Trace: [ 31.221297] dump_stack+0x194/0x257 [ 31.224890] ? arch_local_irq_restore+0x53/0x53 [ 31.229523] ? vprintk_default+0x28/0x30 [ 31.233553] ? detach_if_pending+0x4d0/0x610 [ 31.237927] panic+0x1e4/0x417 [ 31.241086] ? __warn+0x1d9/0x1d9 [ 31.244510] ? detach_if_pending+0x557/0x610 [ 31.248883] kasan_end_report+0x50/0x50 [ 31.252821] kasan_report+0x144/0x340 [ 31.256588] __asan_report_store8_noabort+0x17/0x20 [ 31.261568] detach_if_pending+0x557/0x610 [ 31.265770] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.270926] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.275558] ? lock_timer_base+0x1a3/0x2b0 [ 31.279758] ? lock_timer_base+0x1eb/0x2b0 [ 31.283958] ? __internal_add_timer+0x2d0/0x2d0 [ 31.288599] ? trace_hardirqs_on+0xd/0x10 [ 31.292718] try_to_del_timer_sync+0xa2/0x120 [ 31.297178] ? del_timer+0x130/0x130 [ 31.300856] ? del_timer_sync+0xeb/0x240 [ 31.304885] del_timer_sync+0x18a/0x240 [ 31.308826] tun_free_netdev+0x105/0x1b0 [ 31.312851] ? tun_xdp+0x410/0x410 [ 31.316357] ? cpumask_next+0x24/0x30 [ 31.320126] ? netdev_refcnt_read+0xed/0x150 [ 31.324499] ? tun_xdp+0x410/0x410 [ 31.328004] netdev_run_todo+0x870/0xca0 [ 31.332031] ? do_group_exit+0x149/0x400 [ 31.336059] ? register_netdev+0x30/0x30 [ 31.340089] ? do_raw_spin_trylock+0x190/0x190 [ 31.344647] ? refcount_sub_and_test+0x115/0x1b0 [ 31.349366] ? refcount_inc+0x50/0x50 [ 31.353130] ? refcount_inc+0x50/0x50 [ 31.356899] ? sk_destruct+0x4c/0x80 [ 31.360576] ? __sk_free+0x5c/0x230 [ 31.364166] ? sk_free+0x2f/0x40 [ 31.367498] ? __tun_detach+0x176/0x1390 [ 31.371529] ? tun_attach+0xf90/0xf90 [ 31.375296] ? do_raw_spin_trylock+0x190/0x190 [ 31.379846] ? locks_remove_file+0x3fa/0x5a0 [ 31.384223] ? fcntl_setlk+0x10d0/0x10d0 [ 31.388255] ? __fsnotify_parent+0xb4/0x3a0 [ 31.392546] ? fsnotify+0x1af0/0x1af0 [ 31.396314] ? __tun_detach+0x1390/0x1390 [ 31.400427] ? __tun_detach+0x1390/0x1390 [ 31.404540] rtnl_unlock+0xe/0x10 [ 31.407957] tun_chr_close+0x49/0x60 [ 31.411638] __fput+0x333/0x7f0 [ 31.414886] ? fput+0x140/0x140 [ 31.418132] ? check_same_owner+0x320/0x320 [ 31.422419] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.426880] ____fput+0x15/0x20 [ 31.430126] task_work_run+0x199/0x270 [ 31.433977] ? task_work_cancel+0x210/0x210 [ 31.438262] ? _raw_spin_unlock+0x22/0x30 [ 31.442374] ? switch_task_namespaces+0x87/0xc0 [ 31.447009] do_exit+0x9d2/0x1af0 [ 31.450430] ? mm_update_next_owner+0x930/0x930 [ 31.455077] ? lock_acquire+0x1d5/0x580 [ 31.459014] ? __handle_mm_fault+0xf07/0x39c0 [ 31.463475] ? lock_release+0xd70/0xd70 [ 31.467414] ? check_noncircular+0x20/0x20 [ 31.471621] ? kvfree+0x3b/0x60 [ 31.474869] ? rtnl_unlock+0xe/0x10 [ 31.478460] ? check_noncircular+0x20/0x20 [ 31.482660] ? __handle_mm_fault+0x587/0x39c0 [ 31.487120] ? __pmd_alloc+0x4e0/0x4e0 [ 31.490977] ? find_held_lock+0x39/0x1d0 [ 31.495007] ? lock_downgrade+0x990/0x990 [ 31.499131] do_group_exit+0x149/0x400 [ 31.502983] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.507530] ? vmacache_find+0x5f/0x280 [ 31.511468] ? SyS_exit+0x30/0x30 [ 31.514891] ? do_fast_syscall_32+0x158/0xf05 [ 31.519352] ? do_group_exit+0x400/0x400 [ 31.523375] SyS_exit_group+0x1d/0x20 [ 31.527139] do_fast_syscall_32+0x3f2/0xf05 [ 31.531429] ? do_int80_syscall_32+0x940/0x940