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-2,10.128.15.217' (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: [ 32.531281] ================================================================== [ 32.538703] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.545424] Write of size 8 at addr ffff8801ce51b740 by task syzkaller974106/2989 [ 32.553008] [ 32.554608] CPU: 0 PID: 2989 Comm: syzkaller974106 Not tainted 4.14.0-rc2+ #21 [ 32.561937] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.571262] Call Trace: [ 32.573824] dump_stack+0x194/0x257 [ 32.577428] ? arch_local_irq_restore+0x53/0x53 [ 32.582070] ? show_regs_print_info+0x65/0x65 [ 32.586537] ? lock_timer_base+0x1a3/0x2b0 [ 32.590746] ? detach_if_pending+0x557/0x610 [ 32.595126] print_address_description+0x73/0x250 [ 32.599941] ? detach_if_pending+0x557/0x610 [ 32.604323] kasan_report+0x25b/0x340 [ 32.608100] __asan_report_store8_noabort+0x17/0x20 [ 32.613089] detach_if_pending+0x557/0x610 [ 32.617305] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.622467] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.627106] ? lock_timer_base+0x1a3/0x2b0 [ 32.631312] ? lock_timer_base+0x1eb/0x2b0 [ 32.635520] ? __internal_add_timer+0x2d0/0x2d0 [ 32.640161] ? trace_hardirqs_on+0xd/0x10 [ 32.644285] try_to_del_timer_sync+0xa2/0x120 [ 32.648748] ? del_timer+0x130/0x130 [ 32.652431] ? del_timer_sync+0xeb/0x240 [ 32.656470] del_timer_sync+0x18a/0x240 [ 32.660418] tun_free_netdev+0x105/0x1b0 [ 32.664451] ? tun_xdp+0x410/0x410 [ 32.667960] ? cpumask_next+0x24/0x30 [ 32.671732] ? netdev_refcnt_read+0xed/0x150 [ 32.676119] ? tun_xdp+0x410/0x410 [ 32.679631] netdev_run_todo+0x870/0xca0 [ 32.683663] ? do_group_exit+0x149/0x400 [ 32.687698] ? register_netdev+0x30/0x30 [ 32.691735] ? lock_downgrade+0x990/0x990 [ 32.695860] ? trace_hardirqs_on+0xd/0x10 [ 32.699997] ? refcount_sub_and_test+0x115/0x1b0 [ 32.704983] ? refcount_inc+0x50/0x50 [ 32.708752] ? refcount_inc+0x50/0x50 [ 32.712526] ? sk_destruct+0x4c/0x80 [ 32.716209] ? __sk_free+0x5c/0x230 [ 32.719808] ? sk_free+0x2f/0x40 [ 32.723147] ? __tun_detach+0x176/0x1390 [ 32.727190] ? tun_attach+0xf90/0xf90 [ 32.730972] ? locks_remove_file+0x3fa/0x5a0 [ 32.735354] ? fcntl_setlk+0x10d0/0x10d0 [ 32.739387] ? __fsnotify_parent+0xb4/0x3a0 [ 32.743679] ? fsnotify+0x1af0/0x1af0 [ 32.747453] ? __tun_detach+0x1390/0x1390 [ 32.751569] ? __tun_detach+0x1390/0x1390 [ 32.755689] rtnl_unlock+0xe/0x10 [ 32.759110] tun_chr_close+0x49/0x60 [ 32.762794] __fput+0x333/0x7f0 [ 32.766049] ? fput+0x140/0x140 [ 32.769300] ? check_same_owner+0x320/0x320 [ 32.773597] ____fput+0x15/0x20 [ 32.776849] task_work_run+0x199/0x270 [ 32.780707] ? task_work_cancel+0x210/0x210 [ 32.784997] ? free_nsproxy+0x185/0x1f0 [ 32.788942] ? switch_task_namespaces+0xa2/0xc0 [ 32.793585] do_exit+0x9d2/0x1af0 [ 32.797006] ? __handle_mm_fault+0xf07/0x39c0 [ 32.801477] ? mm_update_next_owner+0x930/0x930 [ 32.806120] ? lock_release+0xd70/0xd70 [ 32.810068] ? check_noncircular+0x20/0x20 [ 32.814282] ? kfree+0xe4/0x250 [ 32.817532] ? kvfree+0x36/0x60 [ 32.820787] ? trace_hardirqs_on+0xd/0x10 [ 32.824909] ? check_noncircular+0x20/0x20 [ 32.829119] ? __handle_mm_fault+0x587/0x39c0 [ 32.833588] ? __pmd_alloc+0x4e0/0x4e0 [ 32.837454] ? find_held_lock+0x39/0x1d0 [ 32.841496] ? lock_downgrade+0x990/0x990 [ 32.845635] ? handle_mm_fault+0x410/0x8d0 [ 32.849838] ? down_read_trylock+0xdb/0x170 [ 32.854128] ? __do_page_fault+0x31e/0xd60 [ 32.858332] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.862882] ? vmacache_find+0x5f/0x280 [ 32.866826] ? vmacache_update+0xfe/0x130 [ 32.870951] do_group_exit+0x149/0x400 [ 32.874805] ? __do_page_fault+0x3d6/0xd60 [ 32.879010] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.883385] ? SyS_exit+0x30/0x30 [ 32.886812] ? do_fast_syscall_32+0x158/0xf05 [ 32.891292] ? do_group_exit+0x400/0x400 [ 32.895322] SyS_exit_group+0x1d/0x20 [ 32.899096] do_fast_syscall_32+0x3f2/0xf05 [ 32.903393] ? do_int80_syscall_32+0x940/0x940 [ 32.907945] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.912673] ? lockdep_sys_exit+0x47/0xf0 [ 32.916792] ? syscall_return_slowpath+0x2b3/0x510 [ 32.921695] ? lockdep_sys_exit+0x47/0xf0 [ 32.925814] ? retint_user+0x18/0x20 [ 32.929504] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.934325] entry_SYSENTER_compat+0x51/0x60 [ 32.938701] RIP: 0023:0xf7fbcc79 [ 32.942035] RSP: 002b:00000000ff856d4c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 32.949713] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 32.956953] RDX: 0000000000000000 RSI: 0000000020574000 RDI: 00000000400454ca [ 32.964193] RBP: 00000000080729d6 R08: 0000000000000000 R09: 0000000000000000 [ 32.971430] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.978668] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.985926] [ 32.987525] Allocated by task 2989: [ 32.991121] save_stack_trace+0x16/0x20 [ 32.995064] save_stack+0x43/0xd0 [ 32.998490] kasan_kmalloc+0xad/0xe0 [ 33.002171] __kmalloc_node+0x47/0x70 [ 33.005938] kvmalloc_node+0x64/0xd0 [ 33.009620] alloc_netdev_mqs+0x16e/0xed0 [ 33.013733] __tun_chr_ioctl+0x12be/0x3d20 [ 33.017934] tun_chr_compat_ioctl+0x29/0x30 [ 33.022226] compat_SyS_ioctl+0x1d7/0x3290 [ 33.026427] do_fast_syscall_32+0x3f2/0xf05 [ 33.030714] entry_SYSENTER_compat+0x51/0x60 [ 33.035087] [ 33.036684] Freed by task 2989: [ 33.039933] save_stack_trace+0x16/0x20 [ 33.043874] save_stack+0x43/0xd0 [ 33.047293] kasan_slab_free+0x71/0xc0 [ 33.051146] kfree+0xca/0x250 [ 33.054218] kvfree+0x36/0x60 [ 33.057291] free_netdev+0x2cf/0x360 [ 33.060970] __tun_chr_ioctl+0x2cf6/0x3d20 [ 33.065171] tun_chr_compat_ioctl+0x29/0x30 [ 33.069461] compat_SyS_ioctl+0x1d7/0x3290 [ 33.073664] do_fast_syscall_32+0x3f2/0xf05 [ 33.077953] entry_SYSENTER_compat+0x51/0x60 [ 33.082325] [ 33.083921] The buggy address belongs to the object at ffff8801ce518340 [ 33.083921] which belongs to the cache kmalloc-16384 of size 16384 [ 33.096892] The buggy address is located 13312 bytes inside of [ 33.096892] 16384-byte region [ffff8801ce518340, ffff8801ce51c340) [ 33.109081] The buggy address belongs to the page: [ 33.113978] page:ffffea0007394600 count:1 mapcount:0 mapping:ffff8801ce518340 index:0x0 compound_mapcount: 0 [ 33.123917] flags: 0x200000000008100(slab|head) [ 33.128554] raw: 0200000000008100 ffff8801ce518340 0000000000000000 0000000100000001 [ 33.136407] raw: ffffea0007389220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 33.144255] page dumped because: kasan: bad access detected [ 33.149931] [ 33.151528] Memory state around the buggy address: [ 33.156423] ffff8801ce51b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.163751] ffff8801ce51b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.171080] >ffff8801ce51b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.178405] ^ [ 33.183823] ffff8801ce51b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.191149] ffff8801ce51b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.198472] ================================================================== [ 33.205795] Disabling lock debugging due to kernel taint [ 33.211205] Kernel panic - not syncing: panic_on_warn set ... [ 33.211205] [ 33.218530] CPU: 0 PID: 2989 Comm: syzkaller974106 Tainted: G B 4.14.0-rc2+ #21 [ 33.227065] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.236381] Call Trace: [ 33.238933] dump_stack+0x194/0x257 [ 33.242526] ? arch_local_irq_restore+0x53/0x53 [ 33.247158] ? vprintk_default+0x28/0x30 [ 33.251185] ? detach_if_pending+0x500/0x610 [ 33.255559] panic+0x1e4/0x417 [ 33.258714] ? __warn+0x1d9/0x1d9 [ 33.262136] ? detach_if_pending+0x557/0x610 [ 33.266507] kasan_end_report+0x50/0x50 [ 33.270446] kasan_report+0x144/0x340 [ 33.274211] __asan_report_store8_noabort+0x17/0x20 [ 33.279190] detach_if_pending+0x557/0x610 [ 33.283388] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.288541] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.293173] ? lock_timer_base+0x1a3/0x2b0 [ 33.297380] ? lock_timer_base+0x1eb/0x2b0 [ 33.301579] ? __internal_add_timer+0x2d0/0x2d0 [ 33.306214] ? trace_hardirqs_on+0xd/0x10 [ 33.310330] try_to_del_timer_sync+0xa2/0x120 [ 33.314789] ? del_timer+0x130/0x130 [ 33.318468] ? del_timer_sync+0xeb/0x240 [ 33.322497] del_timer_sync+0x18a/0x240 [ 33.326435] tun_free_netdev+0x105/0x1b0 [ 33.330458] ? tun_xdp+0x410/0x410 [ 33.333961] ? cpumask_next+0x24/0x30 [ 33.337735] ? netdev_refcnt_read+0xed/0x150 [ 33.342121] ? tun_xdp+0x410/0x410 [ 33.345625] netdev_run_todo+0x870/0xca0 [ 33.349648] ? do_group_exit+0x149/0x400 [ 33.353674] ? register_netdev+0x30/0x30 [ 33.357700] ? lock_downgrade+0x990/0x990 [ 33.361812] ? trace_hardirqs_on+0xd/0x10 [ 33.365932] ? refcount_sub_and_test+0x115/0x1b0 [ 33.370650] ? refcount_inc+0x50/0x50 [ 33.374413] ? refcount_inc+0x50/0x50 [ 33.378180] ? sk_destruct+0x4c/0x80 [ 33.381864] ? __sk_free+0x5c/0x230 [ 33.385455] ? sk_free+0x2f/0x40 [ 33.388784] ? __tun_detach+0x176/0x1390 [ 33.392814] ? tun_attach+0xf90/0xf90 [ 33.396583] ? locks_remove_file+0x3fa/0x5a0 [ 33.400954] ? fcntl_setlk+0x10d0/0x10d0 [ 33.404981] ? __fsnotify_parent+0xb4/0x3a0 [ 33.409266] ? fsnotify+0x1af0/0x1af0 [ 33.413033] ? __tun_detach+0x1390/0x1390 [ 33.417155] ? __tun_detach+0x1390/0x1390 [ 33.421268] rtnl_unlock+0xe/0x10 [ 33.424683] tun_chr_close+0x49/0x60 [ 33.428360] __fput+0x333/0x7f0 [ 33.431607] ? fput+0x140/0x140 [ 33.434850] ? check_same_owner+0x320/0x320 [ 33.439140] ____fput+0x15/0x20 [ 33.442384] task_work_run+0x199/0x270 [ 33.446237] ? task_work_cancel+0x210/0x210 [ 33.450521] ? free_nsproxy+0x185/0x1f0 [ 33.454461] ? switch_task_namespaces+0xa2/0xc0 [ 33.459094] do_exit+0x9d2/0x1af0 [ 33.462519] ? __handle_mm_fault+0xf07/0x39c0 [ 33.466979] ? mm_update_next_owner+0x930/0x930 [ 33.471611] ? lock_release+0xd70/0xd70 [ 33.475548] ? check_noncircular+0x20/0x20 [ 33.479749] ? kfree+0xe4/0x250 [ 33.482991] ? kvfree+0x36/0x60 [ 33.486235] ? trace_hardirqs_on+0xd/0x10 [ 33.490360] ? check_noncircular+0x20/0x20 [ 33.494559] ? __handle_mm_fault+0x587/0x39c0 [ 33.499019] ? __pmd_alloc+0x4e0/0x4e0 [ 33.502877] ? find_held_lock+0x39/0x1d0 [ 33.506906] ? lock_downgrade+0x990/0x990 [ 33.511032] ? handle_mm_fault+0x410/0x8d0 [ 33.515228] ? down_read_trylock+0xdb/0x170 [ 33.519515] ? __do_page_fault+0x31e/0xd60 [ 33.523714] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.528260] ? vmacache_find+0x5f/0x280