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.7' (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: [ 35.220346] ================================================================== [ 35.227799] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.234526] Write of size 8 at addr ffff8801ce013740 by task syzkaller343790/2985 [ 35.242115] [ 35.243718] CPU: 0 PID: 2985 Comm: syzkaller343790 Not tainted 4.14.0-rc3+ #29 [ 35.251049] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.260373] Call Trace: [ 35.262935] dump_stack+0x194/0x257 [ 35.266537] ? arch_local_irq_restore+0x53/0x53 [ 35.271178] ? show_regs_print_info+0x65/0x65 [ 35.275648] ? lock_timer_base+0x1a3/0x2b0 [ 35.279856] ? detach_if_pending+0x557/0x610 [ 35.284238] print_address_description+0x73/0x250 [ 35.289051] ? detach_if_pending+0x557/0x610 [ 35.293431] kasan_report+0x25b/0x340 [ 35.297206] __asan_report_store8_noabort+0x17/0x20 [ 35.302190] detach_if_pending+0x557/0x610 [ 35.306399] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.311561] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.316199] ? lock_timer_base+0x1a3/0x2b0 [ 35.320406] ? lock_timer_base+0x1eb/0x2b0 [ 35.324616] ? __internal_add_timer+0x2d0/0x2d0 [ 35.329257] ? trace_hardirqs_on+0xd/0x10 [ 35.333383] try_to_del_timer_sync+0xa2/0x120 [ 35.337852] ? del_timer+0x130/0x130 [ 35.341541] ? del_timer_sync+0xeb/0x240 [ 35.345579] del_timer_sync+0x18a/0x240 [ 35.349530] tun_free_netdev+0x105/0x1b0 [ 35.353562] ? tun_xdp+0x410/0x410 [ 35.357072] ? cpumask_next+0x24/0x30 [ 35.360845] ? netdev_refcnt_read+0xed/0x150 [ 35.365227] ? tun_xdp+0x410/0x410 [ 35.368738] netdev_run_todo+0x870/0xca0 [ 35.372770] ? do_group_exit+0x149/0x400 [ 35.376813] ? register_netdev+0x30/0x30 [ 35.380847] ? lock_downgrade+0x990/0x990 [ 35.384967] ? trace_hardirqs_on+0xd/0x10 [ 35.389104] ? refcount_sub_and_test+0x115/0x1b0 [ 35.393831] ? refcount_inc+0x50/0x50 [ 35.397603] ? refcount_inc+0x50/0x50 [ 35.401382] ? sk_destruct+0x4c/0x80 [ 35.405064] ? __sk_free+0x5c/0x230 [ 35.408663] ? sk_free+0x2f/0x40 [ 35.411999] ? __tun_detach+0x176/0x1390 [ 35.416043] ? tun_attach+0xf90/0xf90 [ 35.419820] ? do_raw_spin_trylock+0x190/0x190 [ 35.424379] ? locks_remove_file+0x3fa/0x5a0 [ 35.428762] ? fcntl_setlk+0x10d0/0x10d0 [ 35.432798] ? __fsnotify_parent+0xb4/0x3a0 [ 35.437094] ? fsnotify+0x1af0/0x1af0 [ 35.440869] ? __tun_detach+0x1390/0x1390 [ 35.444990] ? __tun_detach+0x1390/0x1390 [ 35.449110] rtnl_unlock+0xe/0x10 [ 35.452533] tun_chr_close+0x49/0x60 [ 35.456217] __fput+0x333/0x7f0 [ 35.459475] ? fput+0x140/0x140 [ 35.462727] ? check_same_owner+0x320/0x320 [ 35.467018] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.471493] ____fput+0x15/0x20 [ 35.474744] task_work_run+0x199/0x270 [ 35.478607] ? task_work_cancel+0x210/0x210 [ 35.482900] ? _raw_spin_unlock+0x22/0x30 [ 35.487019] ? switch_task_namespaces+0x87/0xc0 [ 35.491679] do_exit+0x9d2/0x1af0 [ 35.495103] ? __handle_mm_fault+0xf07/0x39c0 [ 35.499575] ? mm_update_next_owner+0x930/0x930 [ 35.504216] ? lock_release+0xd70/0xd70 [ 35.508161] ? check_noncircular+0x20/0x20 [ 35.512367] ? kfree+0xe4/0x250 [ 35.515617] ? kvfree+0x36/0x60 [ 35.518877] ? check_noncircular+0x20/0x20 [ 35.523086] ? __handle_mm_fault+0x587/0x39c0 [ 35.527556] ? __pmd_alloc+0x4e0/0x4e0 [ 35.531427] ? find_held_lock+0x39/0x1d0 [ 35.535473] ? lock_downgrade+0x990/0x990 [ 35.539614] ? handle_mm_fault+0x410/0x8d0 [ 35.543817] ? down_read_trylock+0xdb/0x170 [ 35.548108] ? __do_page_fault+0x31e/0xd60 [ 35.552315] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.556865] ? vmacache_find+0x5f/0x280 [ 35.560811] ? vmacache_update+0xfe/0x130 [ 35.564936] do_group_exit+0x149/0x400 [ 35.568794] ? __do_page_fault+0x3d6/0xd60 [ 35.572999] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 35.577376] ? SyS_exit+0x30/0x30 [ 35.580810] ? do_fast_syscall_32+0x158/0xf05 [ 35.585276] ? do_group_exit+0x400/0x400 [ 35.589310] SyS_exit_group+0x1d/0x20 [ 35.593082] do_fast_syscall_32+0x3f2/0xf05 [ 35.597381] ? do_int80_syscall_32+0x940/0x940 [ 35.601933] ? kasan_check_read+0x11/0x20 [ 35.606052] ? syscall_return_slowpath+0x510/0x510 [ 35.610953] ? SyS_rt_sigaction+0x94/0x1b0 [ 35.615161] ? lockdep_sys_exit+0x47/0xf0 [ 35.619281] ? retint_user+0x18/0x20 [ 35.622973] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 35.627794] entry_SYSENTER_compat+0x51/0x60 [ 35.632173] RIP: 0023:0xf7f03c79 [ 35.635508] RSP: 002b:00000000ff83e8bc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 35.643188] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 35.650431] RDX: 0000000000000000 RSI: 00000000080db4f8 RDI: 00000000080f22a0 [ 35.657671] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 35.664910] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 35.672149] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 35.679407] [ 35.681007] Allocated by task 2985: [ 35.684604] save_stack_trace+0x16/0x20 [ 35.688548] save_stack+0x43/0xd0 [ 35.691969] kasan_kmalloc+0xad/0xe0 [ 35.695651] __kmalloc_node+0x47/0x70 [ 35.699424] kvmalloc_node+0x64/0xd0 [ 35.703108] alloc_netdev_mqs+0x16e/0xed0 [ 35.707225] __tun_chr_ioctl+0x12be/0x3d20 [ 35.711431] tun_chr_compat_ioctl+0x29/0x30 [ 35.715723] compat_SyS_ioctl+0x1d7/0x3290 [ 35.719926] do_fast_syscall_32+0x3f2/0xf05 [ 35.724214] entry_SYSENTER_compat+0x51/0x60 [ 35.728587] [ 35.730184] Freed by task 2985: [ 35.733434] save_stack_trace+0x16/0x20 [ 35.737378] save_stack+0x43/0xd0 [ 35.740799] kasan_slab_free+0x71/0xc0 [ 35.744653] kfree+0xca/0x250 [ 35.747727] kvfree+0x36/0x60 [ 35.750802] free_netdev+0x2cf/0x360 [ 35.754487] __tun_chr_ioctl+0x2cf6/0x3d20 [ 35.758690] tun_chr_compat_ioctl+0x29/0x30 [ 35.762982] compat_SyS_ioctl+0x1d7/0x3290 [ 35.767184] do_fast_syscall_32+0x3f2/0xf05 [ 35.771474] entry_SYSENTER_compat+0x51/0x60 [ 35.775849] [ 35.777447] The buggy address belongs to the object at ffff8801ce010340 [ 35.777447] which belongs to the cache kmalloc-16384 of size 16384 [ 35.790420] The buggy address is located 13312 bytes inside of [ 35.790420] 16384-byte region [ffff8801ce010340, ffff8801ce014340) [ 35.802608] The buggy address belongs to the page: [ 35.807506] page:ffffea0007380400 count:1 mapcount:0 mapping:ffff8801ce010340 index:0x0 compound_mapcount: 0 [ 35.817450] flags: 0x200000000008100(slab|head) [ 35.822089] raw: 0200000000008100 ffff8801ce010340 0000000000000000 0000000100000001 [ 35.829939] raw: ffffea000735ec20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.837786] page dumped because: kasan: bad access detected [ 35.843464] [ 35.845060] Memory state around the buggy address: [ 35.849959] ffff8801ce013600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.857287] ffff8801ce013680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.864614] >ffff8801ce013700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.871938] ^ [ 35.877355] ffff8801ce013780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.884682] ffff8801ce013800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.892007] ================================================================== [ 35.899332] Disabling lock debugging due to kernel taint [ 35.904745] Kernel panic - not syncing: panic_on_warn set ... [ 35.904745] [ 35.912072] CPU: 0 PID: 2985 Comm: syzkaller343790 Tainted: G B 4.14.0-rc3+ #29 [ 35.920608] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.929924] Call Trace: [ 35.932480] dump_stack+0x194/0x257 [ 35.936075] ? arch_local_irq_restore+0x53/0x53 [ 35.940710] ? vprintk_default+0x28/0x30 [ 35.944740] ? detach_if_pending+0x540/0x610 [ 35.949114] panic+0x1e4/0x417 [ 35.952272] ? __warn+0x1d9/0x1d9 [ 35.955697] ? detach_if_pending+0x557/0x610 [ 35.960069] kasan_end_report+0x50/0x50 [ 35.964008] kasan_report+0x144/0x340 [ 35.967773] __asan_report_store8_noabort+0x17/0x20 [ 35.972753] detach_if_pending+0x557/0x610 [ 35.976953] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.982108] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.986739] ? lock_timer_base+0x1a3/0x2b0 [ 35.990936] ? lock_timer_base+0x1eb/0x2b0 [ 35.995137] ? __internal_add_timer+0x2d0/0x2d0 [ 35.999770] ? trace_hardirqs_on+0xd/0x10 [ 36.003887] try_to_del_timer_sync+0xa2/0x120 [ 36.008346] ? del_timer+0x130/0x130 [ 36.012025] ? del_timer_sync+0xeb/0x240 [ 36.016052] del_timer_sync+0x18a/0x240 [ 36.019991] tun_free_netdev+0x105/0x1b0 [ 36.024016] ? tun_xdp+0x410/0x410 [ 36.027521] ? cpumask_next+0x24/0x30 [ 36.031291] ? netdev_refcnt_read+0xed/0x150 [ 36.035664] ? tun_xdp+0x410/0x410 [ 36.039169] netdev_run_todo+0x870/0xca0 [ 36.043195] ? do_group_exit+0x149/0x400 [ 36.047223] ? register_netdev+0x30/0x30 [ 36.051250] ? lock_downgrade+0x990/0x990 [ 36.055361] ? trace_hardirqs_on+0xd/0x10 [ 36.059484] ? refcount_sub_and_test+0x115/0x1b0 [ 36.064207] ? refcount_inc+0x50/0x50 [ 36.067973] ? refcount_inc+0x50/0x50 [ 36.071739] ? sk_destruct+0x4c/0x80 [ 36.075416] ? __sk_free+0x5c/0x230 [ 36.079008] ? sk_free+0x2f/0x40 [ 36.082339] ? __tun_detach+0x176/0x1390 [ 36.086370] ? tun_attach+0xf90/0xf90 [ 36.090135] ? do_raw_spin_trylock+0x190/0x190 [ 36.094684] ? locks_remove_file+0x3fa/0x5a0 [ 36.099057] ? fcntl_setlk+0x10d0/0x10d0 [ 36.103086] ? __fsnotify_parent+0xb4/0x3a0 [ 36.107373] ? fsnotify+0x1af0/0x1af0 [ 36.111141] ? __tun_detach+0x1390/0x1390 [ 36.115254] ? __tun_detach+0x1390/0x1390 [ 36.119369] rtnl_unlock+0xe/0x10 [ 36.122786] tun_chr_close+0x49/0x60 [ 36.126465] __fput+0x333/0x7f0 [ 36.129713] ? fput+0x140/0x140 [ 36.132958] ? check_same_owner+0x320/0x320 [ 36.137246] ? _raw_spin_unlock_irq+0x27/0x70 [ 36.141707] ____fput+0x15/0x20 [ 36.144953] task_work_run+0x199/0x270 [ 36.148805] ? task_work_cancel+0x210/0x210 [ 36.153092] ? _raw_spin_unlock+0x22/0x30 [ 36.157203] ? switch_task_namespaces+0x87/0xc0 [ 36.161838] do_exit+0x9d2/0x1af0 [ 36.165254] ? __handle_mm_fault+0xf07/0x39c0 [ 36.169717] ? mm_update_next_owner+0x930/0x930 [ 36.174352] ? lock_release+0xd70/0xd70 [ 36.178290] ? check_noncircular+0x20/0x20 [ 36.182490] ? kfree+0xe4/0x250 [ 36.185733] ? kvfree+0x36/0x60 [ 36.188982] ? check_noncircular+0x20/0x20 [ 36.193185] ? __handle_mm_fault+0x587/0x39c0 [ 36.197646] ? __pmd_alloc+0x4e0/0x4e0 [ 36.201506] ? find_held_lock+0x39/0x1d0 [ 36.205546] ? lock_downgrade+0x990/0x990 [ 36.209668] ? handle_mm_fault+0x410/0x8d0 [ 36.213866] ? down_read_trylock+0xdb/0x170 [ 36.218158] ? __do_page_fault+0x31e/0xd60