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-4,10.128.0.51' (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: [ 22.601604] ================================================================== [ 22.609052] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 22.615785] Write of size 8 at addr ffff8801ce7637c0 by task syzkaller770578/2983 [ 22.623377] [ 22.624985] CPU: 1 PID: 2983 Comm: syzkaller770578 Not tainted 4.14.0-rc2+ #14 [ 22.632321] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 22.641648] Call Trace: [ 22.644217] dump_stack+0x194/0x257 [ 22.647829] ? arch_local_irq_restore+0x53/0x53 [ 22.652473] ? show_regs_print_info+0x65/0x65 [ 22.656947] ? lock_timer_base+0x1a3/0x2b0 [ 22.661160] ? detach_if_pending+0x557/0x610 [ 22.665547] print_address_description+0x73/0x250 [ 22.670367] ? detach_if_pending+0x557/0x610 [ 22.674752] kasan_report+0x25b/0x340 [ 22.678536] __asan_report_store8_noabort+0x17/0x20 [ 22.683527] detach_if_pending+0x557/0x610 [ 22.687860] ? trace_raw_output_tick_stop+0x130/0x130 [ 22.693030] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 22.697675] ? lock_timer_base+0x1a3/0x2b0 [ 22.701887] ? lock_timer_base+0x1eb/0x2b0 [ 22.706105] ? __internal_add_timer+0x2d0/0x2d0 [ 22.710752] ? trace_hardirqs_on+0xd/0x10 [ 22.714891] try_to_del_timer_sync+0xa2/0x120 [ 22.719363] ? del_timer+0x130/0x130 [ 22.723055] ? del_timer_sync+0xeb/0x240 [ 22.727102] del_timer_sync+0x18a/0x240 [ 22.731062] tun_free_netdev+0x105/0x1b0 [ 22.735099] ? tun_xdp+0x410/0x410 [ 22.738612] ? cpumask_next+0x24/0x30 [ 22.742507] ? netdev_refcnt_read+0xed/0x150 [ 22.746904] ? tun_xdp+0x410/0x410 [ 22.750420] netdev_run_todo+0x870/0xca0 [ 22.754457] ? do_group_exit+0x149/0x400 [ 22.758504] ? register_netdev+0x30/0x30 [ 22.762544] ? lock_downgrade+0x990/0x990 [ 22.766668] ? trace_hardirqs_on+0xd/0x10 [ 22.770819] ? refcount_sub_and_test+0x115/0x1b0 [ 22.775554] ? refcount_inc+0x50/0x50 [ 22.779332] ? refcount_inc+0x50/0x50 [ 22.783126] ? sk_destruct+0x4c/0x80 [ 22.786819] ? __sk_free+0x5c/0x230 [ 22.790425] ? sk_free+0x2f/0x40 [ 22.793768] ? __tun_detach+0x176/0x1390 [ 22.797824] ? tun_attach+0xf90/0xf90 [ 22.801615] ? locks_remove_file+0x3fa/0x5a0 [ 22.806004] ? fcntl_setlk+0x10d0/0x10d0 [ 22.810048] ? __fsnotify_parent+0xb4/0x3a0 [ 22.814350] ? fsnotify+0x1af0/0x1af0 [ 22.818132] ? __tun_detach+0x1390/0x1390 [ 22.822257] ? __tun_detach+0x1390/0x1390 [ 22.826383] rtnl_unlock+0xe/0x10 [ 22.829815] tun_chr_close+0x49/0x60 [ 22.833504] __fput+0x333/0x7f0 [ 22.836768] ? fput+0x140/0x140 [ 22.840027] ? check_same_owner+0x320/0x320 [ 22.844333] ____fput+0x15/0x20 [ 22.847588] task_work_run+0x199/0x270 [ 22.851456] ? task_work_cancel+0x210/0x210 [ 22.855753] ? free_nsproxy+0x185/0x1f0 [ 22.859705] ? switch_task_namespaces+0xa2/0xc0 [ 22.864358] do_exit+0x9d2/0x1af0 [ 22.867788] ? trace_hardirqs_on+0xd/0x10 [ 22.871921] ? mm_update_next_owner+0x930/0x930 [ 22.876568] ? lock_acquire+0x1d5/0x580 [ 22.880517] ? __handle_mm_fault+0xf07/0x39c0 [ 22.885000] ? lock_release+0xd70/0xd70 [ 22.888949] ? check_noncircular+0x20/0x20 [ 22.893164] ? kvfree+0x3b/0x60 [ 22.896438] ? rtnl_unlock+0xe/0x10 [ 22.900044] ? check_noncircular+0x20/0x20 [ 22.904259] ? __handle_mm_fault+0x587/0x39c0 [ 22.908737] ? __pmd_alloc+0x4e0/0x4e0 [ 22.912615] ? find_held_lock+0x39/0x1d0 [ 22.916669] ? lock_downgrade+0x990/0x990 [ 22.920830] do_group_exit+0x149/0x400 [ 22.924691] ? __handle_mm_fault+0x39c0/0x39c0 [ 22.929248] ? vmacache_find+0x5f/0x280 [ 22.933199] ? SyS_exit+0x30/0x30 [ 22.936635] ? do_fast_syscall_32+0x158/0xf05 [ 22.941107] ? do_group_exit+0x400/0x400 [ 22.945143] SyS_exit_group+0x1d/0x20 [ 22.948922] do_fast_syscall_32+0x3f2/0xf05 [ 22.953230] ? do_int80_syscall_32+0x940/0x940 [ 22.957796] ? lockdep_sys_exit+0x47/0xf0 [ 22.961920] ? syscall_return_slowpath+0x2b3/0x510 [ 22.966824] ? finish_task_switch+0x1aa/0x740 [ 22.971301] ? lockdep_sys_exit+0x47/0xf0 [ 22.975428] ? retint_user+0x18/0x20 [ 22.979125] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 22.983955] entry_SYSENTER_compat+0x51/0x60 [ 22.988340] RIP: 0023:0xf7fabc79 [ 22.991679] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 22.999367] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 23.006620] RDX: 0000000000000001 RSI: 00000000208b1000 RDI: 00000000400454ca [ 23.013865] RBP: 0000000008072ca6 R08: 0000000000000000 R09: 0000000000000000 [ 23.021109] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 23.028354] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 23.035650] [ 23.037263] Allocated by task 2983: [ 23.040870] save_stack_trace+0x16/0x20 [ 23.044820] save_stack+0x43/0xd0 [ 23.048248] kasan_kmalloc+0xad/0xe0 [ 23.051936] __kmalloc_node+0x47/0x70 [ 23.055711] kvmalloc_node+0x64/0xd0 [ 23.059400] alloc_netdev_mqs+0x16e/0xed0 [ 23.063525] __tun_chr_ioctl+0x12be/0x3d20 [ 23.067733] tun_chr_compat_ioctl+0x29/0x30 [ 23.072031] compat_SyS_ioctl+0x1d7/0x3290 [ 23.076239] do_fast_syscall_32+0x3f2/0xf05 [ 23.080535] entry_SYSENTER_compat+0x51/0x60 [ 23.084915] [ 23.086517] Freed by task 2983: [ 23.089769] save_stack_trace+0x16/0x20 [ 23.093717] save_stack+0x43/0xd0 [ 23.097147] kasan_slab_free+0x71/0xc0 [ 23.101018] kfree+0xca/0x250 [ 23.104098] kvfree+0x36/0x60 [ 23.107177] free_netdev+0x2cf/0x360 [ 23.110864] __tun_chr_ioctl+0x2cf6/0x3d20 [ 23.115071] tun_chr_compat_ioctl+0x29/0x30 [ 23.119376] compat_SyS_ioctl+0x1d7/0x3290 [ 23.123596] do_fast_syscall_32+0x3f2/0xf05 [ 23.127895] entry_SYSENTER_compat+0x51/0x60 [ 23.132273] [ 23.133880] The buggy address belongs to the object at ffff8801ce7603c0 [ 23.133880] which belongs to the cache kmalloc-16384 of size 16384 [ 23.147593] The buggy address is located 13312 bytes inside of [ 23.147593] 16384-byte region [ffff8801ce7603c0, ffff8801ce7643c0) [ 23.159799] The buggy address belongs to the page: [ 23.164705] page:ffffea000739d800 count:1 mapcount:0 mapping:ffff8801ce7603c0 index:0x0 compound_mapcount: 0 [ 23.174762] flags: 0x200000000008100(slab|head) [ 23.179417] raw: 0200000000008100 ffff8801ce7603c0 0000000000000000 0000000100000001 [ 23.187274] raw: ffffea000738b020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 23.195129] page dumped because: kasan: bad access detected [ 23.200811] [ 23.202422] Memory state around the buggy address: [ 23.207325] ffff8801ce763680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.214657] ffff8801ce763700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.221990] >ffff8801ce763780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.229323] ^ [ 23.234745] ffff8801ce763800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.242088] ffff8801ce763880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.249427] ================================================================== [ 23.256756] Disabling lock debugging due to kernel taint [ 23.262173] Kernel panic - not syncing: panic_on_warn set ... [ 23.262173] [ 23.269505] CPU: 1 PID: 2983 Comm: syzkaller770578 Tainted: G B 4.14.0-rc2+ #14 [ 23.278056] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 23.287377] Call Trace: [ 23.289940] dump_stack+0x194/0x257 [ 23.293537] ? arch_local_irq_restore+0x53/0x53 [ 23.298178] ? vprintk_default+0x28/0x30 [ 23.302212] ? detach_if_pending+0x540/0x610 [ 23.306589] panic+0x1e4/0x417 [ 23.309748] ? __warn+0x1d9/0x1d9 [ 23.313178] ? detach_if_pending+0x557/0x610 [ 23.317556] kasan_end_report+0x50/0x50 [ 23.321496] kasan_report+0x144/0x340 [ 23.325266] __asan_report_store8_noabort+0x17/0x20 [ 23.330249] detach_if_pending+0x557/0x610 [ 23.334452] ? trace_raw_output_tick_stop+0x130/0x130 [ 23.339609] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 23.344241] ? lock_timer_base+0x1a3/0x2b0 [ 23.348443] ? lock_timer_base+0x1eb/0x2b0 [ 23.352648] ? __internal_add_timer+0x2d0/0x2d0 [ 23.357287] ? trace_hardirqs_on+0xd/0x10 [ 23.361410] try_to_del_timer_sync+0xa2/0x120 [ 23.365873] ? del_timer+0x130/0x130 [ 23.369553] ? del_timer_sync+0xeb/0x240 [ 23.373588] del_timer_sync+0x18a/0x240 [ 23.377535] tun_free_netdev+0x105/0x1b0 [ 23.381561] ? tun_xdp+0x410/0x410 [ 23.385068] ? cpumask_next+0x24/0x30 [ 23.388839] ? netdev_refcnt_read+0xed/0x150 [ 23.393216] ? tun_xdp+0x410/0x410 [ 23.396724] netdev_run_todo+0x870/0xca0 [ 23.400751] ? do_group_exit+0x149/0x400 [ 23.404782] ? register_netdev+0x30/0x30 [ 23.408812] ? lock_downgrade+0x990/0x990 [ 23.412928] ? trace_hardirqs_on+0xd/0x10 [ 23.417058] ? refcount_sub_and_test+0x115/0x1b0 [ 23.421785] ? refcount_inc+0x50/0x50 [ 23.425551] ? refcount_inc+0x50/0x50 [ 23.429323] ? sk_destruct+0x4c/0x80 [ 23.433003] ? __sk_free+0x5c/0x230 [ 23.436596] ? sk_free+0x2f/0x40 [ 23.439929] ? __tun_detach+0x176/0x1390 [ 23.443966] ? tun_attach+0xf90/0xf90 [ 23.447741] ? locks_remove_file+0x3fa/0x5a0 [ 23.452117] ? fcntl_setlk+0x10d0/0x10d0 [ 23.456147] ? __fsnotify_parent+0xb4/0x3a0 [ 23.460438] ? fsnotify+0x1af0/0x1af0 [ 23.464208] ? __tun_detach+0x1390/0x1390 [ 23.468324] ? __tun_detach+0x1390/0x1390 [ 23.472442] rtnl_unlock+0xe/0x10 [ 23.475862] tun_chr_close+0x49/0x60 [ 23.479544] __fput+0x333/0x7f0 [ 23.482795] ? fput+0x140/0x140 [ 23.486043] ? check_same_owner+0x320/0x320 [ 23.490335] ____fput+0x15/0x20 [ 23.493582] task_work_run+0x199/0x270 [ 23.497439] ? task_work_cancel+0x210/0x210 [ 23.501730] ? free_nsproxy+0x185/0x1f0 [ 23.505674] ? switch_task_namespaces+0xa2/0xc0 [ 23.510313] do_exit+0x9d2/0x1af0 [ 23.513736] ? trace_hardirqs_on+0xd/0x10 [ 23.517855] ? mm_update_next_owner+0x930/0x930 [ 23.522491] ? lock_acquire+0x1d5/0x580 [ 23.526433] ? __handle_mm_fault+0xf07/0x39c0 [ 23.530901] ? lock_release+0xd70/0xd70 [ 23.534842] ? check_noncircular+0x20/0x20 [ 23.539057] ? kvfree+0x3b/0x60 [ 23.542310] ? rtnl_unlock+0xe/0x10 [ 23.545907] ? check_noncircular+0x20/0x20 [ 23.550122] ? __handle_mm_fault+0x587/0x39c0 [ 23.554586] ? __pmd_alloc+0x4e0/0x4e0 [ 23.558466] ? find_held_lock+0x39/0x1d0 [ 23.562502] ? lock_downgrade+0x990/0x990 [ 23.566640] do_group_exit+0x149/0x400 [ 23.570492] ? __handle_mm_fault+0x39c0/0x39c0 [ 23.575050] ? vmacache_find+0x5f/0x280 [ 23.578990] ? SyS_exit+0x30/0x30 [ 23.582416] ? do_fast_syscall_32+0x158/0xf05 [ 23.586880] ? do_group_exit+0x400/0x400 [ 23.590909] SyS_exit_group+0x1d/0x20 [ 23.594677] do_fast_syscall_32+0x3f2/0xf05 [ 23.598971] ? do_int80_syscall_32+0x940/0x940