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-mmots-kasan-gce-7,10.128.15.223' (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: [ 20.638666] ================================================================== [ 20.646150] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 20.652910] Write of size 8 at addr ffff8801ce48b780 by task syzkaller505472/2978 [ 20.660531] [ 20.662165] CPU: 1 PID: 2978 Comm: syzkaller505472 Not tainted 4.13.0-mm1+ #7 [ 20.669432] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 20.678781] Call Trace: [ 20.681370] dump_stack+0x194/0x257 [ 20.685002] ? arch_local_irq_restore+0x53/0x53 [ 20.689667] ? show_regs_print_info+0x65/0x65 [ 20.694160] ? lock_timer_base+0x1a3/0x2b0 [ 20.698392] ? detach_if_pending+0x557/0x610 [ 20.702799] print_address_description+0x73/0x250 [ 20.707644] ? detach_if_pending+0x557/0x610 [ 20.712055] kasan_report+0x24e/0x340 [ 20.715848] __asan_report_store8_noabort+0x17/0x20 [ 20.720844] detach_if_pending+0x557/0x610 [ 20.725055] ? trace_raw_output_tick_stop+0x130/0x130 [ 20.730221] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 20.734860] ? lock_timer_base+0x1a3/0x2b0 [ 20.739068] ? lock_timer_base+0x1eb/0x2b0 [ 20.743281] ? __internal_add_timer+0x2d0/0x2d0 [ 20.747933] ? trace_hardirqs_on+0xd/0x10 [ 20.752062] try_to_del_timer_sync+0xa2/0x120 [ 20.756527] ? del_timer+0x130/0x130 [ 20.760216] ? del_timer_sync+0xeb/0x240 [ 20.764255] del_timer_sync+0x18a/0x240 [ 20.768205] tun_free_netdev+0x105/0x1b0 [ 20.772241] ? tun_xdp+0x410/0x410 [ 20.775753] ? cpumask_next+0x24/0x30 [ 20.779546] ? netdev_refcnt_read+0xed/0x150 [ 20.783932] ? tun_xdp+0x410/0x410 [ 20.787444] netdev_run_todo+0x870/0xca0 [ 20.791476] ? do_group_exit+0x149/0x400 [ 20.795523] ? register_netdev+0x30/0x30 [ 20.799567] ? lock_downgrade+0x990/0x990 [ 20.803688] ? trace_hardirqs_on+0xd/0x10 [ 20.807826] ? refcount_sub_and_test+0x115/0x1b0 [ 20.812554] ? refcount_inc+0x50/0x50 [ 20.816326] ? refcount_inc+0x50/0x50 [ 20.820106] ? sk_destruct+0x4c/0x80 [ 20.823791] ? __sk_free+0x5c/0x230 [ 20.827392] ? sk_free+0x2f/0x40 [ 20.830729] ? __tun_detach+0x176/0x1390 [ 20.834775] ? tun_attach+0xf90/0xf90 [ 20.838561] ? locks_remove_file+0x3fa/0x5a0 [ 20.842944] ? fcntl_setlk+0x10d0/0x10d0 [ 20.846982] ? __fsnotify_parent+0xb4/0x3a0 [ 20.851280] ? fsnotify+0x1af0/0x1af0 [ 20.855059] ? __tun_detach+0x1390/0x1390 [ 20.859178] ? __tun_detach+0x1390/0x1390 [ 20.863309] rtnl_unlock+0xe/0x10 [ 20.866733] tun_chr_close+0x49/0x60 [ 20.870418] __fput+0x333/0x7f0 [ 20.873675] ? fput+0x140/0x140 [ 20.876928] ? check_same_owner+0x320/0x320 [ 20.881227] ____fput+0x15/0x20 [ 20.884478] task_work_run+0x199/0x270 [ 20.888341] ? task_work_cancel+0x210/0x210 [ 20.892634] ? free_nsproxy+0x185/0x1f0 [ 20.896581] ? switch_task_namespaces+0xa2/0xc0 [ 20.901227] do_exit+0xa52/0x1b40 [ 20.904653] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 20.909640] ? trace_hardirqs_on+0xd/0x10 [ 20.913765] ? kvfree+0x3b/0x60 [ 20.917030] ? mm_update_next_owner+0x930/0x930 [ 20.921673] ? rtnl_unlock+0xe/0x10 [ 20.925272] ? __tun_chr_ioctl+0x27a/0x3d20 [ 20.929574] ? tun_chr_read_iter+0x1e0/0x1e0 [ 20.933966] ? lock_downgrade+0x990/0x990 [ 20.938111] ? check_same_owner+0x320/0x320 [ 20.942405] ? __handle_mm_fault+0x39c0/0x39c0 [ 20.946971] ? vmacache_find+0x61/0x270 [ 20.950919] ? tun_chr_compat_ioctl+0x30/0x30 [ 20.955383] ? tun_chr_ioctl+0x2a/0x40 [ 20.959248] ? tun_chr_ioctl+0x2a/0x40 [ 20.963110] ? do_vfs_ioctl+0x492/0x1530 [ 20.967151] ? ioctl_preallocate+0x2b0/0x2b0 [ 20.971536] ? selinux_capable+0x40/0x40 [ 20.975572] ? putname+0xf3/0x130 [ 20.979003] do_group_exit+0x149/0x400 [ 20.982872] ? SyS_exit+0x30/0x30 [ 20.986300] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 20.991289] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 20.996029] SyS_exit_group+0x1d/0x20 [ 20.999809] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 21.004536] RIP: 0033:0x445409 [ 21.007699] RSP: 002b:00007fff39cffc08 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 21.015379] RAX: ffffffffffffffda RBX: 00007fff39cffc40 RCX: 0000000000445409 [ 21.022621] RDX: 0000000000445409 RSI: 0000000020521fd8 RDI: 0000000000000001 [ 21.029865] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fff39cffc40 [ 21.037105] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402750 [ 21.044346] R13: 00000000004027e0 R14: 0000000000000000 R15: 0000000000000000 [ 21.051605] [ 21.053205] Allocated by task 2978: [ 21.056813] save_stack_trace+0x16/0x20 [ 21.060760] save_stack+0x43/0xd0 [ 21.064183] kasan_kmalloc+0xad/0xe0 [ 21.067866] __kmalloc_node+0x47/0x70 [ 21.071636] kvmalloc_node+0x64/0xd0 [ 21.075323] alloc_netdev_mqs+0x16e/0xed0 [ 21.079442] __tun_chr_ioctl+0x12be/0x3d20 [ 21.083644] tun_chr_ioctl+0x2a/0x40 [ 21.087337] do_vfs_ioctl+0x1b1/0x1530 [ 21.091194] SyS_ioctl+0x8f/0xc0 [ 21.094532] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 21.099260] [ 21.100858] Freed by task 2978: [ 21.104117] save_stack_trace+0x16/0x20 [ 21.108076] save_stack+0x43/0xd0 [ 21.111504] kasan_slab_free+0x71/0xc0 [ 21.115361] kfree+0xca/0x250 [ 21.118440] kvfree+0x36/0x60 [ 21.121527] free_netdev+0x2cf/0x360 [ 21.125298] __tun_chr_ioctl+0x2cf6/0x3d20 [ 21.129503] tun_chr_ioctl+0x2a/0x40 [ 21.133189] do_vfs_ioctl+0x1b1/0x1530 [ 21.137049] SyS_ioctl+0x8f/0xc0 [ 21.140389] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 21.145121] [ 21.146722] The buggy address belongs to the object at ffff8801ce488380 [ 21.146722] which belongs to the cache kmalloc-16384 of size 16384 [ 21.159694] The buggy address is located 13312 bytes inside of [ 21.159694] 16384-byte region [ffff8801ce488380, ffff8801ce48c380) [ 21.171882] The buggy address belongs to the page: [ 21.176782] page:ffffea0007392200 count:1 mapcount:0 mapping:ffff8801ce488380 index:0x0 compound_mapcount: 0 [ 21.186726] flags: 0x200000000008100(slab|head) [ 21.191365] raw: 0200000000008100 ffff8801ce488380 0000000000000000 0000000100000001 [ 21.199216] raw: ffffea0007357c20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 21.207064] page dumped because: kasan: bad access detected [ 21.212742] [ 21.214340] Memory state around the buggy address: [ 21.219247] ffff8801ce48b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.226596] ffff8801ce48b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.233930] >ffff8801ce48b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.241260] ^ [ 21.244597] ffff8801ce48b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.251936] ffff8801ce48b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.259265] ================================================================== [ 21.266590] Disabling lock debugging due to kernel taint [ 21.272006] Kernel panic - not syncing: panic_on_warn set ... [ 21.272006] [ 21.279349] CPU: 1 PID: 2978 Comm: syzkaller505472 Tainted: G B 4.13.0-mm1+ #7 [ 21.287798] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 21.297118] Call Trace: [ 21.299677] dump_stack+0x194/0x257 [ 21.303272] ? arch_local_irq_restore+0x53/0x53 [ 21.307907] ? vprintk_default+0x28/0x30 [ 21.311935] ? detach_if_pending+0x550/0x610 [ 21.316311] panic+0x1e4/0x417 [ 21.319471] ? __warn+0x1d9/0x1d9 [ 21.322897] ? detach_if_pending+0x557/0x610 [ 21.327273] kasan_end_report+0x50/0x50 [ 21.331219] kasan_report+0x137/0x340 [ 21.334996] __asan_report_store8_noabort+0x17/0x20 [ 21.339981] detach_if_pending+0x557/0x610 [ 21.344185] ? trace_raw_output_tick_stop+0x130/0x130 [ 21.349344] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 21.353977] ? lock_timer_base+0x1a3/0x2b0 [ 21.358176] ? lock_timer_base+0x1eb/0x2b0 [ 21.362376] ? __internal_add_timer+0x2d0/0x2d0 [ 21.367013] ? trace_hardirqs_on+0xd/0x10 [ 21.371131] try_to_del_timer_sync+0xa2/0x120 [ 21.375591] ? del_timer+0x130/0x130 [ 21.379271] ? del_timer_sync+0xeb/0x240 [ 21.383310] del_timer_sync+0x18a/0x240 [ 21.387251] tun_free_netdev+0x105/0x1b0 [ 21.391283] ? tun_xdp+0x410/0x410 [ 21.394790] ? cpumask_next+0x24/0x30 [ 21.398560] ? netdev_refcnt_read+0xed/0x150 [ 21.402935] ? tun_xdp+0x410/0x410 [ 21.406441] netdev_run_todo+0x870/0xca0 [ 21.410467] ? do_group_exit+0x149/0x400 [ 21.414498] ? register_netdev+0x30/0x30 [ 21.418525] ? lock_downgrade+0x990/0x990 [ 21.422646] ? trace_hardirqs_on+0xd/0x10 [ 21.426768] ? refcount_sub_and_test+0x115/0x1b0 [ 21.431491] ? refcount_inc+0x50/0x50 [ 21.435258] ? refcount_inc+0x50/0x50 [ 21.439031] ? sk_destruct+0x4c/0x80 [ 21.442710] ? __sk_free+0x5c/0x230 [ 21.446304] ? sk_free+0x2f/0x40 [ 21.449637] ? __tun_detach+0x176/0x1390 [ 21.453667] ? tun_attach+0xf90/0xf90 [ 21.457449] ? locks_remove_file+0x3fa/0x5a0 [ 21.461835] ? fcntl_setlk+0x10d0/0x10d0 [ 21.465871] ? __fsnotify_parent+0xb4/0x3a0 [ 21.470167] ? fsnotify+0x1af0/0x1af0 [ 21.473945] ? __tun_detach+0x1390/0x1390 [ 21.478679] ? __tun_detach+0x1390/0x1390 [ 21.482800] rtnl_unlock+0xe/0x10 [ 21.486222] tun_chr_close+0x49/0x60 [ 21.489902] __fput+0x333/0x7f0 [ 21.493150] ? fput+0x140/0x140 [ 21.496398] ? check_same_owner+0x320/0x320 [ 21.500687] ____fput+0x15/0x20 [ 21.503934] task_work_run+0x199/0x270 [ 21.507787] ? task_work_cancel+0x210/0x210 [ 21.512090] ? free_nsproxy+0x185/0x1f0 [ 21.516031] ? switch_task_namespaces+0xa2/0xc0 [ 21.520669] do_exit+0xa52/0x1b40 [ 21.524098] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 21.529081] ? trace_hardirqs_on+0xd/0x10 [ 21.533208] ? kvfree+0x3b/0x60 [ 21.536455] ? mm_update_next_owner+0x930/0x930 [ 21.541092] ? rtnl_unlock+0xe/0x10 [ 21.544683] ? __tun_chr_ioctl+0x27a/0x3d20 [ 21.548983] ? tun_chr_read_iter+0x1e0/0x1e0 [ 21.553369] ? lock_downgrade+0x990/0x990 [ 21.557494] ? check_same_owner+0x320/0x320 [ 21.561782] ? __handle_mm_fault+0x39c0/0x39c0 [ 21.566330] ? vmacache_find+0x61/0x270 [ 21.570271] ? tun_chr_compat_ioctl+0x30/0x30 [ 21.574730] ? tun_chr_ioctl+0x2a/0x40 [ 21.578581] ? tun_chr_ioctl+0x2a/0x40 [ 21.582436] ? do_vfs_ioctl+0x492/0x1530 [ 21.586467] ? ioctl_preallocate+0x2b0/0x2b0 [ 21.590844] ? selinux_capable+0x40/0x40 [ 21.594871] ? putname+0xf3/0x130 [ 21.598293] do_group_exit+0x149/0x400 [ 21.602148] ? SyS_exit+0x30/0x30 [ 21.605567] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 21.610550] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 21.615272] SyS_exit_group+0x1d/0x20 [ 21.619041] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 21.623760] RIP: 0033:0x445409 [ 21.626914] RSP: 002b:00007fff39cffc08 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 21.634585] RAX: ffffffffffffffda RBX: 00007fff39cffc40 RCX: 0000000000445409