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.25' (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: [ 44.610295] ================================================================== [ 44.617762] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 44.624487] Write of size 8 at addr ffff8801ce16b740 by task syzkaller991817/2987 [ 44.632079] [ 44.633683] CPU: 0 PID: 2987 Comm: syzkaller991817 Not tainted 4.14.0-rc2+ #20 [ 44.641012] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 44.650345] Call Trace: [ 44.652910] dump_stack+0x194/0x257 [ 44.656515] ? arch_local_irq_restore+0x53/0x53 [ 44.661168] ? show_regs_print_info+0x65/0x65 [ 44.665639] ? lock_timer_base+0x1a3/0x2b0 [ 44.669846] ? detach_if_pending+0x557/0x610 [ 44.674228] print_address_description+0x73/0x250 [ 44.679041] ? detach_if_pending+0x557/0x610 [ 44.683429] kasan_report+0x25b/0x340 [ 44.687204] __asan_report_store8_noabort+0x17/0x20 [ 44.692191] detach_if_pending+0x557/0x610 [ 44.696401] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.701561] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.706198] ? lock_timer_base+0x1a3/0x2b0 [ 44.710404] ? lock_timer_base+0x1eb/0x2b0 [ 44.714614] ? __internal_add_timer+0x2d0/0x2d0 [ 44.719258] ? trace_hardirqs_on+0xd/0x10 [ 44.723384] try_to_del_timer_sync+0xa2/0x120 [ 44.727849] ? del_timer+0x130/0x130 [ 44.731534] ? del_timer_sync+0xeb/0x240 [ 44.735571] del_timer_sync+0x18a/0x240 [ 44.739519] tun_free_netdev+0x105/0x1b0 [ 44.743551] ? tun_xdp+0x410/0x410 [ 44.747060] ? cpumask_next+0x24/0x30 [ 44.750831] ? netdev_refcnt_read+0xed/0x150 [ 44.755212] ? tun_xdp+0x410/0x410 [ 44.758723] netdev_run_todo+0x870/0xca0 [ 44.762754] ? do_group_exit+0x149/0x400 [ 44.766792] ? register_netdev+0x30/0x30 [ 44.770829] ? lock_downgrade+0x990/0x990 [ 44.774946] ? trace_hardirqs_on+0xd/0x10 [ 44.779083] ? refcount_sub_and_test+0x115/0x1b0 [ 44.783810] ? refcount_inc+0x50/0x50 [ 44.787584] ? refcount_inc+0x50/0x50 [ 44.791360] ? sk_destruct+0x4c/0x80 [ 44.795044] ? __sk_free+0x5c/0x230 [ 44.798641] ? sk_free+0x2f/0x40 [ 44.801977] ? __tun_detach+0x176/0x1390 [ 44.806019] ? tun_attach+0xf90/0xf90 [ 44.809793] ? do_raw_spin_trylock+0x190/0x190 [ 44.814351] ? locks_remove_file+0x3fa/0x5a0 [ 44.818732] ? fcntl_setlk+0x10d0/0x10d0 [ 44.822767] ? __fsnotify_parent+0xb4/0x3a0 [ 44.827061] ? fsnotify+0x1af0/0x1af0 [ 44.830836] ? __tun_detach+0x1390/0x1390 [ 44.834952] ? __tun_detach+0x1390/0x1390 [ 44.839072] rtnl_unlock+0xe/0x10 [ 44.842493] tun_chr_close+0x49/0x60 [ 44.846178] __fput+0x333/0x7f0 [ 44.849435] ? fput+0x140/0x140 [ 44.852690] ? check_same_owner+0x320/0x320 [ 44.856980] ? _raw_spin_unlock_irq+0x27/0x70 [ 44.861453] ____fput+0x15/0x20 [ 44.864705] task_work_run+0x199/0x270 [ 44.868566] ? task_work_cancel+0x210/0x210 [ 44.872860] ? _raw_spin_unlock+0x22/0x30 [ 44.876980] ? switch_task_namespaces+0x87/0xc0 [ 44.881624] do_exit+0x9d2/0x1af0 [ 44.885054] ? mm_update_next_owner+0x930/0x930 [ 44.889694] ? lock_acquire+0x1d5/0x580 [ 44.893641] ? __handle_mm_fault+0xf07/0x39c0 [ 44.898114] ? lock_release+0xd70/0xd70 [ 44.902057] ? check_noncircular+0x20/0x20 [ 44.906263] ? kvfree+0x3b/0x60 [ 44.909520] ? rtnl_unlock+0xe/0x10 [ 44.913118] ? check_noncircular+0x20/0x20 [ 44.917331] ? __handle_mm_fault+0x587/0x39c0 [ 44.921801] ? __pmd_alloc+0x4e0/0x4e0 [ 44.925668] ? find_held_lock+0x39/0x1d0 [ 44.929709] ? lock_downgrade+0x990/0x990 [ 44.933854] do_group_exit+0x149/0x400 [ 44.937707] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.942258] ? vmacache_find+0x5f/0x280 [ 44.946206] ? SyS_exit+0x30/0x30 [ 44.949638] ? do_fast_syscall_32+0x158/0xf05 [ 44.954105] ? do_group_exit+0x400/0x400 [ 44.958135] SyS_exit_group+0x1d/0x20 [ 44.961906] do_fast_syscall_32+0x3f2/0xf05 [ 44.966204] ? do_int80_syscall_32+0x940/0x940 [ 44.970759] ? kasan_check_read+0x11/0x20 [ 44.974878] ? syscall_return_slowpath+0x510/0x510 [ 44.979778] ? SyS_rt_sigaction+0x94/0x1b0 [ 44.983987] ? lockdep_sys_exit+0x47/0xf0 [ 44.988106] ? retint_user+0x18/0x20 [ 44.991797] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 44.996616] entry_SYSENTER_compat+0x51/0x60 [ 45.000992] RIP: 0023:0xf7f81c79 [ 45.004327] RSP: 002b:00000000ffcd22ac EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 45.012008] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 45.019246] RDX: 0000000000000000 RSI: 00000000080db958 RDI: 00000000080f22a0 [ 45.026486] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 45.033725] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 45.040964] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 45.048220] [ 45.049818] Allocated by task 2987: [ 45.053422] save_stack_trace+0x16/0x20 [ 45.057367] save_stack+0x43/0xd0 [ 45.060788] kasan_kmalloc+0xad/0xe0 [ 45.064469] __kmalloc_node+0x47/0x70 [ 45.068239] kvmalloc_node+0x64/0xd0 [ 45.071923] alloc_netdev_mqs+0x16e/0xed0 [ 45.076040] __tun_chr_ioctl+0x12be/0x3d20 [ 45.080243] tun_chr_compat_ioctl+0x29/0x30 [ 45.084534] compat_SyS_ioctl+0x1d7/0x3290 [ 45.088736] do_fast_syscall_32+0x3f2/0xf05 [ 45.093026] entry_SYSENTER_compat+0x51/0x60 [ 45.097401] [ 45.098996] Freed by task 2987: [ 45.102244] save_stack_trace+0x16/0x20 [ 45.106185] save_stack+0x43/0xd0 [ 45.109623] kasan_slab_free+0x71/0xc0 [ 45.113478] kfree+0xca/0x250 [ 45.116552] kvfree+0x36/0x60 [ 45.119625] free_netdev+0x2cf/0x360 [ 45.123306] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.127509] tun_chr_compat_ioctl+0x29/0x30 [ 45.131799] compat_SyS_ioctl+0x1d7/0x3290 [ 45.136002] do_fast_syscall_32+0x3f2/0xf05 [ 45.140293] entry_SYSENTER_compat+0x51/0x60 [ 45.144677] [ 45.146277] The buggy address belongs to the object at ffff8801ce168340 [ 45.146277] which belongs to the cache kmalloc-16384 of size 16384 [ 45.159247] The buggy address is located 13312 bytes inside of [ 45.159247] 16384-byte region [ffff8801ce168340, ffff8801ce16c340) [ 45.171436] The buggy address belongs to the page: [ 45.176335] page:ffffea0007385a00 count:1 mapcount:0 mapping:ffff8801ce168340 index:0x0 compound_mapcount: 0 [ 45.186290] flags: 0x200000000008100(slab|head) [ 45.190930] raw: 0200000000008100 ffff8801ce168340 0000000000000000 0000000100000001 [ 45.198780] raw: ffffea000738a420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 45.206626] page dumped because: kasan: bad access detected [ 45.212302] [ 45.213901] Memory state around the buggy address: [ 45.218797] ffff8801ce16b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.226125] ffff8801ce16b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.233454] >ffff8801ce16b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.240780] ^ [ 45.246196] ffff8801ce16b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.253524] ffff8801ce16b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 45.260848] ================================================================== [ 45.268172] Disabling lock debugging due to kernel taint [ 45.273585] Kernel panic - not syncing: panic_on_warn set ... [ 45.273585] [ 45.280918] CPU: 0 PID: 2987 Comm: syzkaller991817 Tainted: G B 4.14.0-rc2+ #20 [ 45.289454] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.298771] Call Trace: [ 45.301323] dump_stack+0x194/0x257 [ 45.304915] ? arch_local_irq_restore+0x53/0x53 [ 45.309551] ? vprintk_default+0x28/0x30 [ 45.313581] ? detach_if_pending+0x4d0/0x610 [ 45.317957] panic+0x1e4/0x417 [ 45.321113] ? __warn+0x1d9/0x1d9 [ 45.324538] ? detach_if_pending+0x557/0x610 [ 45.328908] kasan_end_report+0x50/0x50 [ 45.332846] kasan_report+0x144/0x340 [ 45.336613] __asan_report_store8_noabort+0x17/0x20 [ 45.341593] detach_if_pending+0x557/0x610 [ 45.345793] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.350945] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.355577] ? lock_timer_base+0x1a3/0x2b0 [ 45.359776] ? lock_timer_base+0x1eb/0x2b0 [ 45.363974] ? __internal_add_timer+0x2d0/0x2d0 [ 45.368607] ? trace_hardirqs_on+0xd/0x10 [ 45.372721] try_to_del_timer_sync+0xa2/0x120 [ 45.377178] ? del_timer+0x130/0x130 [ 45.380855] ? del_timer_sync+0xeb/0x240 [ 45.384894] del_timer_sync+0x18a/0x240 [ 45.388834] tun_free_netdev+0x105/0x1b0 [ 45.392859] ? tun_xdp+0x410/0x410 [ 45.396363] ? cpumask_next+0x24/0x30 [ 45.400138] ? netdev_refcnt_read+0xed/0x150 [ 45.404511] ? tun_xdp+0x410/0x410 [ 45.408013] netdev_run_todo+0x870/0xca0 [ 45.412038] ? do_group_exit+0x149/0x400 [ 45.416066] ? register_netdev+0x30/0x30 [ 45.420092] ? lock_downgrade+0x990/0x990 [ 45.424203] ? trace_hardirqs_on+0xd/0x10 [ 45.428328] ? refcount_sub_and_test+0x115/0x1b0 [ 45.433048] ? refcount_inc+0x50/0x50 [ 45.436813] ? refcount_inc+0x50/0x50 [ 45.440578] ? sk_destruct+0x4c/0x80 [ 45.444253] ? __sk_free+0x5c/0x230 [ 45.447843] ? sk_free+0x2f/0x40 [ 45.451171] ? __tun_detach+0x176/0x1390 [ 45.455202] ? tun_attach+0xf90/0xf90 [ 45.458969] ? do_raw_spin_trylock+0x190/0x190 [ 45.463516] ? locks_remove_file+0x3fa/0x5a0 [ 45.467889] ? fcntl_setlk+0x10d0/0x10d0 [ 45.471916] ? __fsnotify_parent+0xb4/0x3a0 [ 45.476201] ? fsnotify+0x1af0/0x1af0 [ 45.479969] ? __tun_detach+0x1390/0x1390 [ 45.484079] ? __tun_detach+0x1390/0x1390 [ 45.488190] rtnl_unlock+0xe/0x10 [ 45.491617] tun_chr_close+0x49/0x60 [ 45.495295] __fput+0x333/0x7f0 [ 45.498543] ? fput+0x140/0x140 [ 45.501786] ? check_same_owner+0x320/0x320 [ 45.506071] ? _raw_spin_unlock_irq+0x27/0x70 [ 45.510532] ____fput+0x15/0x20 [ 45.513776] task_work_run+0x199/0x270 [ 45.517627] ? task_work_cancel+0x210/0x210 [ 45.521913] ? _raw_spin_unlock+0x22/0x30 [ 45.526024] ? switch_task_namespaces+0x87/0xc0 [ 45.530657] do_exit+0x9d2/0x1af0 [ 45.534077] ? mm_update_next_owner+0x930/0x930 [ 45.538710] ? lock_acquire+0x1d5/0x580 [ 45.542647] ? __handle_mm_fault+0xf07/0x39c0 [ 45.547110] ? lock_release+0xd70/0xd70 [ 45.551047] ? check_noncircular+0x20/0x20 [ 45.555263] ? kvfree+0x3b/0x60 [ 45.558508] ? rtnl_unlock+0xe/0x10 [ 45.562099] ? check_noncircular+0x20/0x20 [ 45.566303] ? __handle_mm_fault+0x587/0x39c0 [ 45.570763] ? __pmd_alloc+0x4e0/0x4e0 [ 45.574619] ? find_held_lock+0x39/0x1d0 [ 45.578650] ? lock_downgrade+0x990/0x990 [ 45.582775] do_group_exit+0x149/0x400 [ 45.586627] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.591176] ? vmacache_find+0x5f/0x280 [ 45.595113] ? SyS_exit+0x30/0x30 [ 45.598534] ? do_fast_syscall_32+0x158/0xf05 [ 45.602992] ? do_group_exit+0x400/0x400 [ 45.607017] SyS_exit_group+0x1d/0x20