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-mmots-kasan-gce-0,10.128.15.196' (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: [ 45.849296] ================================================================== [ 45.856711] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.863435] Write of size 8 at addr ffff8801ce1f3740 by task syzkaller074125/2983 [ 45.871020] [ 45.872621] CPU: 0 PID: 2983 Comm: syzkaller074125 Not tainted 4.13.0-mm1+ #7 [ 45.879861] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.889200] Call Trace: [ 45.891765] dump_stack+0x194/0x257 [ 45.895370] ? arch_local_irq_restore+0x53/0x53 [ 45.900011] ? show_regs_print_info+0x65/0x65 [ 45.904482] ? lock_timer_base+0x1a3/0x2b0 [ 45.908692] ? detach_if_pending+0x557/0x610 [ 45.913072] print_address_description+0x73/0x250 [ 45.917885] ? detach_if_pending+0x557/0x610 [ 45.922265] kasan_report+0x24e/0x340 [ 45.926040] __asan_report_store8_noabort+0x17/0x20 [ 45.931022] detach_if_pending+0x557/0x610 [ 45.935228] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.940388] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.945024] ? lock_timer_base+0x1a3/0x2b0 [ 45.949227] ? lock_timer_base+0x1eb/0x2b0 [ 45.953434] ? __internal_add_timer+0x2d0/0x2d0 [ 45.958076] ? trace_hardirqs_on+0xd/0x10 [ 45.962199] try_to_del_timer_sync+0xa2/0x120 [ 45.966664] ? del_timer+0x130/0x130 [ 45.970348] ? del_timer_sync+0xeb/0x240 [ 45.974384] del_timer_sync+0x18a/0x240 [ 45.978331] tun_free_netdev+0x105/0x1b0 [ 45.982360] ? tun_xdp+0x410/0x410 [ 45.985868] ? cpumask_next+0x24/0x30 [ 45.989648] ? netdev_refcnt_read+0xed/0x150 [ 45.994030] ? tun_xdp+0x410/0x410 [ 45.997562] netdev_run_todo+0x870/0xca0 [ 46.001594] ? do_group_exit+0x149/0x400 [ 46.005627] ? register_netdev+0x30/0x30 [ 46.009660] ? lock_downgrade+0x990/0x990 [ 46.013778] ? trace_hardirqs_on+0xd/0x10 [ 46.017912] ? refcount_sub_and_test+0x115/0x1b0 [ 46.022638] ? refcount_inc+0x50/0x50 [ 46.026409] ? refcount_inc+0x50/0x50 [ 46.030185] ? sk_destruct+0x4c/0x80 [ 46.033868] ? __sk_free+0x5c/0x230 [ 46.037464] ? sk_free+0x2f/0x40 [ 46.040799] ? __tun_detach+0x176/0x1390 [ 46.044839] ? tun_attach+0xf90/0xf90 [ 46.048613] ? do_raw_spin_trylock+0x190/0x190 [ 46.053170] ? locks_remove_file+0x3fa/0x5a0 [ 46.057551] ? fcntl_setlk+0x10d0/0x10d0 [ 46.061584] ? __fsnotify_parent+0xb4/0x3a0 [ 46.065877] ? fsnotify+0x1af0/0x1af0 [ 46.069653] ? __tun_detach+0x1390/0x1390 [ 46.073772] ? __tun_detach+0x1390/0x1390 [ 46.077890] rtnl_unlock+0xe/0x10 [ 46.081312] tun_chr_close+0x49/0x60 [ 46.085027] __fput+0x333/0x7f0 [ 46.088290] ? fput+0x140/0x140 [ 46.091541] ? check_same_owner+0x320/0x320 [ 46.095830] ? _raw_spin_unlock_irq+0x27/0x70 [ 46.100304] ____fput+0x15/0x20 [ 46.103562] task_work_run+0x199/0x270 [ 46.107422] ? task_work_cancel+0x210/0x210 [ 46.111717] ? _raw_spin_unlock+0x22/0x30 [ 46.115837] ? switch_task_namespaces+0x87/0xc0 [ 46.120483] do_exit+0xa52/0x1b40 [ 46.123909] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.128897] ? check_noncircular+0x20/0x20 [ 46.133117] ? mm_update_next_owner+0x930/0x930 [ 46.137759] ? __pmd_alloc+0x4e0/0x4e0 [ 46.141628] ? find_held_lock+0x39/0x1d0 [ 46.145672] ? lock_downgrade+0x990/0x990 [ 46.149811] ? handle_mm_fault+0x410/0x8d0 [ 46.154012] ? down_read_trylock+0xdb/0x170 [ 46.158308] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.162866] ? vmacache_find+0x61/0x270 [ 46.166820] ? up_read+0x1a/0x40 [ 46.170158] ? __do_page_fault+0x35b/0xb60 [ 46.174359] ? do_vfs_ioctl+0x492/0x1530 [ 46.178397] ? do_page_fault+0xee/0x720 [ 46.182344] ? __do_page_fault+0xb60/0xb60 [ 46.186548] ? putname+0xf3/0x130 [ 46.189976] do_group_exit+0x149/0x400 [ 46.193832] ? lockdep_sys_exit+0x47/0xf0 [ 46.197948] ? SyS_exit+0x30/0x30 [ 46.201371] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.206357] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.211087] SyS_exit_group+0x1d/0x20 [ 46.214862] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.219587] RIP: 0033:0x4435d8 [ 46.222747] RSP: 002b:00007ffe41b83968 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 46.230428] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435d8 [ 46.237666] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 46.244912] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 46.252150] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 46.259390] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 46.266646] [ 46.268243] Allocated by task 2983: [ 46.271837] save_stack_trace+0x16/0x20 [ 46.275778] save_stack+0x43/0xd0 [ 46.279197] kasan_kmalloc+0xad/0xe0 [ 46.282877] __kmalloc_node+0x47/0x70 [ 46.286649] kvmalloc_node+0x64/0xd0 [ 46.290329] alloc_netdev_mqs+0x16e/0xed0 [ 46.294453] __tun_chr_ioctl+0x12be/0x3d20 [ 46.298656] tun_chr_ioctl+0x2a/0x40 [ 46.302337] do_vfs_ioctl+0x1b1/0x1530 [ 46.306190] SyS_ioctl+0x8f/0xc0 [ 46.309524] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.314243] [ 46.315836] Freed by task 2983: [ 46.319083] save_stack_trace+0x16/0x20 [ 46.323025] save_stack+0x43/0xd0 [ 46.326445] kasan_slab_free+0x71/0xc0 [ 46.330300] kfree+0xca/0x250 [ 46.333373] kvfree+0x36/0x60 [ 46.336448] free_netdev+0x2cf/0x360 [ 46.340129] __tun_chr_ioctl+0x2cf6/0x3d20 [ 46.344330] tun_chr_ioctl+0x2a/0x40 [ 46.348010] do_vfs_ioctl+0x1b1/0x1530 [ 46.351865] SyS_ioctl+0x8f/0xc0 [ 46.355198] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.359920] [ 46.361516] The buggy address belongs to the object at ffff8801ce1f0340 [ 46.361516] which belongs to the cache kmalloc-16384 of size 16384 [ 46.374484] The buggy address is located 13312 bytes inside of [ 46.374484] 16384-byte region [ffff8801ce1f0340, ffff8801ce1f4340) [ 46.386669] The buggy address belongs to the page: [ 46.391568] page:ffffea0007387c00 count:1 mapcount:0 mapping:ffff8801ce1f0340 index:0x0 compound_mapcount: 0 [ 46.401510] flags: 0x200000000008100(slab|head) [ 46.406148] raw: 0200000000008100 ffff8801ce1f0340 0000000000000000 0000000100000001 [ 46.413996] raw: ffffea0007038620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 46.421846] page dumped because: kasan: bad access detected [ 46.427521] [ 46.429116] Memory state around the buggy address: [ 46.434011] ffff8801ce1f3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.441337] ffff8801ce1f3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.448660] >ffff8801ce1f3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.455985] ^ [ 46.461401] ffff8801ce1f3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.468736] ffff8801ce1f3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.476061] ================================================================== [ 46.483386] Disabling lock debugging due to kernel taint [ 46.488796] Kernel panic - not syncing: panic_on_warn set ... [ 46.488796] [ 46.496126] CPU: 0 PID: 2983 Comm: syzkaller074125 Tainted: G B 4.13.0-mm1+ #7 [ 46.504579] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.513894] Call Trace: [ 46.516450] dump_stack+0x194/0x257 [ 46.520043] ? arch_local_irq_restore+0x53/0x53 [ 46.524675] ? vprintk_default+0x28/0x30 [ 46.528703] ? detach_if_pending+0x550/0x610 [ 46.533076] panic+0x1e4/0x417 [ 46.536234] ? __warn+0x1d9/0x1d9 [ 46.539656] ? detach_if_pending+0x557/0x610 [ 46.544028] kasan_end_report+0x50/0x50 [ 46.547964] kasan_report+0x137/0x340 [ 46.551728] __asan_report_store8_noabort+0x17/0x20 [ 46.556707] detach_if_pending+0x557/0x610 [ 46.560906] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.566060] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.570689] ? lock_timer_base+0x1a3/0x2b0 [ 46.574887] ? lock_timer_base+0x1eb/0x2b0 [ 46.579088] ? __internal_add_timer+0x2d0/0x2d0 [ 46.583723] ? trace_hardirqs_on+0xd/0x10 [ 46.587838] try_to_del_timer_sync+0xa2/0x120 [ 46.592294] ? del_timer+0x130/0x130 [ 46.595973] ? del_timer_sync+0xeb/0x240 [ 46.599999] del_timer_sync+0x18a/0x240 [ 46.603936] tun_free_netdev+0x105/0x1b0 [ 46.607961] ? tun_xdp+0x410/0x410 [ 46.611464] ? cpumask_next+0x24/0x30 [ 46.615236] ? netdev_refcnt_read+0xed/0x150 [ 46.619610] ? tun_xdp+0x410/0x410 [ 46.623112] netdev_run_todo+0x870/0xca0 [ 46.627138] ? do_group_exit+0x149/0x400 [ 46.631165] ? register_netdev+0x30/0x30 [ 46.635191] ? lock_downgrade+0x990/0x990 [ 46.639303] ? trace_hardirqs_on+0xd/0x10 [ 46.643425] ? refcount_sub_and_test+0x115/0x1b0 [ 46.648144] ? refcount_inc+0x50/0x50 [ 46.651907] ? refcount_inc+0x50/0x50 [ 46.655673] ? sk_destruct+0x4c/0x80 [ 46.659351] ? __sk_free+0x5c/0x230 [ 46.662942] ? sk_free+0x2f/0x40 [ 46.666272] ? __tun_detach+0x176/0x1390 [ 46.670302] ? tun_attach+0xf90/0xf90 [ 46.674068] ? do_raw_spin_trylock+0x190/0x190 [ 46.678616] ? locks_remove_file+0x3fa/0x5a0 [ 46.682990] ? fcntl_setlk+0x10d0/0x10d0 [ 46.687017] ? __fsnotify_parent+0xb4/0x3a0 [ 46.691301] ? fsnotify+0x1af0/0x1af0 [ 46.695067] ? __tun_detach+0x1390/0x1390 [ 46.699178] ? __tun_detach+0x1390/0x1390 [ 46.703287] rtnl_unlock+0xe/0x10 [ 46.706703] tun_chr_close+0x49/0x60 [ 46.710381] __fput+0x333/0x7f0 [ 46.713630] ? fput+0x140/0x140 [ 46.716875] ? check_same_owner+0x320/0x320 [ 46.721161] ? _raw_spin_unlock_irq+0x27/0x70 [ 46.725621] ____fput+0x15/0x20 [ 46.728866] task_work_run+0x199/0x270 [ 46.732716] ? task_work_cancel+0x210/0x210 [ 46.737002] ? _raw_spin_unlock+0x22/0x30 [ 46.741112] ? switch_task_namespaces+0x87/0xc0 [ 46.745749] do_exit+0xa52/0x1b40 [ 46.749168] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.754148] ? check_noncircular+0x20/0x20 [ 46.758350] ? mm_update_next_owner+0x930/0x930 [ 46.762981] ? __pmd_alloc+0x4e0/0x4e0 [ 46.766836] ? find_held_lock+0x39/0x1d0 [ 46.770868] ? lock_downgrade+0x990/0x990 [ 46.774987] ? handle_mm_fault+0x410/0x8d0 [ 46.779189] ? down_read_trylock+0xdb/0x170 [ 46.783476] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.788023] ? vmacache_find+0x61/0x270 [ 46.791966] ? up_read+0x1a/0x40 [ 46.795295] ? __do_page_fault+0x35b/0xb60 [ 46.799494] ? do_vfs_ioctl+0x492/0x1530 [ 46.803530] ? do_page_fault+0xee/0x720 [ 46.807468] ? __do_page_fault+0xb60/0xb60 [ 46.811667] ? putname+0xf3/0x130 [ 46.815092] do_group_exit+0x149/0x400 [ 46.818943] ? lockdep_sys_exit+0x47/0xf0 [ 46.823054] ? SyS_exit+0x30/0x30 [ 46.826471] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.831452] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.836178] SyS_exit_group+0x1d/0x20 [ 46.839950] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.844668] RIP: 0033:0x4435d8