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.0.3' (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: [ 24.140451] ================================================================== [ 24.141546] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 24.142441] Write of size 8 at addr ffff8801ceb13780 by task syzkaller712212/2977 [ 24.143439] [ 24.143677] CPU: 0 PID: 2977 Comm: syzkaller712212 Not tainted 4.14.0-rc2+ #20 [ 24.144645] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.145890] Call Trace: [ 24.146256] dump_stack+0x194/0x257 [ 24.146754] ? arch_local_irq_restore+0x53/0x53 [ 24.147382] ? show_regs_print_info+0x65/0x65 [ 24.147992] ? lock_timer_base+0x1a3/0x2b0 [ 24.148565] ? detach_if_pending+0x557/0x610 [ 24.149162] print_address_description+0x73/0x250 [ 24.149810] ? detach_if_pending+0x557/0x610 [ 24.150407] kasan_report+0x25b/0x340 [ 24.150926] __asan_report_store8_noabort+0x17/0x20 [ 24.151597] detach_if_pending+0x557/0x610 [ 24.152170] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.152863] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.153489] ? lock_timer_base+0x1a3/0x2b0 [ 24.154059] ? lock_timer_base+0x1eb/0x2b0 [ 24.154631] ? __internal_add_timer+0x2d0/0x2d0 [ 24.155257] ? trace_hardirqs_on+0xd/0x10 [ 24.155900] try_to_del_timer_sync+0xa2/0x120 [ 24.156503] ? del_timer+0x130/0x130 [ 24.157011] ? del_timer_sync+0xeb/0x240 [ 24.157606] del_timer_sync+0x18a/0x240 [ 24.158147] tun_free_netdev+0x105/0x1b0 [ 24.158696] ? tun_xdp+0x410/0x410 [ 24.159177] ? cpumask_next+0x24/0x30 [ 24.159694] ? netdev_refcnt_read+0xed/0x150 [ 24.160291] ? tun_xdp+0x410/0x410 [ 24.160773] netdev_run_todo+0x870/0xca0 [ 24.164808] ? do_group_exit+0x149/0x400 [ 24.168847] ? register_netdev+0x30/0x30 [ 24.172884] ? lock_downgrade+0x990/0x990 [ 24.177001] ? trace_hardirqs_on+0xd/0x10 [ 24.181139] ? refcount_sub_and_test+0x115/0x1b0 [ 24.185863] ? refcount_inc+0x50/0x50 [ 24.189634] ? refcount_inc+0x50/0x50 [ 24.193413] ? sk_destruct+0x4c/0x80 [ 24.197106] ? __sk_free+0x5c/0x230 [ 24.200702] ? sk_free+0x2f/0x40 [ 24.204037] ? __tun_detach+0x176/0x1390 [ 24.208079] ? tun_attach+0xf90/0xf90 [ 24.211858] ? locks_remove_file+0x3fa/0x5a0 [ 24.216240] ? fcntl_setlk+0x10d0/0x10d0 [ 24.220274] ? __fsnotify_parent+0xb4/0x3a0 [ 24.224568] ? fsnotify+0x1af0/0x1af0 [ 24.228341] ? __tun_detach+0x1390/0x1390 [ 24.232458] ? __tun_detach+0x1390/0x1390 [ 24.236575] rtnl_unlock+0xe/0x10 [ 24.239997] tun_chr_close+0x49/0x60 [ 24.243680] __fput+0x333/0x7f0 [ 24.246935] ? fput+0x140/0x140 [ 24.250185] ? check_same_owner+0x320/0x320 [ 24.254482] ____fput+0x15/0x20 [ 24.257729] task_work_run+0x199/0x270 [ 24.261588] ? task_work_cancel+0x210/0x210 [ 24.265880] ? free_nsproxy+0x185/0x1f0 [ 24.269826] ? switch_task_namespaces+0xa2/0xc0 [ 24.274469] do_exit+0x9d2/0x1af0 [ 24.277889] ? trace_hardirqs_on+0xd/0x10 [ 24.282010] ? mm_update_next_owner+0x930/0x930 [ 24.286647] ? lock_acquire+0x1d5/0x580 [ 24.290589] ? __handle_mm_fault+0xf07/0x39c0 [ 24.295060] ? lock_release+0xd70/0xd70 [ 24.299001] ? check_noncircular+0x20/0x20 [ 24.303206] ? kvfree+0x3b/0x60 [ 24.306459] ? rtnl_unlock+0xe/0x10 [ 24.310057] ? check_noncircular+0x20/0x20 [ 24.314263] ? __handle_mm_fault+0x587/0x39c0 [ 24.318738] ? __pmd_alloc+0x4e0/0x4e0 [ 24.322605] ? find_held_lock+0x39/0x1d0 [ 24.326646] ? lock_downgrade+0x990/0x990 [ 24.330786] do_group_exit+0x149/0x400 [ 24.334639] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.339189] ? vmacache_find+0x5f/0x280 [ 24.343130] ? SyS_exit+0x30/0x30 [ 24.346559] ? do_fast_syscall_32+0x158/0xf05 [ 24.351039] ? do_group_exit+0x400/0x400 [ 24.355073] SyS_exit_group+0x1d/0x20 [ 24.358841] do_fast_syscall_32+0x3f2/0xf05 [ 24.363138] ? do_int80_syscall_32+0x940/0x940 [ 24.367692] ? lockdep_sys_exit+0x47/0xf0 [ 24.371807] ? syscall_return_slowpath+0x2b3/0x510 [ 24.376705] ? finish_task_switch+0x1aa/0x740 [ 24.381171] ? lockdep_sys_exit+0x47/0xf0 [ 24.385286] ? retint_user+0x18/0x20 [ 24.388973] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 24.393792] entry_SYSENTER_compat+0x51/0x60 [ 24.398168] RIP: 0023:0xf7f0fc79 [ 24.401499] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 24.409179] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 24.416419] RDX: 0000000000000001 RSI: 0000000020002000 RDI: 00000000400454ca [ 24.423657] RBP: 0000000008072ca6 R08: 0000000000000000 R09: 0000000000000000 [ 24.430894] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 24.438133] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 24.445394] [ 24.446990] Allocated by task 2977: [ 24.450587] save_stack_trace+0x16/0x20 [ 24.454528] save_stack+0x43/0xd0 [ 24.457951] kasan_kmalloc+0xad/0xe0 [ 24.461630] __kmalloc_node+0x47/0x70 [ 24.465399] kvmalloc_node+0x64/0xd0 [ 24.469082] alloc_netdev_mqs+0x16e/0xed0 [ 24.473197] __tun_chr_ioctl+0x12be/0x3d20 [ 24.477398] tun_chr_compat_ioctl+0x29/0x30 [ 24.481689] compat_SyS_ioctl+0x1d7/0x3290 [ 24.485890] do_fast_syscall_32+0x3f2/0xf05 [ 24.490179] entry_SYSENTER_compat+0x51/0x60 [ 24.494551] [ 24.496148] Freed by task 2977: [ 24.499394] save_stack_trace+0x16/0x20 [ 24.503337] save_stack+0x43/0xd0 [ 24.506757] kasan_slab_free+0x71/0xc0 [ 24.510612] kfree+0xca/0x250 [ 24.513686] kvfree+0x36/0x60 [ 24.516759] free_netdev+0x2cf/0x360 [ 24.520438] __tun_chr_ioctl+0x2cf6/0x3d20 [ 24.524641] tun_chr_compat_ioctl+0x29/0x30 [ 24.528929] compat_SyS_ioctl+0x1d7/0x3290 [ 24.533130] do_fast_syscall_32+0x3f2/0xf05 [ 24.537420] entry_SYSENTER_compat+0x51/0x60 [ 24.541793] [ 24.543391] The buggy address belongs to the object at ffff8801ceb10380 [ 24.543391] which belongs to the cache kmalloc-16384 of size 16384 [ 24.556364] The buggy address is located 13312 bytes inside of [ 24.556364] 16384-byte region [ffff8801ceb10380, ffff8801ceb14380) [ 24.568552] The buggy address belongs to the page: [ 24.573448] page:ffffea00073ac400 count:1 mapcount:0 mapping:ffff8801ceb10380 index:0x0 compound_mapcount: 0 [ 24.583396] flags: 0x200000000008100(slab|head) [ 24.588035] raw: 0200000000008100 ffff8801ceb10380 0000000000000000 0000000100000001 [ 24.595885] raw: ffffea000739ec20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 24.603732] page dumped because: kasan: bad access detected [ 24.609409] [ 24.611003] Memory state around the buggy address: [ 24.615897] ffff8801ceb13680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.623222] ffff8801ceb13700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.630548] >ffff8801ceb13780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.637871] ^ [ 24.641204] ffff8801ceb13800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.648532] ffff8801ceb13880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.655855] ================================================================== [ 24.663180] Disabling lock debugging due to kernel taint [ 24.668591] Kernel panic - not syncing: panic_on_warn set ... [ 24.668591] [ 24.675914] CPU: 0 PID: 2977 Comm: syzkaller712212 Tainted: G B 4.14.0-rc2+ #20 [ 24.684449] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 24.693763] Call Trace: [ 24.696316] dump_stack+0x194/0x257 [ 24.699909] ? arch_local_irq_restore+0x53/0x53 [ 24.704543] ? vprintk_default+0x28/0x30 [ 24.708571] ? detach_if_pending+0x4d0/0x610 [ 24.712944] panic+0x1e4/0x417 [ 24.716100] ? __warn+0x1d9/0x1d9 [ 24.719522] ? detach_if_pending+0x557/0x610 [ 24.723895] kasan_end_report+0x50/0x50 [ 24.727831] kasan_report+0x144/0x340 [ 24.731597] __asan_report_store8_noabort+0x17/0x20 [ 24.736575] detach_if_pending+0x557/0x610 [ 24.740780] ? trace_raw_output_tick_stop+0x130/0x130 [ 24.745933] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 24.750563] ? lock_timer_base+0x1a3/0x2b0 [ 24.754763] ? lock_timer_base+0x1eb/0x2b0 [ 24.758963] ? __internal_add_timer+0x2d0/0x2d0 [ 24.763594] ? trace_hardirqs_on+0xd/0x10 [ 24.767709] try_to_del_timer_sync+0xa2/0x120 [ 24.772164] ? del_timer+0x130/0x130 [ 24.775841] ? del_timer_sync+0xeb/0x240 [ 24.779868] del_timer_sync+0x18a/0x240 [ 24.783807] tun_free_netdev+0x105/0x1b0 [ 24.787829] ? tun_xdp+0x410/0x410 [ 24.791334] ? cpumask_next+0x24/0x30 [ 24.795101] ? netdev_refcnt_read+0xed/0x150 [ 24.799472] ? tun_xdp+0x410/0x410 [ 24.802977] netdev_run_todo+0x870/0xca0 [ 24.806999] ? do_group_exit+0x149/0x400 [ 24.811025] ? register_netdev+0x30/0x30 [ 24.815051] ? lock_downgrade+0x990/0x990 [ 24.819162] ? trace_hardirqs_on+0xd/0x10 [ 24.823284] ? refcount_sub_and_test+0x115/0x1b0 [ 24.828002] ? refcount_inc+0x50/0x50 [ 24.831778] ? refcount_inc+0x50/0x50 [ 24.835551] ? sk_destruct+0x4c/0x80 [ 24.839230] ? __sk_free+0x5c/0x230 [ 24.842820] ? sk_free+0x2f/0x40 [ 24.846149] ? __tun_detach+0x176/0x1390 [ 24.850178] ? tun_attach+0xf90/0xf90 [ 24.853946] ? locks_remove_file+0x3fa/0x5a0 [ 24.858321] ? fcntl_setlk+0x10d0/0x10d0 [ 24.862349] ? __fsnotify_parent+0xb4/0x3a0 [ 24.866633] ? fsnotify+0x1af0/0x1af0 [ 24.870397] ? __tun_detach+0x1390/0x1390 [ 24.874506] ? __tun_detach+0x1390/0x1390 [ 24.878618] rtnl_unlock+0xe/0x10 [ 24.882033] tun_chr_close+0x49/0x60 [ 24.885710] __fput+0x333/0x7f0 [ 24.888955] ? fput+0x140/0x140 [ 24.892200] ? check_same_owner+0x320/0x320 [ 24.896490] ____fput+0x15/0x20 [ 24.899732] task_work_run+0x199/0x270 [ 24.903584] ? task_work_cancel+0x210/0x210 [ 24.907867] ? free_nsproxy+0x185/0x1f0 [ 24.911804] ? switch_task_namespaces+0xa2/0xc0 [ 24.916436] do_exit+0x9d2/0x1af0 [ 24.919851] ? trace_hardirqs_on+0xd/0x10 [ 24.923964] ? mm_update_next_owner+0x930/0x930 [ 24.928593] ? lock_acquire+0x1d5/0x580 [ 24.932529] ? __handle_mm_fault+0xf07/0x39c0 [ 24.936989] ? lock_release+0xd70/0xd70 [ 24.940926] ? check_noncircular+0x20/0x20 [ 24.945136] ? kvfree+0x3b/0x60 [ 24.948381] ? rtnl_unlock+0xe/0x10 [ 24.951979] ? check_noncircular+0x20/0x20 [ 24.956180] ? __handle_mm_fault+0x587/0x39c0 [ 24.960640] ? __pmd_alloc+0x4e0/0x4e0 [ 24.964502] ? find_held_lock+0x39/0x1d0 [ 24.968531] ? lock_downgrade+0x990/0x990 [ 24.972654] do_group_exit+0x149/0x400 [ 24.976501] ? __handle_mm_fault+0x39c0/0x39c0 [ 24.981046] ? vmacache_find+0x5f/0x280 [ 24.984982] ? SyS_exit+0x30/0x30 [ 24.988401] ? do_fast_syscall_32+0x158/0xf05 [ 24.992858] ? do_group_exit+0x400/0x400 [ 24.996880] SyS_exit_group+0x1d/0x20 [ 25.000644] do_fast_syscall_32+0x3f2/0xf05 [ 25.004930] ? do_int80_syscall_32+0x940/0x940 [ 25.009479] ? lockdep_sys_exit+0x47/0xf0 [ 25.013588] ? syscall_return_slowpath+0x2b3/0x510 [ 25.018478] ? finish_task_switch+0x1aa/0x740 [ 25.022937] ? lockdep_sys_exit+0x47/0xf0 [ 25.027050] ? retint_user+0x18/0x20 [ 25.030729] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 25.035538] entry_SYSENTER_compat+0x51/0x60 [ 25.039908] RIP: 0023:0xf7f0fc79 [ 25.043234] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 25.050903] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 25.058136] RDX: 0000000000000001 RSI: 0000000020002000 RDI: 00000000400454ca [ 25.065367] RBP: 0000000008072ca6 R08: 0000000000000000 R09: 0000000000000000 [ 25.072599] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 25.079831] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000