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-8,10.128.0.27' (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: [ 31.157280] ================================================================== [ 31.164731] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.171459] Write of size 8 at addr ffff8801cdcfb740 by task syzkaller020026/2981 [ 31.179049] [ 31.180652] CPU: 1 PID: 2981 Comm: syzkaller020026 Not tainted 4.14.0-rc2-mm1+ #9 [ 31.188241] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.197578] Call Trace: [ 31.200159] dump_stack+0x194/0x257 [ 31.203764] ? arch_local_irq_restore+0x53/0x53 [ 31.208412] ? show_regs_print_info+0x65/0x65 [ 31.212886] ? lock_timer_base+0x1a3/0x2b0 [ 31.217097] ? detach_if_pending+0x557/0x610 [ 31.221485] print_address_description+0x73/0x250 [ 31.226303] ? detach_if_pending+0x557/0x610 [ 31.230689] kasan_report+0x25b/0x340 [ 31.234466] __asan_report_store8_noabort+0x17/0x20 [ 31.239454] detach_if_pending+0x557/0x610 [ 31.243663] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.248836] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.253476] ? lock_timer_base+0x1a3/0x2b0 [ 31.257683] ? lock_timer_base+0x1eb/0x2b0 [ 31.261894] ? __internal_add_timer+0x2d0/0x2d0 [ 31.266535] ? trace_hardirqs_on+0xd/0x10 [ 31.270661] try_to_del_timer_sync+0xa2/0x120 [ 31.275132] ? del_timer+0x130/0x130 [ 31.278819] ? del_timer_sync+0xeb/0x240 [ 31.282866] del_timer_sync+0x18a/0x240 [ 31.286814] tun_free_netdev+0x105/0x1b0 [ 31.290847] ? tun_xdp+0x410/0x410 [ 31.294358] ? cpumask_next+0x24/0x30 [ 31.298132] ? netdev_refcnt_read+0xed/0x150 [ 31.302517] ? tun_xdp+0x410/0x410 [ 31.306037] netdev_run_todo+0x870/0xca0 [ 31.310070] ? do_group_exit+0x149/0x400 [ 31.314107] ? register_netdev+0x30/0x30 [ 31.318145] ? lock_downgrade+0x990/0x990 [ 31.322264] ? trace_hardirqs_on+0xd/0x10 [ 31.326402] ? refcount_sub_and_test+0x115/0x1b0 [ 31.331131] ? refcount_inc+0x50/0x50 [ 31.334916] ? refcount_inc+0x50/0x50 [ 31.338693] ? sk_destruct+0x4c/0x80 [ 31.342379] ? __sk_free+0x5c/0x230 [ 31.345979] ? sk_free+0x2f/0x40 [ 31.349316] ? __tun_detach+0x176/0x1390 [ 31.353358] ? tun_attach+0xfa0/0xfa0 [ 31.357135] ? do_raw_spin_trylock+0x190/0x190 [ 31.361695] ? locks_remove_file+0x3fa/0x5a0 [ 31.366077] ? fcntl_setlk+0x10d0/0x10d0 [ 31.370115] ? __fsnotify_parent+0xb4/0x3a0 [ 31.374409] ? fsnotify+0x1af0/0x1af0 [ 31.378185] ? rcu_note_context_switch+0x710/0x710 [ 31.383090] ? __tun_detach+0x1390/0x1390 [ 31.387214] rtnl_unlock+0xe/0x10 [ 31.390637] tun_chr_close+0x49/0x60 [ 31.394323] __fput+0x333/0x7f0 [ 31.397580] ? fput+0x140/0x140 [ 31.400834] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 31.406686] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.411170] ____fput+0x15/0x20 [ 31.414423] task_work_run+0x199/0x270 [ 31.418284] ? task_work_cancel+0x210/0x210 [ 31.422576] ? _raw_spin_unlock+0x22/0x30 [ 31.426695] ? switch_task_namespaces+0x87/0xc0 [ 31.431339] do_exit+0x9c8/0x1b00 [ 31.434769] ? mm_update_next_owner+0x930/0x930 [ 31.439412] ? __pmd_alloc+0x4e0/0x4e0 [ 31.443285] ? find_held_lock+0x39/0x1d0 [ 31.447330] ? lock_downgrade+0x990/0x990 [ 31.451472] ? handle_mm_fault+0x410/0x8d0 [ 31.455686] ? down_read_trylock+0xdb/0x170 [ 31.459979] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.464531] ? vmacache_find+0x5f/0x280 [ 31.468483] ? up_read+0x1a/0x40 [ 31.471822] ? __do_page_fault+0x35b/0xb60 [ 31.476026] ? do_vfs_ioctl+0x492/0x1530 [ 31.480067] ? do_page_fault+0xee/0x720 [ 31.484015] ? __do_page_fault+0xb60/0xb60 [ 31.488220] ? putname+0xf3/0x130 [ 31.491650] do_group_exit+0x149/0x400 [ 31.495511] ? lockdep_sys_exit+0x47/0xf0 [ 31.499628] ? SyS_exit+0x30/0x30 [ 31.503051] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.508039] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 31.512769] SyS_exit_group+0x1d/0x20 [ 31.516542] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.521266] RIP: 0033:0x443ae8 [ 31.524426] RSP: 002b:00007ffce1f8a618 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 31.532108] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ae8 [ 31.539350] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 31.546590] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 31.553831] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 31.561071] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 31.568331] [ 31.569931] Allocated by task 2981: [ 31.573532] save_stack_trace+0x16/0x20 [ 31.577475] save_stack+0x43/0xd0 [ 31.580897] kasan_kmalloc+0xad/0xe0 [ 31.584582] __kmalloc_node+0x47/0x70 [ 31.588354] kvmalloc_node+0x64/0xd0 [ 31.592039] alloc_netdev_mqs+0x16d/0xed0 [ 31.596159] __tun_chr_ioctl+0x12be/0x3d20 [ 31.600363] tun_chr_ioctl+0x2a/0x40 [ 31.604047] do_vfs_ioctl+0x1b1/0x1530 [ 31.607903] SyS_ioctl+0x8f/0xc0 [ 31.611236] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.615959] [ 31.617557] Freed by task 2981: [ 31.620806] save_stack_trace+0x16/0x20 [ 31.624747] save_stack+0x43/0xd0 [ 31.628170] kasan_slab_free+0x71/0xc0 [ 31.632025] kfree+0xca/0x250 [ 31.635101] kvfree+0x36/0x60 [ 31.638175] free_netdev+0x2cf/0x360 [ 31.641857] __tun_chr_ioctl+0x2cf6/0x3d20 [ 31.646061] tun_chr_ioctl+0x2a/0x40 [ 31.649743] do_vfs_ioctl+0x1b1/0x1530 [ 31.653619] SyS_ioctl+0x8f/0xc0 [ 31.656955] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 31.661677] [ 31.663275] The buggy address belongs to the object at ffff8801cdcf8340 [ 31.663275] which belongs to the cache kmalloc-16384 of size 16384 [ 31.676259] The buggy address is located 13312 bytes inside of [ 31.676259] 16384-byte region [ffff8801cdcf8340, ffff8801cdcfc340) [ 31.688446] The buggy address belongs to the page: [ 31.693353] page:ffffea0007373e00 count:1 mapcount:0 mapping:ffff8801cdcf8340 index:0x0 compound_mapcount: 0 [ 31.703297] flags: 0x200000000008100(slab|head) [ 31.707938] raw: 0200000000008100 ffff8801cdcf8340 0000000000000000 0000000100000001 [ 31.715796] raw: ffffea0007320220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 31.723656] page dumped because: kasan: bad access detected [ 31.729333] [ 31.730930] Memory state around the buggy address: [ 31.735827] ffff8801cdcfb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.743154] ffff8801cdcfb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.750482] >ffff8801cdcfb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.757808] ^ [ 31.763225] ffff8801cdcfb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.770553] ffff8801cdcfb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 31.777886] ================================================================== [ 31.785211] Disabling lock debugging due to kernel taint [ 31.790625] Kernel panic - not syncing: panic_on_warn set ... [ 31.790625] [ 31.797954] CPU: 1 PID: 2981 Comm: syzkaller020026 Tainted: G B 4.14.0-rc2-mm1+ #9 [ 31.806751] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.816088] Call Trace: [ 31.818646] dump_stack+0x194/0x257 [ 31.822250] ? arch_local_irq_restore+0x53/0x53 [ 31.826898] ? vprintk_default+0x28/0x30 [ 31.830929] ? detach_if_pending+0x490/0x610 [ 31.835303] panic+0x1e4/0x417 [ 31.838459] ? __warn+0x1d9/0x1d9 [ 31.841884] ? detach_if_pending+0x557/0x610 [ 31.846257] kasan_end_report+0x50/0x50 [ 31.850193] kasan_report+0x144/0x340 [ 31.853963] __asan_report_store8_noabort+0x17/0x20 [ 31.858945] detach_if_pending+0x557/0x610 [ 31.863147] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.868304] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.872938] ? lock_timer_base+0x1a3/0x2b0 [ 31.877139] ? lock_timer_base+0x1eb/0x2b0 [ 31.881341] ? __internal_add_timer+0x2d0/0x2d0 [ 31.885988] ? trace_hardirqs_on+0xd/0x10 [ 31.890107] try_to_del_timer_sync+0xa2/0x120 [ 31.894566] ? del_timer+0x130/0x130 [ 31.898257] ? del_timer_sync+0xeb/0x240 [ 31.902286] del_timer_sync+0x18a/0x240 [ 31.906228] tun_free_netdev+0x105/0x1b0 [ 31.910264] ? tun_xdp+0x410/0x410 [ 31.913769] ? cpumask_next+0x24/0x30 [ 31.917545] ? netdev_refcnt_read+0xed/0x150 [ 31.921938] ? tun_xdp+0x410/0x410 [ 31.925445] netdev_run_todo+0x870/0xca0 [ 31.929472] ? do_group_exit+0x149/0x400 [ 31.933502] ? register_netdev+0x30/0x30 [ 31.937530] ? lock_downgrade+0x990/0x990 [ 31.941643] ? trace_hardirqs_on+0xd/0x10 [ 31.945767] ? refcount_sub_and_test+0x115/0x1b0 [ 31.950487] ? refcount_inc+0x50/0x50 [ 31.954251] ? refcount_inc+0x50/0x50 [ 31.958033] ? sk_destruct+0x4c/0x80 [ 31.961709] ? __sk_free+0x5c/0x230 [ 31.965301] ? sk_free+0x2f/0x40 [ 31.968634] ? __tun_detach+0x176/0x1390 [ 31.972679] ? tun_attach+0xfa0/0xfa0 [ 31.976449] ? do_raw_spin_trylock+0x190/0x190 [ 31.981018] ? locks_remove_file+0x3fa/0x5a0 [ 31.985403] ? fcntl_setlk+0x10d0/0x10d0 [ 31.989431] ? __fsnotify_parent+0xb4/0x3a0 [ 31.993719] ? fsnotify+0x1af0/0x1af0 [ 31.997488] ? rcu_note_context_switch+0x710/0x710 [ 32.002386] ? __tun_detach+0x1390/0x1390 [ 32.006499] rtnl_unlock+0xe/0x10 [ 32.009931] tun_chr_close+0x49/0x60 [ 32.013611] __fput+0x333/0x7f0 [ 32.016876] ? fput+0x140/0x140 [ 32.020135] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 32.025985] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.030458] ____fput+0x15/0x20 [ 32.033703] task_work_run+0x199/0x270 [ 32.037556] ? task_work_cancel+0x210/0x210 [ 32.041843] ? _raw_spin_unlock+0x22/0x30 [ 32.045965] ? switch_task_namespaces+0x87/0xc0 [ 32.050610] do_exit+0x9c8/0x1b00 [ 32.054045] ? mm_update_next_owner+0x930/0x930 [ 32.058681] ? __pmd_alloc+0x4e0/0x4e0 [ 32.062540] ? find_held_lock+0x39/0x1d0 [ 32.066569] ? lock_downgrade+0x990/0x990 [ 32.070690] ? handle_mm_fault+0x410/0x8d0 [ 32.074888] ? down_read_trylock+0xdb/0x170 [ 32.079176] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.083726] ? vmacache_find+0x5f/0x280 [ 32.087676] ? up_read+0x1a/0x40 [ 32.091012] ? __do_page_fault+0x35b/0xb60 [ 32.095214] ? do_vfs_ioctl+0x492/0x1530 [ 32.099242] ? do_page_fault+0xee/0x720 [ 32.103183] ? __do_page_fault+0xb60/0xb60 [ 32.107383] ? putname+0xf3/0x130 [ 32.110803] do_group_exit+0x149/0x400 [ 32.114654] ? lockdep_sys_exit+0x47/0xf0 [ 32.118764] ? SyS_exit+0x30/0x30 [ 32.122183] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.127164] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.131884] SyS_exit_group+0x1d/0x20 [ 32.135650] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.140369] RIP: 0033:0x443ae8 [ 32.143533] RSP: 002b:00007ffce1f8a618 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 32.151206] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ae8