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-3,10.128.0.10' (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: [ 48.616349] ================================================================== [ 48.623761] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 48.630482] Write of size 8 at addr ffff8801ce9eb740 by task syzkaller265286/2984 [ 48.638071] [ 48.639672] CPU: 0 PID: 2984 Comm: syzkaller265286 Not tainted 4.13.0-mm1+ #7 [ 48.646912] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 48.656240] Call Trace: [ 48.658799] dump_stack+0x194/0x257 [ 48.662401] ? arch_local_irq_restore+0x53/0x53 [ 48.667042] ? show_regs_print_info+0x65/0x65 [ 48.671509] ? lock_timer_base+0x1a3/0x2b0 [ 48.675717] ? detach_if_pending+0x557/0x610 [ 48.680098] print_address_description+0x73/0x250 [ 48.684914] ? detach_if_pending+0x557/0x610 [ 48.689296] kasan_report+0x24e/0x340 [ 48.693072] __asan_report_store8_noabort+0x17/0x20 [ 48.698057] detach_if_pending+0x557/0x610 [ 48.702263] ? trace_raw_output_tick_stop+0x130/0x130 [ 48.707424] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 48.712062] ? lock_timer_base+0x1a3/0x2b0 [ 48.716267] ? lock_timer_base+0x1eb/0x2b0 [ 48.720487] ? __internal_add_timer+0x2d0/0x2d0 [ 48.725130] ? trace_hardirqs_on+0xd/0x10 [ 48.729255] try_to_del_timer_sync+0xa2/0x120 [ 48.733722] ? del_timer+0x130/0x130 [ 48.737407] ? del_timer_sync+0xeb/0x240 [ 48.741442] del_timer_sync+0x18a/0x240 [ 48.745387] tun_free_netdev+0x105/0x1b0 [ 48.749416] ? tun_xdp+0x410/0x410 [ 48.752925] ? cpumask_next+0x24/0x30 [ 48.756696] ? netdev_refcnt_read+0xed/0x150 [ 48.761077] ? tun_xdp+0x410/0x410 [ 48.764587] netdev_run_todo+0x870/0xca0 [ 48.768632] ? do_group_exit+0x149/0x400 [ 48.772667] ? register_netdev+0x30/0x30 [ 48.776702] ? lock_downgrade+0x990/0x990 [ 48.780827] ? trace_hardirqs_on+0xd/0x10 [ 48.784964] ? refcount_sub_and_test+0x115/0x1b0 [ 48.789689] ? refcount_inc+0x50/0x50 [ 48.793458] ? refcount_inc+0x50/0x50 [ 48.797236] ? sk_destruct+0x4c/0x80 [ 48.800920] ? __sk_free+0x5c/0x230 [ 48.804518] ? sk_free+0x2f/0x40 [ 48.807856] ? __tun_detach+0x176/0x1390 [ 48.811901] ? tun_attach+0xf90/0xf90 [ 48.815680] ? locks_remove_file+0x3fa/0x5a0 [ 48.820060] ? fcntl_setlk+0x10d0/0x10d0 [ 48.824093] ? __fsnotify_parent+0xb4/0x3a0 [ 48.828386] ? fsnotify+0x1af0/0x1af0 [ 48.832161] ? __tun_detach+0x1390/0x1390 [ 48.836279] ? __tun_detach+0x1390/0x1390 [ 48.840397] rtnl_unlock+0xe/0x10 [ 48.843820] tun_chr_close+0x49/0x60 [ 48.847505] __fput+0x333/0x7f0 [ 48.850759] ? fput+0x140/0x140 [ 48.854013] ? check_same_owner+0x320/0x320 [ 48.858313] ____fput+0x15/0x20 [ 48.861562] task_work_run+0x199/0x270 [ 48.865422] ? task_work_cancel+0x210/0x210 [ 48.869716] ? free_nsproxy+0x185/0x1f0 [ 48.873662] ? switch_task_namespaces+0xa2/0xc0 [ 48.878308] do_exit+0xa52/0x1b40 [ 48.881734] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.886723] ? trace_hardirqs_on+0xd/0x10 [ 48.890846] ? kvfree+0x3b/0x60 [ 48.894101] ? mm_update_next_owner+0x930/0x930 [ 48.898738] ? rtnl_unlock+0xe/0x10 [ 48.902332] ? __tun_chr_ioctl+0x27a/0x3d20 [ 48.906634] ? tun_chr_read_iter+0x1e0/0x1e0 [ 48.911024] ? lock_downgrade+0x990/0x990 [ 48.915167] ? check_same_owner+0x320/0x320 [ 48.919457] ? __handle_mm_fault+0x39c0/0x39c0 [ 48.924008] ? vmacache_find+0x61/0x270 [ 48.927956] ? tun_chr_compat_ioctl+0x30/0x30 [ 48.932419] ? tun_chr_ioctl+0x2a/0x40 [ 48.936277] ? tun_chr_ioctl+0x2a/0x40 [ 48.940135] ? do_vfs_ioctl+0x492/0x1530 [ 48.944170] ? ioctl_preallocate+0x2b0/0x2b0 [ 48.948551] ? selinux_capable+0x40/0x40 [ 48.952586] ? putname+0xf3/0x130 [ 48.956016] do_group_exit+0x149/0x400 [ 48.959874] ? SyS_exit+0x30/0x30 [ 48.963298] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 48.968284] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 48.973012] SyS_exit_group+0x1d/0x20 [ 48.976783] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 48.981509] RIP: 0033:0x445339 [ 48.984668] RSP: 002b:00007ffd16480148 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 48.992354] RAX: ffffffffffffffda RBX: 00007ffd16480180 RCX: 0000000000445339 [ 48.999594] RDX: 0000000000445339 RSI: 0000000020822000 RDI: 0000000000000001 [ 49.006834] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffd16480180 [ 49.014075] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402680 [ 49.021313] R13: 0000000000402710 R14: 0000000000000000 R15: 0000000000000000 [ 49.028573] [ 49.030170] Allocated by task 2984: [ 49.033768] save_stack_trace+0x16/0x20 [ 49.037712] save_stack+0x43/0xd0 [ 49.041133] kasan_kmalloc+0xad/0xe0 [ 49.044813] __kmalloc_node+0x47/0x70 [ 49.048581] kvmalloc_node+0x64/0xd0 [ 49.052265] alloc_netdev_mqs+0x16e/0xed0 [ 49.056381] __tun_chr_ioctl+0x12be/0x3d20 [ 49.060582] tun_chr_ioctl+0x2a/0x40 [ 49.064265] do_vfs_ioctl+0x1b1/0x1530 [ 49.068121] SyS_ioctl+0x8f/0xc0 [ 49.071456] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.076182] [ 49.077781] Freed by task 2984: [ 49.081033] save_stack_trace+0x16/0x20 [ 49.084974] save_stack+0x43/0xd0 [ 49.088394] kasan_slab_free+0x71/0xc0 [ 49.092252] kfree+0xca/0x250 [ 49.095330] kvfree+0x36/0x60 [ 49.098406] free_netdev+0x2cf/0x360 [ 49.102089] __tun_chr_ioctl+0x2cf6/0x3d20 [ 49.106303] tun_chr_ioctl+0x2a/0x40 [ 49.109984] do_vfs_ioctl+0x1b1/0x1530 [ 49.113842] SyS_ioctl+0x8f/0xc0 [ 49.117180] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.121901] [ 49.123497] The buggy address belongs to the object at ffff8801ce9e8340 [ 49.123497] which belongs to the cache kmalloc-16384 of size 16384 [ 49.136467] The buggy address is located 13312 bytes inside of [ 49.136467] 16384-byte region [ffff8801ce9e8340, ffff8801ce9ec340) [ 49.148655] The buggy address belongs to the page: [ 49.153552] page:ffffea00073a7a00 count:1 mapcount:0 mapping:ffff8801ce9e8340 index:0x0 compound_mapcount: 0 [ 49.163493] flags: 0x200000000008100(slab|head) [ 49.168130] raw: 0200000000008100 ffff8801ce9e8340 0000000000000000 0000000100000001 [ 49.175979] raw: ffffea00073ca020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 49.183833] page dumped because: kasan: bad access detected [ 49.189507] [ 49.191104] Memory state around the buggy address: [ 49.195999] ffff8801ce9eb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.203326] ffff8801ce9eb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.210650] >ffff8801ce9eb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.217976] ^ [ 49.223391] ffff8801ce9eb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.230719] ffff8801ce9eb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.238046] ================================================================== [ 49.245369] Disabling lock debugging due to kernel taint [ 49.250788] Kernel panic - not syncing: panic_on_warn set ... [ 49.250788] [ 49.258118] CPU: 0 PID: 2984 Comm: syzkaller265286 Tainted: G B 4.13.0-mm1+ #7 [ 49.266567] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.275889] Call Trace: [ 49.278448] dump_stack+0x194/0x257 [ 49.282041] ? arch_local_irq_restore+0x53/0x53 [ 49.286673] ? vprintk_default+0x28/0x30 [ 49.290703] ? detach_if_pending+0x550/0x610 [ 49.295075] panic+0x1e4/0x417 [ 49.298232] ? __warn+0x1d9/0x1d9 [ 49.301656] ? detach_if_pending+0x557/0x610 [ 49.306027] kasan_end_report+0x50/0x50 [ 49.309962] kasan_report+0x137/0x340 [ 49.313726] __asan_report_store8_noabort+0x17/0x20 [ 49.318703] detach_if_pending+0x557/0x610 [ 49.322904] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.328057] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.332688] ? lock_timer_base+0x1a3/0x2b0 [ 49.336885] ? lock_timer_base+0x1eb/0x2b0 [ 49.341084] ? __internal_add_timer+0x2d0/0x2d0 [ 49.345715] ? trace_hardirqs_on+0xd/0x10 [ 49.349835] try_to_del_timer_sync+0xa2/0x120 [ 49.354303] ? del_timer+0x130/0x130 [ 49.357980] ? del_timer_sync+0xeb/0x240 [ 49.362007] del_timer_sync+0x18a/0x240 [ 49.365945] tun_free_netdev+0x105/0x1b0 [ 49.369967] ? tun_xdp+0x410/0x410 [ 49.373468] ? cpumask_next+0x24/0x30 [ 49.377235] ? netdev_refcnt_read+0xed/0x150 [ 49.381607] ? tun_xdp+0x410/0x410 [ 49.385111] netdev_run_todo+0x870/0xca0 [ 49.389149] ? do_group_exit+0x149/0x400 [ 49.393174] ? register_netdev+0x30/0x30 [ 49.397203] ? lock_downgrade+0x990/0x990 [ 49.401321] ? trace_hardirqs_on+0xd/0x10 [ 49.405440] ? refcount_sub_and_test+0x115/0x1b0 [ 49.410157] ? refcount_inc+0x50/0x50 [ 49.413919] ? refcount_inc+0x50/0x50 [ 49.417684] ? sk_destruct+0x4c/0x80 [ 49.421359] ? __sk_free+0x5c/0x230 [ 49.424950] ? sk_free+0x2f/0x40 [ 49.428280] ? __tun_detach+0x176/0x1390 [ 49.432311] ? tun_attach+0xf90/0xf90 [ 49.436082] ? locks_remove_file+0x3fa/0x5a0 [ 49.440454] ? fcntl_setlk+0x10d0/0x10d0 [ 49.444480] ? __fsnotify_parent+0xb4/0x3a0 [ 49.448767] ? fsnotify+0x1af0/0x1af0 [ 49.452530] ? __tun_detach+0x1390/0x1390 [ 49.456639] ? __tun_detach+0x1390/0x1390 [ 49.460749] rtnl_unlock+0xe/0x10 [ 49.464163] tun_chr_close+0x49/0x60 [ 49.467839] __fput+0x333/0x7f0 [ 49.471085] ? fput+0x140/0x140 [ 49.474327] ? check_same_owner+0x320/0x320 [ 49.478613] ____fput+0x15/0x20 [ 49.481857] task_work_run+0x199/0x270 [ 49.485708] ? task_work_cancel+0x210/0x210 [ 49.489995] ? free_nsproxy+0x185/0x1f0 [ 49.493931] ? switch_task_namespaces+0xa2/0xc0 [ 49.498566] do_exit+0xa52/0x1b40 [ 49.501986] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.506966] ? trace_hardirqs_on+0xd/0x10 [ 49.511082] ? kvfree+0x3b/0x60 [ 49.514327] ? mm_update_next_owner+0x930/0x930 [ 49.518957] ? rtnl_unlock+0xe/0x10 [ 49.522547] ? __tun_chr_ioctl+0x27a/0x3d20 [ 49.526835] ? tun_chr_read_iter+0x1e0/0x1e0 [ 49.531212] ? lock_downgrade+0x990/0x990 [ 49.535337] ? check_same_owner+0x320/0x320 [ 49.539620] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.544164] ? vmacache_find+0x61/0x270 [ 49.548101] ? tun_chr_compat_ioctl+0x30/0x30 [ 49.552556] ? tun_chr_ioctl+0x2a/0x40 [ 49.556404] ? tun_chr_ioctl+0x2a/0x40 [ 49.560257] ? do_vfs_ioctl+0x492/0x1530 [ 49.564283] ? ioctl_preallocate+0x2b0/0x2b0 [ 49.568657] ? selinux_capable+0x40/0x40 [ 49.572681] ? putname+0xf3/0x130 [ 49.576099] do_group_exit+0x149/0x400 [ 49.579950] ? SyS_exit+0x30/0x30 [ 49.583367] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.588350] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.593068] SyS_exit_group+0x1d/0x20 [ 49.596835] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.601553] RIP: 0033:0x445339 [ 49.604707] RSP: 002b:00007ffd16480148 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 49.612376] RAX: ffffffffffffffda RBX: 00007ffd16480180 RCX: 0000000000445339