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-3,10.128.0.19' (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: [ 42.449499] ================================================================== [ 42.456920] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 42.463647] Write of size 8 at addr ffff8801ce3eb780 by task syzkaller940869/2983 [ 42.471239] [ 42.472842] CPU: 0 PID: 2983 Comm: syzkaller940869 Not tainted 4.14.0-rc3+ #23 [ 42.480171] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.489494] Call Trace: [ 42.492059] dump_stack+0x194/0x257 [ 42.495660] ? arch_local_irq_restore+0x53/0x53 [ 42.500303] ? show_regs_print_info+0x65/0x65 [ 42.504772] ? lock_timer_base+0x1a3/0x2b0 [ 42.508980] ? detach_if_pending+0x557/0x610 [ 42.513359] print_address_description+0x73/0x250 [ 42.518173] ? detach_if_pending+0x557/0x610 [ 42.522553] kasan_report+0x25b/0x340 [ 42.526330] __asan_report_store8_noabort+0x17/0x20 [ 42.531314] detach_if_pending+0x557/0x610 [ 42.535523] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.540685] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.545323] ? lock_timer_base+0x1a3/0x2b0 [ 42.549527] ? lock_timer_base+0x1eb/0x2b0 [ 42.553737] ? __internal_add_timer+0x2d0/0x2d0 [ 42.558389] ? trace_hardirqs_on+0xd/0x10 [ 42.562515] try_to_del_timer_sync+0xa2/0x120 [ 42.566981] ? del_timer+0x130/0x130 [ 42.570665] ? del_timer_sync+0xeb/0x240 [ 42.574702] del_timer_sync+0x18a/0x240 [ 42.578649] tun_free_netdev+0x105/0x1b0 [ 42.582681] ? tun_xdp+0x410/0x410 [ 42.586192] ? cpumask_next+0x24/0x30 [ 42.589969] ? netdev_refcnt_read+0xed/0x150 [ 42.594351] ? tun_xdp+0x410/0x410 [ 42.597860] netdev_run_todo+0x870/0xca0 [ 42.601892] ? do_group_exit+0x149/0x400 [ 42.605931] ? register_netdev+0x30/0x30 [ 42.609968] ? lock_downgrade+0x990/0x990 [ 42.614087] ? trace_hardirqs_on+0xd/0x10 [ 42.618221] ? refcount_sub_and_test+0x115/0x1b0 [ 42.622945] ? refcount_inc+0x50/0x50 [ 42.626715] ? refcount_inc+0x50/0x50 [ 42.630490] ? sk_destruct+0x4c/0x80 [ 42.634178] ? __sk_free+0x5c/0x230 [ 42.637775] ? sk_free+0x2f/0x40 [ 42.641111] ? __tun_detach+0x176/0x1390 [ 42.645151] ? tun_attach+0xf90/0xf90 [ 42.648935] ? locks_remove_file+0x3fa/0x5a0 [ 42.653316] ? fcntl_setlk+0x10d0/0x10d0 [ 42.657350] ? __fsnotify_parent+0xb4/0x3a0 [ 42.661644] ? fsnotify+0x1af0/0x1af0 [ 42.665416] ? __tun_detach+0x1390/0x1390 [ 42.669534] ? __tun_detach+0x1390/0x1390 [ 42.673653] rtnl_unlock+0xe/0x10 [ 42.677075] tun_chr_close+0x49/0x60 [ 42.680757] __fput+0x333/0x7f0 [ 42.684012] ? fput+0x140/0x140 [ 42.687265] ? check_same_owner+0x320/0x320 [ 42.691567] ____fput+0x15/0x20 [ 42.694819] task_work_run+0x199/0x270 [ 42.698680] ? task_work_cancel+0x210/0x210 [ 42.702975] ? free_nsproxy+0x185/0x1f0 [ 42.706921] ? switch_task_namespaces+0xa2/0xc0 [ 42.711565] do_exit+0x9d2/0x1af0 [ 42.714986] ? __handle_mm_fault+0xf07/0x39c0 [ 42.719457] ? mm_update_next_owner+0x930/0x930 [ 42.724354] ? lock_release+0xd70/0xd70 [ 42.728299] ? check_noncircular+0x20/0x20 [ 42.732511] ? kfree+0xe4/0x250 [ 42.735767] ? kvfree+0x36/0x60 [ 42.739021] ? trace_hardirqs_on+0xd/0x10 [ 42.743141] ? check_noncircular+0x20/0x20 [ 42.747349] ? __handle_mm_fault+0x587/0x39c0 [ 42.751819] ? __pmd_alloc+0x4e0/0x4e0 [ 42.755687] ? find_held_lock+0x39/0x1d0 [ 42.759729] ? lock_downgrade+0x990/0x990 [ 42.763867] ? handle_mm_fault+0x410/0x8d0 [ 42.768070] ? down_read_trylock+0xdb/0x170 [ 42.772359] ? __do_page_fault+0x31e/0xd60 [ 42.776565] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.781114] ? vmacache_find+0x5f/0x280 [ 42.785067] do_group_exit+0x149/0x400 [ 42.788923] ? __do_page_fault+0x3d6/0xd60 [ 42.793126] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 42.797503] ? SyS_exit+0x30/0x30 [ 42.800930] ? do_fast_syscall_32+0x158/0xf05 [ 42.805395] ? do_group_exit+0x400/0x400 [ 42.809426] SyS_exit_group+0x1d/0x20 [ 42.813198] do_fast_syscall_32+0x3f2/0xf05 [ 42.817500] ? do_int80_syscall_32+0x940/0x940 [ 42.822056] ? lockdep_sys_exit+0x47/0xf0 [ 42.826175] ? syscall_return_slowpath+0x2b3/0x510 [ 42.831072] ? finish_task_switch+0x1aa/0x740 [ 42.835540] ? lockdep_sys_exit+0x47/0xf0 [ 42.839659] ? retint_user+0x18/0x20 [ 42.843346] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.848164] entry_SYSENTER_compat+0x51/0x60 [ 42.852542] RIP: 0023:0xf7ff9c79 [ 42.855877] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 42.863557] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 42.870801] RDX: 0000000000000001 RSI: 0000000020c63fd8 RDI: 00000000400454ca [ 42.878040] RBP: 0000000008072cd6 R08: 0000000000000000 R09: 0000000000000000 [ 42.885278] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.892518] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.899778] [ 42.901376] Allocated by task 2983: [ 42.904974] save_stack_trace+0x16/0x20 [ 42.908917] save_stack+0x43/0xd0 [ 42.912339] kasan_kmalloc+0xad/0xe0 [ 42.916022] __kmalloc_node+0x47/0x70 [ 42.919790] kvmalloc_node+0x64/0xd0 [ 42.923475] alloc_netdev_mqs+0x16e/0xed0 [ 42.927593] __tun_chr_ioctl+0x12be/0x3d20 [ 42.931798] tun_chr_compat_ioctl+0x29/0x30 [ 42.936089] compat_SyS_ioctl+0x1d7/0x3290 [ 42.940291] do_fast_syscall_32+0x3f2/0xf05 [ 42.944579] entry_SYSENTER_compat+0x51/0x60 [ 42.948954] [ 42.950549] Freed by task 2983: [ 42.953798] save_stack_trace+0x16/0x20 [ 42.957741] save_stack+0x43/0xd0 [ 42.961162] kasan_slab_free+0x71/0xc0 [ 42.965017] kfree+0xca/0x250 [ 42.968089] kvfree+0x36/0x60 [ 42.971163] free_netdev+0x2cf/0x360 [ 42.974849] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.979052] tun_chr_compat_ioctl+0x29/0x30 [ 42.983340] compat_SyS_ioctl+0x1d7/0x3290 [ 42.987542] do_fast_syscall_32+0x3f2/0xf05 [ 42.991830] entry_SYSENTER_compat+0x51/0x60 [ 42.996202] [ 42.997804] The buggy address belongs to the object at ffff8801ce3e8380 [ 42.997804] which belongs to the cache kmalloc-16384 of size 16384 [ 43.010774] The buggy address is located 13312 bytes inside of [ 43.010774] 16384-byte region [ffff8801ce3e8380, ffff8801ce3ec380) [ 43.022959] The buggy address belongs to the page: [ 43.027858] page:ffffea000738fa00 count:1 mapcount:0 mapping:ffff8801ce3e8380 index:0x0 compound_mapcount: 0 [ 43.037799] flags: 0x200000000008100(slab|head) [ 43.042439] raw: 0200000000008100 ffff8801ce3e8380 0000000000000000 0000000100000001 [ 43.050288] raw: ffffea0007388820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 43.058135] page dumped because: kasan: bad access detected [ 43.063812] [ 43.065407] Memory state around the buggy address: [ 43.070306] ffff8801ce3eb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.077634] ffff8801ce3eb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.084961] >ffff8801ce3eb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.092286] ^ [ 43.095621] ffff8801ce3eb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.102946] ffff8801ce3eb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.110270] ================================================================== [ 43.117593] Disabling lock debugging due to kernel taint [ 43.123006] Kernel panic - not syncing: panic_on_warn set ... [ 43.123006] [ 43.130333] CPU: 0 PID: 2983 Comm: syzkaller940869 Tainted: G B 4.14.0-rc3+ #23 [ 43.138872] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.148187] Call Trace: [ 43.150742] dump_stack+0x194/0x257 [ 43.154335] ? arch_local_irq_restore+0x53/0x53 [ 43.158970] ? vprintk_default+0x28/0x30 [ 43.162998] ? detach_if_pending+0x500/0x610 [ 43.167371] panic+0x1e4/0x417 [ 43.170527] ? __warn+0x1d9/0x1d9 [ 43.173950] ? detach_if_pending+0x557/0x610 [ 43.178322] kasan_end_report+0x50/0x50 [ 43.182256] kasan_report+0x144/0x340 [ 43.186023] __asan_report_store8_noabort+0x17/0x20 [ 43.191001] detach_if_pending+0x557/0x610 [ 43.195200] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.200355] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.204983] ? lock_timer_base+0x1a3/0x2b0 [ 43.209182] ? lock_timer_base+0x1eb/0x2b0 [ 43.213381] ? __internal_add_timer+0x2d0/0x2d0 [ 43.218014] ? trace_hardirqs_on+0xd/0x10 [ 43.222129] try_to_del_timer_sync+0xa2/0x120 [ 43.226585] ? del_timer+0x130/0x130 [ 43.230261] ? del_timer_sync+0xeb/0x240 [ 43.234289] del_timer_sync+0x18a/0x240 [ 43.238228] tun_free_netdev+0x105/0x1b0 [ 43.242252] ? tun_xdp+0x410/0x410 [ 43.245755] ? cpumask_next+0x24/0x30 [ 43.249519] ? netdev_refcnt_read+0xed/0x150 [ 43.253891] ? tun_xdp+0x410/0x410 [ 43.257392] netdev_run_todo+0x870/0xca0 [ 43.261419] ? do_group_exit+0x149/0x400 [ 43.265444] ? register_netdev+0x30/0x30 [ 43.269472] ? lock_downgrade+0x990/0x990 [ 43.273583] ? trace_hardirqs_on+0xd/0x10 [ 43.277704] ? refcount_sub_and_test+0x115/0x1b0 [ 43.282424] ? refcount_inc+0x50/0x50 [ 43.286188] ? refcount_inc+0x50/0x50 [ 43.289954] ? sk_destruct+0x4c/0x80 [ 43.293630] ? __sk_free+0x5c/0x230 [ 43.297220] ? sk_free+0x2f/0x40 [ 43.300550] ? __tun_detach+0x176/0x1390 [ 43.304579] ? tun_attach+0xf90/0xf90 [ 43.308350] ? locks_remove_file+0x3fa/0x5a0 [ 43.312722] ? fcntl_setlk+0x10d0/0x10d0 [ 43.316749] ? __fsnotify_parent+0xb4/0x3a0 [ 43.321036] ? fsnotify+0x1af0/0x1af0 [ 43.324803] ? __tun_detach+0x1390/0x1390 [ 43.328915] ? __tun_detach+0x1390/0x1390 [ 43.333026] rtnl_unlock+0xe/0x10 [ 43.336440] tun_chr_close+0x49/0x60 [ 43.340115] __fput+0x333/0x7f0 [ 43.343360] ? fput+0x140/0x140 [ 43.346603] ? check_same_owner+0x320/0x320 [ 43.350890] ____fput+0x15/0x20 [ 43.354136] task_work_run+0x199/0x270 [ 43.357988] ? task_work_cancel+0x210/0x210 [ 43.362277] ? free_nsproxy+0x185/0x1f0 [ 43.366215] ? switch_task_namespaces+0xa2/0xc0 [ 43.370849] do_exit+0x9d2/0x1af0 [ 43.374266] ? __handle_mm_fault+0xf07/0x39c0 [ 43.378727] ? mm_update_next_owner+0x930/0x930 [ 43.383358] ? lock_release+0xd70/0xd70 [ 43.387296] ? check_noncircular+0x20/0x20 [ 43.391494] ? kfree+0xe4/0x250 [ 43.394738] ? kvfree+0x36/0x60 [ 43.397982] ? trace_hardirqs_on+0xd/0x10 [ 43.402093] ? check_noncircular+0x20/0x20 [ 43.406293] ? __handle_mm_fault+0x587/0x39c0 [ 43.410755] ? __pmd_alloc+0x4e0/0x4e0 [ 43.414614] ? find_held_lock+0x39/0x1d0 [ 43.418647] ? lock_downgrade+0x990/0x990 [ 43.422769] ? handle_mm_fault+0x410/0x8d0 [ 43.426966] ? down_read_trylock+0xdb/0x170 [ 43.431252] ? __do_page_fault+0x31e/0xd60 [ 43.435450] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.439995] ? vmacache_find+0x5f/0x280 [ 43.443938] do_group_exit+0x149/0x400 [ 43.447788] ? __do_page_fault+0x3d6/0xd60