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.201' (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: [ 41.593488] ================================================================== [ 41.600961] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.607692] Write of size 8 at addr ffff8801ce073780 by task syzkaller681867/2984 [ 41.615281] [ 41.616884] CPU: 1 PID: 2984 Comm: syzkaller681867 Not tainted 4.14.0-rc3+ #24 [ 41.624218] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.633546] Call Trace: [ 41.636112] dump_stack+0x194/0x257 [ 41.639721] ? arch_local_irq_restore+0x53/0x53 [ 41.644371] ? show_regs_print_info+0x65/0x65 [ 41.648846] ? lock_timer_base+0x1a3/0x2b0 [ 41.653055] ? detach_if_pending+0x557/0x610 [ 41.657438] print_address_description+0x73/0x250 [ 41.662252] ? detach_if_pending+0x557/0x610 [ 41.666633] kasan_report+0x25b/0x340 [ 41.670410] __asan_report_store8_noabort+0x17/0x20 [ 41.675400] detach_if_pending+0x557/0x610 [ 41.679612] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.684779] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.689422] ? lock_timer_base+0x1a3/0x2b0 [ 41.693637] ? lock_timer_base+0x1eb/0x2b0 [ 41.697850] ? __internal_add_timer+0x2d0/0x2d0 [ 41.702500] ? trace_hardirqs_on+0xd/0x10 [ 41.706632] try_to_del_timer_sync+0xa2/0x120 [ 41.711101] ? del_timer+0x130/0x130 [ 41.714791] ? del_timer_sync+0xeb/0x240 [ 41.718833] del_timer_sync+0x18a/0x240 [ 41.722787] tun_free_netdev+0x105/0x1b0 [ 41.726824] ? tun_xdp+0x410/0x410 [ 41.730337] ? cpumask_next+0x24/0x30 [ 41.734114] ? netdev_refcnt_read+0xed/0x150 [ 41.738499] ? tun_xdp+0x410/0x410 [ 41.742015] netdev_run_todo+0x870/0xca0 [ 41.746048] ? do_group_exit+0x149/0x400 [ 41.750086] ? register_netdev+0x30/0x30 [ 41.754124] ? lock_downgrade+0x990/0x990 [ 41.758244] ? trace_hardirqs_on+0xd/0x10 [ 41.762384] ? refcount_sub_and_test+0x115/0x1b0 [ 41.767112] ? refcount_inc+0x50/0x50 [ 41.770898] ? refcount_inc+0x50/0x50 [ 41.774677] ? sk_destruct+0x4c/0x80 [ 41.778362] ? __sk_free+0x5c/0x230 [ 41.781962] ? sk_free+0x2f/0x40 [ 41.785299] ? __tun_detach+0x176/0x1390 [ 41.789344] ? tun_attach+0xf90/0xf90 [ 41.793130] ? locks_remove_file+0x3fa/0x5a0 [ 41.797516] ? fcntl_setlk+0x10d0/0x10d0 [ 41.801557] ? __fsnotify_parent+0xb4/0x3a0 [ 41.805866] ? fsnotify+0x1af0/0x1af0 [ 41.809645] ? __tun_detach+0x1390/0x1390 [ 41.813769] ? __tun_detach+0x1390/0x1390 [ 41.817892] rtnl_unlock+0xe/0x10 [ 41.821316] tun_chr_close+0x49/0x60 [ 41.825007] __fput+0x333/0x7f0 [ 41.828266] ? fput+0x140/0x140 [ 41.831521] ? check_same_owner+0x320/0x320 [ 41.835823] ____fput+0x15/0x20 [ 41.839076] task_work_run+0x199/0x270 [ 41.842941] ? task_work_cancel+0x210/0x210 [ 41.847238] ? free_nsproxy+0x185/0x1f0 [ 41.851189] ? switch_task_namespaces+0xa2/0xc0 [ 41.855841] do_exit+0x9d2/0x1af0 [ 41.859266] ? trace_hardirqs_on+0xd/0x10 [ 41.863411] ? mm_update_next_owner+0x930/0x930 [ 41.868061] ? mark_held_locks+0xb2/0x100 [ 41.872189] ? kfree+0xe4/0x250 [ 41.875447] ? kvfree+0x36/0x60 [ 41.878701] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.883701] ? trace_hardirqs_on+0xd/0x10 [ 41.887829] ? kvfree+0x3b/0x60 [ 41.891091] ? rtnl_unlock+0xe/0x10 [ 41.894694] ? __tun_chr_ioctl+0x27a/0x3d20 [ 41.899008] ? find_held_lock+0x39/0x1d0 [ 41.903051] ? __might_sleep+0x95/0x190 [ 41.907011] ? selinux_file_ioctl+0x444/0x690 [ 41.911479] ? __fget_light+0x29d/0x390 [ 41.915445] ? handle_mm_fault+0x410/0x8d0 [ 41.919660] ? tun_chr_compat_ioctl+0x29/0x30 [ 41.924126] ? tun_chr_compat_ioctl+0x29/0x30 [ 41.928598] do_group_exit+0x149/0x400 [ 41.932456] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 41.936837] ? SyS_exit+0x30/0x30 [ 41.940265] ? do_ioctl+0x60/0x60 [ 41.943696] ? do_fast_syscall_32+0x158/0xf05 [ 41.948168] ? do_group_exit+0x400/0x400 [ 41.952201] SyS_exit_group+0x1d/0x20 [ 41.955975] do_fast_syscall_32+0x3f2/0xf05 [ 41.960274] ? do_int80_syscall_32+0x940/0x940 [ 41.964829] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.969562] ? lockdep_sys_exit+0x47/0xf0 [ 41.973683] ? syscall_return_slowpath+0x2b3/0x510 [ 41.978590] ? sysret32_from_system_call+0x5/0x3b [ 41.983407] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 41.988227] entry_SYSENTER_compat+0x51/0x60 [ 41.992609] RIP: 0023:0xf7f1ac79 [ 41.995944] RSP: 002b:00000000ff99d20c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 42.003627] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ff99d3f8 [ 42.010870] RDX: 0000000008048c9a RSI: 0000000000000036 RDI: 0000000000000004 [ 42.018113] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 42.025354] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.032600] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.039863] [ 42.041464] Allocated by task 2984: [ 42.045093] save_stack_trace+0x16/0x20 [ 42.049042] save_stack+0x43/0xd0 [ 42.052467] kasan_kmalloc+0xad/0xe0 [ 42.056152] __kmalloc_node+0x47/0x70 [ 42.059927] kvmalloc_node+0x64/0xd0 [ 42.063617] alloc_netdev_mqs+0x16e/0xed0 [ 42.067738] __tun_chr_ioctl+0x12be/0x3d20 [ 42.071942] tun_chr_compat_ioctl+0x29/0x30 [ 42.076236] compat_SyS_ioctl+0x1d7/0x3290 [ 42.080442] do_fast_syscall_32+0x3f2/0xf05 [ 42.084735] entry_SYSENTER_compat+0x51/0x60 [ 42.089113] [ 42.090714] Freed by task 2984: [ 42.093965] save_stack_trace+0x16/0x20 [ 42.097912] save_stack+0x43/0xd0 [ 42.101335] kasan_slab_free+0x71/0xc0 [ 42.105205] kfree+0xca/0x250 [ 42.108284] kvfree+0x36/0x60 [ 42.111360] free_netdev+0x2cf/0x360 [ 42.115043] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.119246] tun_chr_compat_ioctl+0x29/0x30 [ 42.123538] compat_SyS_ioctl+0x1d7/0x3290 [ 42.127742] do_fast_syscall_32+0x3f2/0xf05 [ 42.132033] entry_SYSENTER_compat+0x51/0x60 [ 42.136406] [ 42.138007] The buggy address belongs to the object at ffff8801ce070380 [ 42.138007] which belongs to the cache kmalloc-16384 of size 16384 [ 42.150981] The buggy address is located 13312 bytes inside of [ 42.150981] 16384-byte region [ffff8801ce070380, ffff8801ce074380) [ 42.163173] The buggy address belongs to the page: [ 42.168073] page:ffffea0007381c00 count:1 mapcount:0 mapping:ffff8801ce070380 index:0x0 compound_mapcount: 0 [ 42.178021] flags: 0x200000000008100(slab|head) [ 42.182665] raw: 0200000000008100 ffff8801ce070380 0000000000000000 0000000100000001 [ 42.190518] raw: ffffea0007334a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.198367] page dumped because: kasan: bad access detected [ 42.204050] [ 42.205651] Memory state around the buggy address: [ 42.210554] ffff8801ce073680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.217882] ffff8801ce073700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.225211] >ffff8801ce073780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.232555] ^ [ 42.235897] ffff8801ce073800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.243228] ffff8801ce073880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.250561] ================================================================== [ 42.257888] Disabling lock debugging due to kernel taint [ 42.263304] Kernel panic - not syncing: panic_on_warn set ... [ 42.263304] [ 42.270633] CPU: 1 PID: 2984 Comm: syzkaller681867 Tainted: G B 4.14.0-rc3+ #24 [ 42.279172] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.288492] Call Trace: [ 42.291057] dump_stack+0x194/0x257 [ 42.294653] ? arch_local_irq_restore+0x53/0x53 [ 42.299291] ? vprintk_default+0x28/0x30 [ 42.303322] ? detach_if_pending+0x500/0x610 [ 42.307702] panic+0x1e4/0x417 [ 42.310862] ? __warn+0x1d9/0x1d9 [ 42.314289] ? detach_if_pending+0x557/0x610 [ 42.318668] kasan_end_report+0x50/0x50 [ 42.322615] kasan_report+0x144/0x340 [ 42.326384] __asan_report_store8_noabort+0x17/0x20 [ 42.331364] detach_if_pending+0x557/0x610 [ 42.335568] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.340727] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.345360] ? lock_timer_base+0x1a3/0x2b0 [ 42.349562] ? lock_timer_base+0x1eb/0x2b0 [ 42.353767] ? __internal_add_timer+0x2d0/0x2d0 [ 42.358404] ? trace_hardirqs_on+0xd/0x10 [ 42.362520] try_to_del_timer_sync+0xa2/0x120 [ 42.366986] ? del_timer+0x130/0x130 [ 42.370667] ? del_timer_sync+0xeb/0x240 [ 42.374714] del_timer_sync+0x18a/0x240 [ 42.378659] tun_free_netdev+0x105/0x1b0 [ 42.382689] ? tun_xdp+0x410/0x410 [ 42.386195] ? cpumask_next+0x24/0x30 [ 42.389965] ? netdev_refcnt_read+0xed/0x150 [ 42.394344] ? tun_xdp+0x410/0x410 [ 42.397851] netdev_run_todo+0x870/0xca0 [ 42.401879] ? do_group_exit+0x149/0x400 [ 42.405909] ? register_netdev+0x30/0x30 [ 42.409942] ? lock_downgrade+0x990/0x990 [ 42.414058] ? trace_hardirqs_on+0xd/0x10 [ 42.418184] ? refcount_sub_and_test+0x115/0x1b0 [ 42.422905] ? refcount_inc+0x50/0x50 [ 42.426674] ? refcount_inc+0x50/0x50 [ 42.430442] ? sk_destruct+0x4c/0x80 [ 42.434120] ? __sk_free+0x5c/0x230 [ 42.437713] ? sk_free+0x2f/0x40 [ 42.441047] ? __tun_detach+0x176/0x1390 [ 42.445081] ? tun_attach+0xf90/0xf90 [ 42.448855] ? locks_remove_file+0x3fa/0x5a0 [ 42.453237] ? fcntl_setlk+0x10d0/0x10d0 [ 42.457270] ? __fsnotify_parent+0xb4/0x3a0 [ 42.461559] ? fsnotify+0x1af0/0x1af0 [ 42.465329] ? __tun_detach+0x1390/0x1390 [ 42.469444] ? __tun_detach+0x1390/0x1390 [ 42.473573] rtnl_unlock+0xe/0x10 [ 42.476994] tun_chr_close+0x49/0x60 [ 42.480690] __fput+0x333/0x7f0 [ 42.483942] ? fput+0x140/0x140 [ 42.487189] ? check_same_owner+0x320/0x320 [ 42.491478] ____fput+0x15/0x20 [ 42.494725] task_work_run+0x199/0x270 [ 42.498581] ? task_work_cancel+0x210/0x210 [ 42.502869] ? free_nsproxy+0x185/0x1f0 [ 42.506811] ? switch_task_namespaces+0xa2/0xc0 [ 42.511450] do_exit+0x9d2/0x1af0 [ 42.514871] ? trace_hardirqs_on+0xd/0x10 [ 42.518987] ? mm_update_next_owner+0x930/0x930 [ 42.523623] ? mark_held_locks+0xb2/0x100 [ 42.527741] ? kfree+0xe4/0x250 [ 42.530988] ? kvfree+0x36/0x60 [ 42.534234] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.539216] ? trace_hardirqs_on+0xd/0x10 [ 42.543341] ? kvfree+0x3b/0x60 [ 42.546601] ? rtnl_unlock+0xe/0x10 [ 42.550190] ? __tun_chr_ioctl+0x27a/0x3d20 [ 42.554485] ? find_held_lock+0x39/0x1d0 [ 42.558512] ? __might_sleep+0x95/0x190 [ 42.562459] ? selinux_file_ioctl+0x444/0x690 [ 42.566920] ? __fget_light+0x29d/0x390 [ 42.570869] ? handle_mm_fault+0x410/0x8d0 [ 42.575071] ? tun_chr_compat_ioctl+0x29/0x30 [ 42.579535] ? tun_chr_compat_ioctl+0x29/0x30 [ 42.583995] do_group_exit+0x149/0x400 [ 42.587849] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 42.592221] ? SyS_exit+0x30/0x30