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-1,10.128.15.193' (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.804255] ================================================================== [ 41.811832] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.818561] Write of size 8 at addr ffff8801c0aab740 by task syzkaller766187/2983 [ 41.826150] [ 41.827756] CPU: 1 PID: 2983 Comm: syzkaller766187 Not tainted 4.14.0-rc2+ #21 [ 41.835088] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.844424] Call Trace: [ 41.847000] dump_stack+0x194/0x257 [ 41.850609] ? arch_local_irq_restore+0x53/0x53 [ 41.855341] ? show_regs_print_info+0x65/0x65 [ 41.859821] ? lock_timer_base+0x1a3/0x2b0 [ 41.864044] ? detach_if_pending+0x557/0x610 [ 41.868450] print_address_description+0x73/0x250 [ 41.873287] ? detach_if_pending+0x557/0x610 [ 41.878258] kasan_report+0x25b/0x340 [ 41.882037] __asan_report_store8_noabort+0x17/0x20 [ 41.887033] detach_if_pending+0x557/0x610 [ 41.891241] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.896405] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.901055] ? lock_timer_base+0x1a3/0x2b0 [ 41.905260] ? lock_timer_base+0x1eb/0x2b0 [ 41.909474] ? __internal_add_timer+0x2d0/0x2d0 [ 41.914117] ? trace_hardirqs_on+0xd/0x10 [ 41.918244] try_to_del_timer_sync+0xa2/0x120 [ 41.922711] ? del_timer+0x130/0x130 [ 41.926397] ? del_timer_sync+0xeb/0x240 [ 41.930434] del_timer_sync+0x18a/0x240 [ 41.934385] tun_free_netdev+0x105/0x1b0 [ 41.938432] ? tun_xdp+0x410/0x410 [ 41.941943] ? cpumask_next+0x24/0x30 [ 41.945718] ? netdev_refcnt_read+0xed/0x150 [ 41.950101] ? tun_xdp+0x410/0x410 [ 41.953615] netdev_run_todo+0x870/0xca0 [ 41.957657] ? do_group_exit+0x149/0x400 [ 41.961695] ? register_netdev+0x30/0x30 [ 41.965730] ? lock_downgrade+0x990/0x990 [ 41.969853] ? trace_hardirqs_on+0xd/0x10 [ 41.973989] ? refcount_sub_and_test+0x115/0x1b0 [ 41.978724] ? refcount_inc+0x50/0x50 [ 41.982652] ? refcount_inc+0x50/0x50 [ 41.986432] ? sk_destruct+0x4c/0x80 [ 41.990129] ? __sk_free+0x5c/0x230 [ 41.993728] ? sk_free+0x2f/0x40 [ 41.997067] ? __tun_detach+0x176/0x1390 [ 42.001112] ? tun_attach+0xf90/0xf90 [ 42.004897] ? do_raw_spin_trylock+0x190/0x190 [ 42.009459] ? locks_remove_file+0x3fa/0x5a0 [ 42.013860] ? fcntl_setlk+0x10d0/0x10d0 [ 42.017895] ? __fsnotify_parent+0xb4/0x3a0 [ 42.022190] ? fsnotify+0x1af0/0x1af0 [ 42.025968] ? __tun_detach+0x1390/0x1390 [ 42.030088] ? __tun_detach+0x1390/0x1390 [ 42.034295] rtnl_unlock+0xe/0x10 [ 42.037717] tun_chr_close+0x49/0x60 [ 42.041401] __fput+0x333/0x7f0 [ 42.044668] ? fput+0x140/0x140 [ 42.047923] ? check_same_owner+0x320/0x320 [ 42.052215] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.056688] ____fput+0x15/0x20 [ 42.059949] task_work_run+0x199/0x270 [ 42.063815] ? task_work_cancel+0x210/0x210 [ 42.068110] ? _raw_spin_unlock+0x22/0x30 [ 42.072240] ? switch_task_namespaces+0x87/0xc0 [ 42.076887] do_exit+0x9d2/0x1af0 [ 42.080322] ? __handle_mm_fault+0xf07/0x39c0 [ 42.084806] ? mm_update_next_owner+0x930/0x930 [ 42.089460] ? lock_release+0xd70/0xd70 [ 42.093407] ? check_noncircular+0x20/0x20 [ 42.097627] ? kfree+0xe4/0x250 [ 42.100879] ? kvfree+0x36/0x60 [ 42.104150] ? check_noncircular+0x20/0x20 [ 42.108372] ? __handle_mm_fault+0x587/0x39c0 [ 42.112846] ? __pmd_alloc+0x4e0/0x4e0 [ 42.116718] ? find_held_lock+0x39/0x1d0 [ 42.120761] ? lock_downgrade+0x990/0x990 [ 42.124902] ? handle_mm_fault+0x410/0x8d0 [ 42.129105] ? down_read_trylock+0xdb/0x170 [ 42.133407] ? __do_page_fault+0x31e/0xd60 [ 42.137614] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.142166] ? vmacache_find+0x5f/0x280 [ 42.146109] ? vmacache_update+0xfe/0x130 [ 42.150234] do_group_exit+0x149/0x400 [ 42.154091] ? __do_page_fault+0x3d6/0xd60 [ 42.158295] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 42.162675] ? SyS_exit+0x30/0x30 [ 42.166107] ? do_fast_syscall_32+0x158/0xf05 [ 42.170575] ? do_group_exit+0x400/0x400 [ 42.174607] SyS_exit_group+0x1d/0x20 [ 42.178384] do_fast_syscall_32+0x3f2/0xf05 [ 42.182685] ? do_int80_syscall_32+0x940/0x940 [ 42.187238] ? kasan_check_read+0x11/0x20 [ 42.191361] ? syscall_return_slowpath+0x510/0x510 [ 42.196263] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.200485] ? lockdep_sys_exit+0x47/0xf0 [ 42.204605] ? retint_user+0x18/0x20 [ 42.208293] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.213122] entry_SYSENTER_compat+0x51/0x60 [ 42.217501] RIP: 0023:0xf7f56c79 [ 42.220834] RSP: 002b:00000000ff9b0e7c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 42.228527] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 42.235854] RDX: 0000000000000000 RSI: 00000000080db878 RDI: 00000000080f22a0 [ 42.243108] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.250350] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.257589] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.264848] [ 42.266449] Allocated by task 2983: [ 42.270047] save_stack_trace+0x16/0x20 [ 42.274003] save_stack+0x43/0xd0 [ 42.277427] kasan_kmalloc+0xad/0xe0 [ 42.281114] __kmalloc_node+0x47/0x70 [ 42.284885] kvmalloc_node+0x64/0xd0 [ 42.288578] alloc_netdev_mqs+0x16e/0xed0 [ 42.292695] __tun_chr_ioctl+0x12be/0x3d20 [ 42.296898] tun_chr_compat_ioctl+0x29/0x30 [ 42.301192] compat_SyS_ioctl+0x1d7/0x3290 [ 42.305396] do_fast_syscall_32+0x3f2/0xf05 [ 42.309685] entry_SYSENTER_compat+0x51/0x60 [ 42.314058] [ 42.315655] Freed by task 2983: [ 42.318904] save_stack_trace+0x16/0x20 [ 42.322847] save_stack+0x43/0xd0 [ 42.326270] kasan_slab_free+0x71/0xc0 [ 42.330124] kfree+0xca/0x250 [ 42.333200] kvfree+0x36/0x60 [ 42.336286] free_netdev+0x2cf/0x360 [ 42.339967] __tun_chr_ioctl+0x2cf6/0x3d20 [ 42.344170] tun_chr_compat_ioctl+0x29/0x30 [ 42.348461] compat_SyS_ioctl+0x1d7/0x3290 [ 42.352663] do_fast_syscall_32+0x3f2/0xf05 [ 42.356954] entry_SYSENTER_compat+0x51/0x60 [ 42.361329] [ 42.362928] The buggy address belongs to the object at ffff8801c0aa8340 [ 42.362928] which belongs to the cache kmalloc-16384 of size 16384 [ 42.375909] The buggy address is located 13312 bytes inside of [ 42.375909] 16384-byte region [ffff8801c0aa8340, ffff8801c0aac340) [ 42.388117] The buggy address belongs to the page: [ 42.393027] page:ffffea000702aa00 count:1 mapcount:0 mapping:ffff8801c0aa8340 index:0x0 compound_mapcount: 0 [ 42.402972] flags: 0x200000000008100(slab|head) [ 42.407610] raw: 0200000000008100 ffff8801c0aa8340 0000000000000000 0000000100000001 [ 42.415468] raw: ffffea0007344820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 42.423317] page dumped because: kasan: bad access detected [ 42.428992] [ 42.430590] Memory state around the buggy address: [ 42.435491] ffff8801c0aab600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.442818] ffff8801c0aab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.450149] >ffff8801c0aab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.457477] ^ [ 42.462896] ffff8801c0aab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.470224] ffff8801c0aab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.477562] ================================================================== [ 42.484888] Disabling lock debugging due to kernel taint [ 42.490301] Kernel panic - not syncing: panic_on_warn set ... [ 42.490301] [ 42.497626] CPU: 1 PID: 2983 Comm: syzkaller766187 Tainted: G B 4.14.0-rc2+ #21 [ 42.506162] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.515477] Call Trace: [ 42.518035] dump_stack+0x194/0x257 [ 42.521629] ? arch_local_irq_restore+0x53/0x53 [ 42.526264] ? vprintk_default+0x28/0x30 [ 42.530293] ? detach_if_pending+0x500/0x610 [ 42.534667] panic+0x1e4/0x417 [ 42.537825] ? __warn+0x1d9/0x1d9 [ 42.541248] ? detach_if_pending+0x557/0x610 [ 42.545621] kasan_end_report+0x50/0x50 [ 42.549568] kasan_report+0x144/0x340 [ 42.553336] __asan_report_store8_noabort+0x17/0x20 [ 42.558317] detach_if_pending+0x557/0x610 [ 42.562518] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.567685] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.572317] ? lock_timer_base+0x1a3/0x2b0 [ 42.576525] ? lock_timer_base+0x1eb/0x2b0 [ 42.580727] ? __internal_add_timer+0x2d0/0x2d0 [ 42.585372] ? trace_hardirqs_on+0xd/0x10 [ 42.589491] try_to_del_timer_sync+0xa2/0x120 [ 42.593961] ? del_timer+0x130/0x130 [ 42.597643] ? del_timer_sync+0xeb/0x240 [ 42.601694] del_timer_sync+0x18a/0x240 [ 42.605650] tun_free_netdev+0x105/0x1b0 [ 42.609676] ? tun_xdp+0x410/0x410 [ 42.613184] ? cpumask_next+0x24/0x30 [ 42.616953] ? netdev_refcnt_read+0xed/0x150 [ 42.621336] ? tun_xdp+0x410/0x410 [ 42.624855] netdev_run_todo+0x870/0xca0 [ 42.628885] ? do_group_exit+0x149/0x400 [ 42.632914] ? register_netdev+0x30/0x30 [ 42.636949] ? lock_downgrade+0x990/0x990 [ 42.641075] ? trace_hardirqs_on+0xd/0x10 [ 42.645209] ? refcount_sub_and_test+0x115/0x1b0 [ 42.649932] ? refcount_inc+0x50/0x50 [ 42.653700] ? refcount_inc+0x50/0x50 [ 42.657471] ? sk_destruct+0x4c/0x80 [ 42.661150] ? __sk_free+0x5c/0x230 [ 42.664745] ? sk_free+0x2f/0x40 [ 42.668080] ? __tun_detach+0x176/0x1390 [ 42.672112] ? tun_attach+0xf90/0xf90 [ 42.675881] ? do_raw_spin_trylock+0x190/0x190 [ 42.680432] ? locks_remove_file+0x3fa/0x5a0 [ 42.684807] ? fcntl_setlk+0x10d0/0x10d0 [ 42.688835] ? __fsnotify_parent+0xb4/0x3a0 [ 42.693120] ? fsnotify+0x1af0/0x1af0 [ 42.696887] ? __tun_detach+0x1390/0x1390 [ 42.701002] ? __tun_detach+0x1390/0x1390 [ 42.705121] rtnl_unlock+0xe/0x10 [ 42.708541] tun_chr_close+0x49/0x60 [ 42.712396] __fput+0x333/0x7f0 [ 42.715643] ? fput+0x140/0x140 [ 42.718889] ? check_same_owner+0x320/0x320 [ 42.723176] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.727638] ____fput+0x15/0x20 [ 42.730882] task_work_run+0x199/0x270 [ 42.734737] ? task_work_cancel+0x210/0x210 [ 42.739024] ? _raw_spin_unlock+0x22/0x30 [ 42.743147] ? switch_task_namespaces+0x87/0xc0 [ 42.747784] do_exit+0x9d2/0x1af0 [ 42.751202] ? __handle_mm_fault+0xf07/0x39c0 [ 42.755669] ? mm_update_next_owner+0x930/0x930 [ 42.760304] ? lock_release+0xd70/0xd70 [ 42.764243] ? check_noncircular+0x20/0x20 [ 42.768444] ? kfree+0xe4/0x250 [ 42.771688] ? kvfree+0x36/0x60 [ 42.774938] ? check_noncircular+0x20/0x20 [ 42.779148] ? __handle_mm_fault+0x587/0x39c0 [ 42.783608] ? __pmd_alloc+0x4e0/0x4e0 [ 42.787466] ? find_held_lock+0x39/0x1d0 [ 42.791497] ? lock_downgrade+0x990/0x990 [ 42.795621] ? handle_mm_fault+0x410/0x8d0 [ 42.799821] ? down_read_trylock+0xdb/0x170 [ 42.804107] ? __do_page_fault+0x31e/0xd60