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-2,10.128.0.35' (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: [ 32.568264] ================================================================== [ 32.569388] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.570293] Write of size 8 at addr ffff8801d272b6b8 by task syzkaller308074/2992 [ 32.571289] [ 32.571524] CPU: 0 PID: 2992 Comm: syzkaller308074 Not tainted 4.14.0-rc5+ #52 [ 32.572505] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.573723] Call Trace: [ 32.574080] dump_stack+0x194/0x257 [ 32.574571] ? arch_local_irq_restore+0x53/0x53 [ 32.575192] ? show_regs_print_info+0x65/0x65 [ 32.575790] ? lock_acquire+0x1d5/0x580 [ 32.576322] ? lock_timer_base+0x1a3/0x2b0 [ 32.576889] ? detach_if_pending+0x557/0x610 [ 32.577481] print_address_description+0x73/0x250 [ 32.578124] ? detach_if_pending+0x557/0x610 [ 32.578727] kasan_report+0x25b/0x340 [ 32.579241] __asan_report_store8_noabort+0x17/0x20 [ 32.579904] detach_if_pending+0x557/0x610 [ 32.580487] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.581177] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.581795] ? lock_timer_base+0x1a3/0x2b0 [ 32.582362] ? lock_timer_base+0x1eb/0x2b0 [ 32.582933] ? __internal_add_timer+0x2d0/0x2d0 [ 32.583554] ? lock_downgrade+0x990/0x990 [ 32.584106] ? trace_hardirqs_on+0xd/0x10 [ 32.584669] try_to_del_timer_sync+0xa2/0x120 [ 32.585271] ? del_timer+0x130/0x130 [ 32.585770] ? del_timer_sync+0xeb/0x240 [ 32.586324] del_timer_sync+0x18a/0x240 [ 32.586861] tun_free_netdev+0x105/0x1b0 [ 32.587405] ? tun_xdp+0x410/0x410 [ 32.587895] ? cpumask_next+0x24/0x30 [ 32.588407] ? netdev_refcnt_read+0xed/0x150 [ 32.592785] ? tun_xdp+0x410/0x410 [ 32.596290] netdev_run_todo+0x870/0xca0 [ 32.600317] ? do_group_exit+0x149/0x400 [ 32.604348] ? mark_held_locks+0xaf/0x100 [ 32.608466] ? register_netdev+0x30/0x30 [ 32.612497] ? find_held_lock+0x35/0x1d0 [ 32.616534] ? lock_downgrade+0x990/0x990 [ 32.620653] ? refcount_sub_and_test+0x115/0x1b0 [ 32.625374] ? refcount_inc+0x50/0x50 [ 32.629139] ? refcount_inc+0x50/0x50 [ 32.632907] ? sk_destruct+0x4c/0x80 [ 32.636585] ? __sk_free+0x5c/0x230 [ 32.640180] ? sk_free+0x2f/0x40 [ 32.643510] ? __tun_detach+0x176/0x1390 [ 32.647546] ? tun_attach+0xfa0/0xfa0 [ 32.651317] ? lock_downgrade+0x990/0x990 [ 32.655435] ? locks_remove_file+0x3fa/0x5a0 [ 32.659813] ? fcntl_setlk+0x10c0/0x10c0 [ 32.663842] ? __fsnotify_parent+0xb4/0x3a0 [ 32.668132] ? fsnotify+0x1af0/0x1af0 [ 32.671901] ? __tun_detach+0x1390/0x1390 [ 32.676014] ? __tun_detach+0x1390/0x1390 [ 32.680128] rtnl_unlock+0xe/0x10 [ 32.683547] tun_chr_close+0x49/0x60 [ 32.687228] __fput+0x327/0x7e0 [ 32.690479] ? fput+0x140/0x140 [ 32.693725] ? check_same_owner+0x320/0x320 [ 32.698010] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.702476] ____fput+0x15/0x20 [ 32.705720] task_work_run+0x199/0x270 [ 32.709575] ? task_work_cancel+0x210/0x210 [ 32.713862] ? _raw_spin_unlock+0x22/0x30 [ 32.717976] ? switch_task_namespaces+0x87/0xc0 [ 32.722615] do_exit+0x9b5/0x1ad0 [ 32.726033] ? __handle_mm_fault+0xf07/0x39c0 [ 32.730496] ? mm_update_next_owner+0x930/0x930 [ 32.735128] ? lock_release+0xa40/0xa40 [ 32.739069] ? do_raw_spin_trylock+0x190/0x190 [ 32.743618] ? kfree+0xe4/0x250 [ 32.746862] ? kvfree+0x36/0x60 [ 32.750120] ? __handle_mm_fault+0x587/0x39c0 [ 32.754584] ? check_noncircular+0x20/0x20 [ 32.758785] ? __pmd_alloc+0x4e0/0x4e0 [ 32.762642] ? find_held_lock+0x35/0x1d0 [ 32.766675] ? handle_mm_fault+0x248/0x8d0 [ 32.770876] ? find_held_lock+0x35/0x1d0 [ 32.774912] ? __do_page_fault+0x64c/0xd60 [ 32.779116] ? lock_downgrade+0x990/0x990 [ 32.783236] ? handle_mm_fault+0x410/0x8d0 [ 32.787437] ? down_read_trylock+0xdb/0x170 [ 32.791724] ? __do_page_fault+0x31e/0xd60 [ 32.795924] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.800470] ? vmacache_find+0x5f/0x280 [ 32.804407] ? vmacache_update+0xfe/0x130 [ 32.808524] do_group_exit+0x149/0x400 [ 32.812378] ? __do_page_fault+0x3d6/0xd60 [ 32.816662] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.821037] ? SyS_exit+0x30/0x30 [ 32.824462] ? do_fast_syscall_32+0x158/0xf05 [ 32.828921] ? do_group_exit+0x400/0x400 [ 32.832946] SyS_exit_group+0x1d/0x20 [ 32.836711] do_fast_syscall_32+0x3f2/0xf05 [ 32.841003] ? do_int80_syscall_32+0x940/0x940 [ 32.845549] ? kasan_check_read+0x11/0x20 [ 32.849663] ? syscall_return_slowpath+0x510/0x510 [ 32.854563] ? SyS_rt_sigaction+0x94/0x1b0 [ 32.858762] ? SyS_sigprocmask+0x4b0/0x4b0 [ 32.862959] ? SyS_read+0x184/0x220 [ 32.866554] ? retint_user+0x18/0x20 [ 32.870238] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.875053] entry_SYSENTER_compat+0x51/0x60 [ 32.879427] RIP: 0023:0xf7fadc79 [ 32.882756] RSP: 002b:00000000ffc5e8ec EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 32.890430] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 32.897664] RDX: 0000000000000000 RSI: 00000000080dadb8 RDI: 00000000080f12a0 [ 32.904898] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 32.912133] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.919365] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.926616] [ 32.928210] Allocated by task 2992: [ 32.931801] save_stack_trace+0x16/0x20 [ 32.935738] save_stack+0x43/0xd0 [ 32.939154] kasan_kmalloc+0xad/0xe0 [ 32.942829] __kmalloc_node+0x47/0x70 [ 32.946595] kvmalloc_node+0x64/0xd0 [ 32.950273] alloc_netdev_mqs+0x16e/0xed0 [ 32.954383] __tun_chr_ioctl+0x12b2/0x3d20 [ 32.958582] tun_chr_compat_ioctl+0x29/0x30 [ 32.962866] compat_SyS_ioctl+0x1d7/0x3290 [ 32.967062] do_fast_syscall_32+0x3f2/0xf05 [ 32.971354] entry_SYSENTER_compat+0x51/0x60 [ 32.975724] [ 32.977317] Freed by task 2992: [ 32.980558] save_stack_trace+0x16/0x20 [ 32.984494] save_stack+0x43/0xd0 [ 32.987909] kasan_slab_free+0x71/0xc0 [ 32.991760] kfree+0xca/0x250 [ 32.994831] kvfree+0x36/0x60 [ 32.997900] free_netdev+0x2cf/0x360 [ 33.001580] __tun_chr_ioctl+0x2cea/0x3d20 [ 33.005787] tun_chr_compat_ioctl+0x29/0x30 [ 33.010073] compat_SyS_ioctl+0x1d7/0x3290 [ 33.014269] do_fast_syscall_32+0x3f2/0xf05 [ 33.018553] entry_SYSENTER_compat+0x51/0x60 [ 33.022923] [ 33.024516] The buggy address belongs to the object at ffff8801d2728380 [ 33.024516] which belongs to the cache kmalloc-16384 of size 16384 [ 33.037482] The buggy address is located 13112 bytes inside of [ 33.037482] 16384-byte region [ffff8801d2728380, ffff8801d272c380) [ 33.049663] The buggy address belongs to the page: [ 33.054558] page:ffffea000749ca00 count:1 mapcount:0 mapping:ffff8801d2728380 index:0x0 compound_mapcount: 0 [ 33.064491] flags: 0x200000000008100(slab|head) [ 33.069123] raw: 0200000000008100 ffff8801d2728380 0000000000000000 0000000100000001 [ 33.076967] raw: ffffea000744e220 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 33.084808] page dumped because: kasan: bad access detected [ 33.090481] [ 33.092072] Memory state around the buggy address: [ 33.096965] ffff8801d272b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.104286] ffff8801d272b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.111608] >ffff8801d272b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.118927] ^ [ 33.124076] ffff8801d272b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.131401] ffff8801d272b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.138721] ================================================================== [ 33.146040] Disabling lock debugging due to kernel taint [ 33.151452] Kernel panic - not syncing: panic_on_warn set ... [ 33.151452] [ 33.158777] CPU: 0 PID: 2992 Comm: syzkaller308074 Tainted: G B 4.14.0-rc5+ #52 [ 33.167310] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.176624] Call Trace: [ 33.179174] dump_stack+0x194/0x257 [ 33.182765] ? arch_local_irq_restore+0x53/0x53 [ 33.187398] ? kasan_end_report+0x32/0x50 [ 33.191510] ? lock_downgrade+0x990/0x990 [ 33.195622] ? detach_if_pending+0x540/0x610 [ 33.199996] panic+0x1e4/0x417 [ 33.203150] ? __warn+0x1d9/0x1d9 [ 33.206572] ? detach_if_pending+0x557/0x610 [ 33.210941] kasan_end_report+0x50/0x50 [ 33.214878] kasan_report+0x144/0x340 [ 33.218644] __asan_report_store8_noabort+0x17/0x20 [ 33.223621] detach_if_pending+0x557/0x610 [ 33.227819] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.232971] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.237600] ? lock_timer_base+0x1a3/0x2b0 [ 33.241798] ? lock_timer_base+0x1eb/0x2b0 [ 33.245998] ? __internal_add_timer+0x2d0/0x2d0 [ 33.250628] ? lock_downgrade+0x990/0x990 [ 33.254740] ? trace_hardirqs_on+0xd/0x10 [ 33.258854] try_to_del_timer_sync+0xa2/0x120 [ 33.263310] ? del_timer+0x130/0x130 [ 33.267004] ? del_timer_sync+0xeb/0x240 [ 33.271038] del_timer_sync+0x18a/0x240 [ 33.274978] tun_free_netdev+0x105/0x1b0 [ 33.279001] ? tun_xdp+0x410/0x410 [ 33.282502] ? cpumask_next+0x24/0x30 [ 33.286267] ? netdev_refcnt_read+0xed/0x150 [ 33.290639] ? tun_xdp+0x410/0x410 [ 33.294142] netdev_run_todo+0x870/0xca0 [ 33.298165] ? do_group_exit+0x149/0x400 [ 33.302189] ? mark_held_locks+0xaf/0x100 [ 33.306302] ? register_netdev+0x30/0x30 [ 33.310328] ? find_held_lock+0x35/0x1d0 [ 33.314355] ? lock_downgrade+0x990/0x990 [ 33.318468] ? refcount_sub_and_test+0x115/0x1b0 [ 33.323188] ? refcount_inc+0x50/0x50 [ 33.326960] ? refcount_inc+0x50/0x50 [ 33.330725] ? sk_destruct+0x4c/0x80 [ 33.334403] ? __sk_free+0x5c/0x230 [ 33.337993] ? sk_free+0x2f/0x40 [ 33.341324] ? __tun_detach+0x176/0x1390 [ 33.345354] ? tun_attach+0xfa0/0xfa0 [ 33.349121] ? lock_downgrade+0x990/0x990 [ 33.353234] ? locks_remove_file+0x3fa/0x5a0 [ 33.357608] ? fcntl_setlk+0x10c0/0x10c0 [ 33.361635] ? __fsnotify_parent+0xb4/0x3a0 [ 33.365920] ? fsnotify+0x1af0/0x1af0 [ 33.369686] ? __tun_detach+0x1390/0x1390 [ 33.373796] ? __tun_detach+0x1390/0x1390 [ 33.377908] rtnl_unlock+0xe/0x10 [ 33.381322] tun_chr_close+0x49/0x60 [ 33.385000] __fput+0x327/0x7e0 [ 33.388246] ? fput+0x140/0x140 [ 33.391496] ? check_same_owner+0x320/0x320 [ 33.395780] ? _raw_spin_unlock_irq+0x27/0x70 [ 33.400242] ____fput+0x15/0x20 [ 33.403484] task_work_run+0x199/0x270 [ 33.407335] ? task_work_cancel+0x210/0x210 [ 33.411619] ? _raw_spin_unlock+0x22/0x30 [ 33.415729] ? switch_task_namespaces+0x87/0xc0 [ 33.420363] do_exit+0x9b5/0x1ad0 [ 33.423783] ? __handle_mm_fault+0xf07/0x39c0 [ 33.428244] ? mm_update_next_owner+0x930/0x930 [ 33.432878] ? lock_release+0xa40/0xa40 [ 33.436815] ? do_raw_spin_trylock+0x190/0x190 [ 33.441359] ? kfree+0xe4/0x250 [ 33.444604] ? kvfree+0x36/0x60 [ 33.447853] ? __handle_mm_fault+0x587/0x39c0 [ 33.452313] ? check_noncircular+0x20/0x20 [ 33.456507] ? __pmd_alloc+0x4e0/0x4e0 [ 33.460360] ? find_held_lock+0x35/0x1d0 [ 33.464391] ? handle_mm_fault+0x248/0x8d0 [ 33.468590] ? find_held_lock+0x35/0x1d0 [ 33.472620] ? __do_page_fault+0x64c/0xd60 [ 33.476817] ? lock_downgrade+0x990/0x990 [ 33.480933] ? handle_mm_fault+0x410/0x8d0 [ 33.485129] ? down_read_trylock+0xdb/0x170 [ 33.489412] ? __do_page_fault+0x31e/0xd60 [ 33.493609] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.498152] ? vmacache_find+0x5f/0x280 [ 33.502089] ? vmacache_update+0xfe/0x130 [ 33.506209] do_group_exit+0x149/0x400 [ 33.510058] ? __do_page_fault+0x3d6/0xd60 [ 33.514255] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 33.518626] ? SyS_exit+0x30/0x30 [ 33.522045] ? do_fast_syscall_32+0x158/0xf05 [ 33.526501] ? do_group_exit+0x400/0x400 [ 33.530527] SyS_exit_group+0x1d/0x20 [ 33.534291] do_fast_syscall_32+0x3f2/0xf05 [ 33.538577] ? do_int80_syscall_32+0x940/0x940 [ 33.543122] ? kasan_check_read+0x11/0x20 [ 33.547236] ? syscall_return_slowpath+0x510/0x510 [ 33.552127] ? SyS_rt_sigaction+0x94/0x1b0 [ 33.556325] ? SyS_sigprocmask+0x4b0/0x4b0 [ 33.560522] ? SyS_read+0x184/0x220 [ 33.564110] ? retint_user+0x18/0x20 [ 33.567790] ? trace_hardirqs_off_thunk+0x1a/0x1c