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.0.34' (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: [ 51.261313] ================================================================== [ 51.262505] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 51.263407] Write of size 8 at addr ffff8801cdd53780 by task syzkaller553757/2984 [ 51.264405] [ 51.264641] CPU: 0 PID: 2984 Comm: syzkaller553757 Not tainted 4.14.0-rc3-mm1+ #14 [ 51.265663] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.266883] Call Trace: [ 51.267244] dump_stack+0x194/0x257 [ 51.267741] ? arch_local_irq_restore+0x53/0x53 [ 51.268366] ? show_regs_print_info+0x65/0x65 [ 51.268971] ? lock_timer_base+0x1a3/0x2b0 [ 51.269545] ? detach_if_pending+0x557/0x610 [ 51.270139] print_address_description+0x73/0x250 [ 51.270786] ? detach_if_pending+0x557/0x610 [ 51.271380] kasan_report+0x25b/0x340 [ 51.271897] __asan_report_store8_noabort+0x17/0x20 [ 51.272565] detach_if_pending+0x557/0x610 [ 51.273137] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.273830] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.274452] ? lock_timer_base+0x1a3/0x2b0 [ 51.275024] ? lock_timer_base+0x1eb/0x2b0 [ 51.275597] ? __internal_add_timer+0x2d0/0x2d0 [ 51.276222] ? trace_hardirqs_on+0xd/0x10 [ 51.276788] try_to_del_timer_sync+0xa2/0x120 [ 51.277389] ? del_timer+0x130/0x130 [ 51.277907] ? del_timer_sync+0xeb/0x240 [ 51.278461] del_timer_sync+0x18a/0x240 [ 51.279002] tun_free_netdev+0x105/0x1b0 [ 51.279550] ? tun_xdp+0x410/0x410 [ 51.280028] ? cpumask_next+0x24/0x30 [ 51.280545] ? netdev_refcnt_read+0xed/0x150 [ 51.281143] ? tun_xdp+0x410/0x410 [ 51.281624] netdev_run_todo+0x870/0xca0 [ 51.285657] ? do_group_exit+0x149/0x400 [ 51.289692] ? register_netdev+0x30/0x30 [ 51.293727] ? lock_downgrade+0x990/0x990 [ 51.297844] ? trace_hardirqs_on+0xd/0x10 [ 51.301983] ? refcount_sub_and_test+0x115/0x1b0 [ 51.306709] ? refcount_inc+0x50/0x50 [ 51.310482] ? refcount_inc+0x50/0x50 [ 51.314259] ? sk_destruct+0x4c/0x80 [ 51.317941] ? __sk_free+0x5c/0x230 [ 51.321542] ? sk_free+0x2f/0x40 [ 51.324878] ? __tun_detach+0x760/0x1570 [ 51.328920] ? tun_attach+0x1070/0x1070 [ 51.332873] ? locks_remove_file+0x3fa/0x5a0 [ 51.337254] ? fcntl_setlk+0x10d0/0x10d0 [ 51.341289] ? __fsnotify_parent+0xb4/0x3a0 [ 51.345581] ? fsnotify+0x1af0/0x1af0 [ 51.349353] ? rcu_note_context_switch+0x710/0x710 [ 51.354256] ? __tun_detach+0x1570/0x1570 [ 51.358371] rtnl_unlock+0xe/0x10 [ 51.361794] tun_chr_close+0x49/0x60 [ 51.365480] __fput+0x333/0x7f0 [ 51.368734] ? fput+0x140/0x140 [ 51.371985] ? trace_event_raw_event_sched_switch+0x8a0/0x8a0 [ 51.377845] ____fput+0x15/0x20 [ 51.381093] task_work_run+0x199/0x270 [ 51.384951] ? task_work_cancel+0x210/0x210 [ 51.389243] ? free_nsproxy+0x185/0x1f0 [ 51.393187] ? switch_task_namespaces+0xa2/0xc0 [ 51.397828] do_exit+0x9c8/0x1b00 [ 51.401253] ? kvfree+0x3b/0x60 [ 51.404504] ? mm_update_next_owner+0x930/0x930 [ 51.409141] ? rtnl_unlock+0xe/0x10 [ 51.412735] ? __tun_chr_ioctl+0x27a/0x3e40 [ 51.417034] ? tun_chr_read_iter+0x1e0/0x1e0 [ 51.421411] ? lock_downgrade+0x990/0x990 [ 51.425550] ? handle_mm_fault+0x410/0x8d0 [ 51.429755] ? __do_page_fault+0x31e/0xd60 [ 51.433969] ? trace_event_raw_event_sched_switch+0x8a0/0x8a0 [ 51.439820] ? up_read+0x1a/0x40 [ 51.443162] ? tun_chr_compat_ioctl+0x30/0x30 [ 51.447624] ? tun_chr_ioctl+0x2a/0x40 [ 51.451480] ? tun_chr_ioctl+0x2a/0x40 [ 51.455342] ? do_vfs_ioctl+0x492/0x1530 [ 51.459368] ? _cond_resched+0x14/0x30 [ 51.463232] ? ioctl_preallocate+0x2b0/0x2b0 [ 51.467614] ? selinux_capable+0x40/0x40 [ 51.471645] ? putname+0xf3/0x130 [ 51.475072] do_group_exit+0x149/0x400 [ 51.478928] ? SyS_exit+0x30/0x30 [ 51.482352] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.487338] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.492065] SyS_exit_group+0x1d/0x20 [ 51.495837] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.500561] RIP: 0033:0x445429 [ 51.503718] RSP: 002b:00007ffcf19870e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 51.511396] RAX: ffffffffffffffda RBX: 00007ffcf1987120 RCX: 0000000000445429 [ 51.518637] RDX: 0000000000445429 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 51.525875] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffcf1987120 [ 51.533113] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 51.540349] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000 [ 51.547604] [ 51.549199] Allocated by task 2984: [ 51.552796] save_stack_trace+0x16/0x20 [ 51.556739] save_stack+0x43/0xd0 [ 51.560159] kasan_kmalloc+0xad/0xe0 [ 51.563842] __kmalloc_node+0x47/0x70 [ 51.567610] kvmalloc_node+0x64/0xd0 [ 51.571290] alloc_netdev_mqs+0x16d/0xed0 [ 51.575406] __tun_chr_ioctl+0x1386/0x3e40 [ 51.579607] tun_chr_ioctl+0x2a/0x40 [ 51.583286] do_vfs_ioctl+0x1b1/0x1530 [ 51.587140] SyS_ioctl+0x8f/0xc0 [ 51.590475] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.595196] [ 51.596792] Freed by task 2984: [ 51.600039] save_stack_trace+0x16/0x20 [ 51.603979] save_stack+0x43/0xd0 [ 51.607400] kasan_slab_free+0x71/0xc0 [ 51.611253] kfree+0xca/0x250 [ 51.614325] kvfree+0x36/0x60 [ 51.617397] free_netdev+0x2cf/0x360 [ 51.621076] __tun_chr_ioctl+0x2df6/0x3e40 [ 51.625277] tun_chr_ioctl+0x2a/0x40 [ 51.628957] do_vfs_ioctl+0x1b1/0x1530 [ 51.632810] SyS_ioctl+0x8f/0xc0 [ 51.636145] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.640863] [ 51.642458] The buggy address belongs to the object at ffff8801cdd50380 [ 51.642458] which belongs to the cache kmalloc-16384 of size 16384 [ 51.655425] The buggy address is located 13312 bytes inside of [ 51.655425] 16384-byte region [ffff8801cdd50380, ffff8801cdd54380) [ 51.667611] The buggy address belongs to the page: [ 51.672510] page:ffffea0007375400 count:1 mapcount:0 mapping:ffff8801cdd50380 index:0x0 compound_mapcount: 0 [ 51.682449] flags: 0x200000000008100(slab|head) [ 51.687085] raw: 0200000000008100 ffff8801cdd50380 0000000000000000 0000000100000001 [ 51.694932] raw: ffffea0007334a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 51.702778] page dumped because: kasan: bad access detected [ 51.708454] [ 51.710050] Memory state around the buggy address: [ 51.714947] ffff8801cdd53680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.722275] ffff8801cdd53700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.729600] >ffff8801cdd53780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.736924] ^ [ 51.740255] ffff8801cdd53800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.747581] ffff8801cdd53880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.754903] ================================================================== [ 51.762226] Disabling lock debugging due to kernel taint [ 51.767637] Kernel panic - not syncing: panic_on_warn set ... [ 51.767637] [ 51.774959] CPU: 0 PID: 2984 Comm: syzkaller553757 Tainted: G B 4.14.0-rc3-mm1+ #14 [ 51.783926] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.793241] Call Trace: [ 51.795790] dump_stack+0x194/0x257 [ 51.799380] ? arch_local_irq_restore+0x53/0x53 [ 51.804013] ? vprintk_default+0x28/0x30 [ 51.808040] ? detach_if_pending+0x4c0/0x610 [ 51.812417] panic+0x1e4/0x41c [ 51.815573] ? refcount_error_report+0x214/0x214 [ 51.820296] ? detach_if_pending+0x557/0x610 [ 51.824668] kasan_end_report+0x50/0x50 [ 51.828607] kasan_report+0x144/0x340 [ 51.832372] __asan_report_store8_noabort+0x17/0x20 [ 51.837349] detach_if_pending+0x557/0x610 [ 51.841548] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.846701] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.851331] ? lock_timer_base+0x1a3/0x2b0 [ 51.855530] ? lock_timer_base+0x1eb/0x2b0 [ 51.859730] ? __internal_add_timer+0x2d0/0x2d0 [ 51.864364] ? trace_hardirqs_on+0xd/0x10 [ 51.868480] try_to_del_timer_sync+0xa2/0x120 [ 51.872937] ? del_timer+0x130/0x130 [ 51.876616] ? del_timer_sync+0xeb/0x240 [ 51.880644] del_timer_sync+0x18a/0x240 [ 51.884588] tun_free_netdev+0x105/0x1b0 [ 51.888612] ? tun_xdp+0x410/0x410 [ 51.892114] ? cpumask_next+0x24/0x30 [ 51.895879] ? netdev_refcnt_read+0xed/0x150 [ 51.900250] ? tun_xdp+0x410/0x410 [ 51.903755] netdev_run_todo+0x870/0xca0 [ 51.907778] ? do_group_exit+0x149/0x400 [ 51.911803] ? register_netdev+0x30/0x30 [ 51.915829] ? lock_downgrade+0x990/0x990 [ 51.919939] ? trace_hardirqs_on+0xd/0x10 [ 51.924059] ? refcount_sub_and_test+0x115/0x1b0 [ 51.928778] ? refcount_inc+0x50/0x50 [ 51.932541] ? refcount_inc+0x50/0x50 [ 51.936306] ? sk_destruct+0x4c/0x80 [ 51.939981] ? __sk_free+0x5c/0x230 [ 51.943570] ? sk_free+0x2f/0x40 [ 51.946899] ? __tun_detach+0x760/0x1570 [ 51.950928] ? tun_attach+0x1070/0x1070 [ 51.954871] ? locks_remove_file+0x3fa/0x5a0 [ 51.959243] ? fcntl_setlk+0x10d0/0x10d0 [ 51.963269] ? __fsnotify_parent+0xb4/0x3a0 [ 51.967553] ? fsnotify+0x1af0/0x1af0 [ 51.971317] ? rcu_note_context_switch+0x710/0x710 [ 51.976213] ? __tun_detach+0x1570/0x1570 [ 51.980326] rtnl_unlock+0xe/0x10 [ 51.983740] tun_chr_close+0x49/0x60 [ 51.987416] __fput+0x333/0x7f0 [ 51.990664] ? fput+0x140/0x140 [ 51.993908] ? trace_event_raw_event_sched_switch+0x8a0/0x8a0 [ 51.999756] ____fput+0x15/0x20 [ 52.002998] task_work_run+0x199/0x270 [ 52.006849] ? task_work_cancel+0x210/0x210 [ 52.011134] ? free_nsproxy+0x185/0x1f0 [ 52.015070] ? switch_task_namespaces+0xa2/0xc0 [ 52.019706] do_exit+0x9c8/0x1b00 [ 52.023123] ? kvfree+0x3b/0x60 [ 52.026365] ? mm_update_next_owner+0x930/0x930 [ 52.030997] ? rtnl_unlock+0xe/0x10 [ 52.034587] ? __tun_chr_ioctl+0x27a/0x3e40 [ 52.038876] ? tun_chr_read_iter+0x1e0/0x1e0 [ 52.043246] ? lock_downgrade+0x990/0x990 [ 52.047370] ? handle_mm_fault+0x410/0x8d0 [ 52.051567] ? __do_page_fault+0x31e/0xd60 [ 52.055771] ? trace_event_raw_event_sched_switch+0x8a0/0x8a0 [ 52.061616] ? up_read+0x1a/0x40 [ 52.064947] ? tun_chr_compat_ioctl+0x30/0x30 [ 52.069404] ? tun_chr_ioctl+0x2a/0x40 [ 52.073252] ? tun_chr_ioctl+0x2a/0x40 [ 52.077106] ? do_vfs_ioctl+0x492/0x1530 [ 52.081131] ? _cond_resched+0x14/0x30 [ 52.084985] ? ioctl_preallocate+0x2b0/0x2b0 [ 52.089360] ? selinux_capable+0x40/0x40 [ 52.093386] ? putname+0xf3/0x130 [ 52.096805] do_group_exit+0x149/0x400 [ 52.100659] ? SyS_exit+0x30/0x30 [ 52.104075] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.109053] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.113771] SyS_exit_group+0x1d/0x20 [ 52.117534] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.122251] RIP: 0033:0x445429 [ 52.125405] RSP: 002b:00007ffcf19870e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 52.133075] RAX: ffffffffffffffda RBX: 00007ffcf1987120 RCX: 0000000000445429 [ 52.140309] RDX: 0000000000445429 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 52.147542] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffcf1987120 [ 52.154775] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402770 [ 52.162007] R13: 0000000000402800 R14: 0000000000000000 R15: 0000000000000000