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-3,10.128.15.218' (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: [ 39.486277] ================================================================== [ 39.487345] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 39.488235] Write of size 8 at addr ffff8801cd343740 by task syzkaller381613/2982 [ 39.489251] [ 39.489488] CPU: 0 PID: 2982 Comm: syzkaller381613 Not tainted 4.14.0-rc3+ #23 [ 39.490471] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.491791] Call Trace: [ 39.492151] dump_stack+0x194/0x257 [ 39.492652] ? arch_local_irq_restore+0x53/0x53 [ 39.493277] ? show_regs_print_info+0x65/0x65 [ 39.493884] ? lock_timer_base+0x1a3/0x2b0 [ 39.494473] ? detach_if_pending+0x557/0x610 [ 39.495070] print_address_description+0x73/0x250 [ 39.495717] ? detach_if_pending+0x557/0x610 [ 39.496308] kasan_report+0x25b/0x340 [ 39.496848] __asan_report_store8_noabort+0x17/0x20 [ 39.497519] detach_if_pending+0x557/0x610 [ 39.498106] ? trace_raw_output_tick_stop+0x130/0x130 [ 39.498799] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 39.499425] ? lock_timer_base+0x1a3/0x2b0 [ 39.499995] ? lock_timer_base+0x1eb/0x2b0 [ 39.500572] ? __internal_add_timer+0x2d0/0x2d0 [ 39.501200] ? trace_hardirqs_on+0xd/0x10 [ 39.501768] try_to_del_timer_sync+0xa2/0x120 [ 39.502373] ? del_timer+0x130/0x130 [ 39.502879] ? del_timer_sync+0xeb/0x240 [ 39.503435] del_timer_sync+0x18a/0x240 [ 39.503974] tun_free_netdev+0x105/0x1b0 [ 39.504522] ? tun_xdp+0x410/0x410 [ 39.505004] ? cpumask_next+0x24/0x30 [ 39.505525] ? netdev_refcnt_read+0xed/0x150 [ 39.506124] ? tun_xdp+0x410/0x410 [ 39.507913] netdev_run_todo+0x870/0xca0 [ 39.511948] ? do_group_exit+0x149/0x400 [ 39.515983] ? register_netdev+0x30/0x30 [ 39.520018] ? lock_downgrade+0x990/0x990 [ 39.524136] ? trace_hardirqs_on+0xd/0x10 [ 39.528273] ? refcount_sub_and_test+0x115/0x1b0 [ 39.532997] ? refcount_inc+0x50/0x50 [ 39.536766] ? refcount_inc+0x50/0x50 [ 39.540544] ? sk_destruct+0x4c/0x80 [ 39.544230] ? __sk_free+0x5c/0x230 [ 39.547831] ? sk_free+0x2f/0x40 [ 39.551167] ? __tun_detach+0x176/0x1390 [ 39.555210] ? tun_attach+0xf90/0xf90 [ 39.558987] ? do_raw_spin_trylock+0x190/0x190 [ 39.563543] ? locks_remove_file+0x3fa/0x5a0 [ 39.567924] ? fcntl_setlk+0x10d0/0x10d0 [ 39.571961] ? __fsnotify_parent+0xb4/0x3a0 [ 39.576257] ? fsnotify+0x1af0/0x1af0 [ 39.580031] ? __tun_detach+0x1390/0x1390 [ 39.584149] ? __tun_detach+0x1390/0x1390 [ 39.588269] rtnl_unlock+0xe/0x10 [ 39.591690] tun_chr_close+0x49/0x60 [ 39.595377] __fput+0x333/0x7f0 [ 39.598634] ? fput+0x140/0x140 [ 39.601891] ? check_same_owner+0x320/0x320 [ 39.606183] ? _raw_spin_unlock_irq+0x27/0x70 [ 39.610654] ____fput+0x15/0x20 [ 39.613904] task_work_run+0x199/0x270 [ 39.617765] ? task_work_cancel+0x210/0x210 [ 39.622057] ? _raw_spin_unlock+0x22/0x30 [ 39.626175] ? switch_task_namespaces+0x87/0xc0 [ 39.630817] do_exit+0x9d2/0x1af0 [ 39.634240] ? __handle_mm_fault+0xf07/0x39c0 [ 39.638707] ? mm_update_next_owner+0x930/0x930 [ 39.643345] ? lock_release+0xd70/0xd70 [ 39.647287] ? check_noncircular+0x20/0x20 [ 39.651492] ? kfree+0xe4/0x250 [ 39.654739] ? kvfree+0x36/0x60 [ 39.657997] ? check_noncircular+0x20/0x20 [ 39.662205] ? __handle_mm_fault+0x587/0x39c0 [ 39.666673] ? __pmd_alloc+0x4e0/0x4e0 [ 39.670539] ? find_held_lock+0x39/0x1d0 [ 39.674581] ? lock_downgrade+0x990/0x990 [ 39.678721] ? handle_mm_fault+0x410/0x8d0 [ 39.682923] ? down_read_trylock+0xdb/0x170 [ 39.687214] ? __do_page_fault+0x31e/0xd60 [ 39.691417] ? __handle_mm_fault+0x39c0/0x39c0 [ 39.695966] ? vmacache_find+0x5f/0x280 [ 39.699910] ? vmacache_update+0xfe/0x130 [ 39.704032] do_group_exit+0x149/0x400 [ 39.707891] ? __do_page_fault+0x3d6/0xd60 [ 39.712092] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 39.716468] ? SyS_exit+0x30/0x30 [ 39.719899] ? do_fast_syscall_32+0x158/0xf05 [ 39.724366] ? do_group_exit+0x400/0x400 [ 39.728400] SyS_exit_group+0x1d/0x20 [ 39.732171] do_fast_syscall_32+0x3f2/0xf05 [ 39.736469] ? do_int80_syscall_32+0x940/0x940 [ 39.741021] ? kasan_check_read+0x11/0x20 [ 39.745140] ? syscall_return_slowpath+0x510/0x510 [ 39.750038] ? SyS_rt_sigaction+0x94/0x1b0 [ 39.754246] ? lockdep_sys_exit+0x47/0xf0 [ 39.758364] ? retint_user+0x18/0x20 [ 39.762053] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 39.766873] entry_SYSENTER_compat+0x51/0x60 [ 39.771253] RIP: 0023:0xf7f00c79 [ 39.774586] RSP: 002b:00000000ffa564ac EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 39.782265] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 39.789506] RDX: 0000000000000000 RSI: 00000000080daa98 RDI: 00000000080f12a0 [ 39.796746] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 39.803984] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 39.811222] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 39.818481] [ 39.820080] Allocated by task 2982: [ 39.823676] save_stack_trace+0x16/0x20 [ 39.827621] save_stack+0x43/0xd0 [ 39.831042] kasan_kmalloc+0xad/0xe0 [ 39.834725] __kmalloc_node+0x47/0x70 [ 39.838495] kvmalloc_node+0x64/0xd0 [ 39.842177] alloc_netdev_mqs+0x16e/0xed0 [ 39.846295] __tun_chr_ioctl+0x12be/0x3d20 [ 39.850498] tun_chr_compat_ioctl+0x29/0x30 [ 39.854788] compat_SyS_ioctl+0x1d7/0x3290 [ 39.858990] do_fast_syscall_32+0x3f2/0xf05 [ 39.863281] entry_SYSENTER_compat+0x51/0x60 [ 39.867654] [ 39.869252] Freed by task 2982: [ 39.872501] save_stack_trace+0x16/0x20 [ 39.876444] save_stack+0x43/0xd0 [ 39.879866] kasan_slab_free+0x71/0xc0 [ 39.883720] kfree+0xca/0x250 [ 39.886792] kvfree+0x36/0x60 [ 39.889867] free_netdev+0x2cf/0x360 [ 39.893550] __tun_chr_ioctl+0x2cf6/0x3d20 [ 39.897752] tun_chr_compat_ioctl+0x29/0x30 [ 39.902042] compat_SyS_ioctl+0x1d7/0x3290 [ 39.906245] do_fast_syscall_32+0x3f2/0xf05 [ 39.910533] entry_SYSENTER_compat+0x51/0x60 [ 39.914907] [ 39.916506] The buggy address belongs to the object at ffff8801cd340340 [ 39.916506] which belongs to the cache kmalloc-16384 of size 16384 [ 39.929476] The buggy address is located 13312 bytes inside of [ 39.929476] 16384-byte region [ffff8801cd340340, ffff8801cd344340) [ 39.941663] The buggy address belongs to the page: [ 39.946562] page:ffffea000734d000 count:1 mapcount:0 mapping:ffff8801cd340340 index:0x0 compound_mapcount: 0 [ 39.956504] flags: 0x200000000008100(slab|head) [ 39.961142] raw: 0200000000008100 ffff8801cd340340 0000000000000000 0000000100000001 [ 39.968989] raw: ffffea000735cc20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 39.976835] page dumped because: kasan: bad access detected [ 39.982512] [ 39.984109] Memory state around the buggy address: [ 39.989004] ffff8801cd343600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 39.996329] ffff8801cd343680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.003655] >ffff8801cd343700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.010980] ^ [ 40.016396] ffff8801cd343780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.023725] ffff8801cd343800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.031049] ================================================================== [ 40.038374] Disabling lock debugging due to kernel taint [ 40.043784] Kernel panic - not syncing: panic_on_warn set ... [ 40.043784] [ 40.051110] CPU: 0 PID: 2982 Comm: syzkaller381613 Tainted: G B 4.14.0-rc3+ #23 [ 40.059645] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.068960] Call Trace: [ 40.071515] dump_stack+0x194/0x257 [ 40.075107] ? arch_local_irq_restore+0x53/0x53 [ 40.079739] ? vprintk_default+0x28/0x30 [ 40.083765] ? detach_if_pending+0x500/0x610 [ 40.088137] panic+0x1e4/0x417 [ 40.091292] ? __warn+0x1d9/0x1d9 [ 40.094717] ? detach_if_pending+0x557/0x610 [ 40.099091] kasan_end_report+0x50/0x50 [ 40.103030] kasan_report+0x144/0x340 [ 40.106795] __asan_report_store8_noabort+0x17/0x20 [ 40.111773] detach_if_pending+0x557/0x610 [ 40.115974] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.121128] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.125759] ? lock_timer_base+0x1a3/0x2b0 [ 40.129958] ? lock_timer_base+0x1eb/0x2b0 [ 40.134198] ? __internal_add_timer+0x2d0/0x2d0 [ 40.138832] ? trace_hardirqs_on+0xd/0x10 [ 40.142948] try_to_del_timer_sync+0xa2/0x120 [ 40.147407] ? del_timer+0x130/0x130 [ 40.151082] ? del_timer_sync+0xeb/0x240 [ 40.155109] del_timer_sync+0x18a/0x240 [ 40.159049] tun_free_netdev+0x105/0x1b0 [ 40.163073] ? tun_xdp+0x410/0x410 [ 40.166577] ? cpumask_next+0x24/0x30 [ 40.170344] ? netdev_refcnt_read+0xed/0x150 [ 40.174716] ? tun_xdp+0x410/0x410 [ 40.178222] netdev_run_todo+0x870/0xca0 [ 40.182245] ? do_group_exit+0x149/0x400 [ 40.186270] ? register_netdev+0x30/0x30 [ 40.190294] ? lock_downgrade+0x990/0x990 [ 40.194406] ? trace_hardirqs_on+0xd/0x10 [ 40.198526] ? refcount_sub_and_test+0x115/0x1b0 [ 40.203245] ? refcount_inc+0x50/0x50 [ 40.207009] ? refcount_inc+0x50/0x50 [ 40.210778] ? sk_destruct+0x4c/0x80 [ 40.214454] ? __sk_free+0x5c/0x230 [ 40.218045] ? sk_free+0x2f/0x40 [ 40.221372] ? __tun_detach+0x176/0x1390 [ 40.225405] ? tun_attach+0xf90/0xf90 [ 40.229171] ? do_raw_spin_trylock+0x190/0x190 [ 40.233717] ? locks_remove_file+0x3fa/0x5a0 [ 40.238089] ? fcntl_setlk+0x10d0/0x10d0 [ 40.242115] ? __fsnotify_parent+0xb4/0x3a0 [ 40.246402] ? fsnotify+0x1af0/0x1af0 [ 40.250167] ? __tun_detach+0x1390/0x1390 [ 40.254279] ? __tun_detach+0x1390/0x1390 [ 40.258390] rtnl_unlock+0xe/0x10 [ 40.261805] tun_chr_close+0x49/0x60 [ 40.265483] __fput+0x333/0x7f0 [ 40.268728] ? fput+0x140/0x140 [ 40.271974] ? check_same_owner+0x320/0x320 [ 40.276258] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.280720] ____fput+0x15/0x20 [ 40.283962] task_work_run+0x199/0x270 [ 40.287814] ? task_work_cancel+0x210/0x210 [ 40.292098] ? _raw_spin_unlock+0x22/0x30 [ 40.296212] ? switch_task_namespaces+0x87/0xc0 [ 40.300845] do_exit+0x9d2/0x1af0 [ 40.304263] ? __handle_mm_fault+0xf07/0x39c0 [ 40.308723] ? mm_update_next_owner+0x930/0x930 [ 40.313355] ? lock_release+0xd70/0xd70 [ 40.317291] ? check_noncircular+0x20/0x20 [ 40.321490] ? kfree+0xe4/0x250 [ 40.324732] ? kvfree+0x36/0x60 [ 40.327978] ? check_noncircular+0x20/0x20 [ 40.332176] ? __handle_mm_fault+0x587/0x39c0 [ 40.336637] ? __pmd_alloc+0x4e0/0x4e0 [ 40.340493] ? find_held_lock+0x39/0x1d0 [ 40.344521] ? lock_downgrade+0x990/0x990 [ 40.348641] ? handle_mm_fault+0x410/0x8d0 [ 40.352838] ? down_read_trylock+0xdb/0x170 [ 40.357122] ? __do_page_fault+0x31e/0xd60 [ 40.361321] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.365863] ? vmacache_find+0x5f/0x280 [ 40.369801] ? vmacache_update+0xfe/0x130 [ 40.373913] do_group_exit+0x149/0x400 [ 40.377765] ? __do_page_fault+0x3d6/0xd60 [ 40.381961] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 40.386333] ? SyS_exit+0x30/0x30 [ 40.389752] ? do_fast_syscall_32+0x158/0xf05 [ 40.394209] ? do_group_exit+0x400/0x400 [ 40.398231] SyS_exit_group+0x1d/0x20 [ 40.401995] do_fast_syscall_32+0x3f2/0xf05 [ 40.406284] ? do_int80_syscall_32+0x940/0x940 [ 40.410830] ? kasan_check_read+0x11/0x20 [ 40.414941] ? syscall_return_slowpath+0x510/0x510 [ 40.419834] ? SyS_rt_sigaction+0x94/0x1b0 [ 40.424034] ? lockdep_sys_exit+0x47/0xf0 [ 40.428147] ? retint_user+0x18/0x20 [ 40.431826] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 40.436635] entry_SYSENTER_compat+0x51/0x60 [ 40.441008] RIP: 0023:0xf7f00c79 [ 40.444338] RSP: 002b:00000000ffa564ac EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 40.452010] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 40.459244] RDX: 0000000000000000 RSI: 00000000080daa98 RDI: 00000000080f12a0 [ 40.466478] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 40.473711] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 40.480944] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000