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-1,10.128.0.40' (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: [ 46.472357] ================================================================== [ 46.479772] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 46.486517] Write of size 8 at addr ffff8801ce00b740 by task syzkaller556141/2982 [ 46.494106] [ 46.495707] CPU: 1 PID: 2982 Comm: syzkaller556141 Not tainted 4.13.0-mm1+ #7 [ 46.502950] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.512278] Call Trace: [ 46.514840] dump_stack+0x194/0x257 [ 46.518442] ? arch_local_irq_restore+0x53/0x53 [ 46.523084] ? show_regs_print_info+0x65/0x65 [ 46.527557] ? lock_timer_base+0x1a3/0x2b0 [ 46.531765] ? detach_if_pending+0x557/0x610 [ 46.536149] print_address_description+0x73/0x250 [ 46.540967] ? detach_if_pending+0x557/0x610 [ 46.545350] kasan_report+0x24e/0x340 [ 46.549128] __asan_report_store8_noabort+0x17/0x20 [ 46.554127] detach_if_pending+0x557/0x610 [ 46.558338] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.563504] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.568142] ? lock_timer_base+0x1a3/0x2b0 [ 46.572350] ? lock_timer_base+0x1eb/0x2b0 [ 46.576569] ? __internal_add_timer+0x2d0/0x2d0 [ 46.581211] ? trace_hardirqs_on+0xd/0x10 [ 46.585340] try_to_del_timer_sync+0xa2/0x120 [ 46.589810] ? del_timer+0x130/0x130 [ 46.593501] ? del_timer_sync+0xeb/0x240 [ 46.597541] del_timer_sync+0x18a/0x240 [ 46.601497] tun_free_netdev+0x105/0x1b0 [ 46.605533] ? tun_xdp+0x410/0x410 [ 46.609046] ? cpumask_next+0x24/0x30 [ 46.612819] ? netdev_refcnt_read+0xed/0x150 [ 46.617213] ? tun_xdp+0x410/0x410 [ 46.620724] netdev_run_todo+0x870/0xca0 [ 46.624762] ? do_group_exit+0x149/0x400 [ 46.628804] ? register_netdev+0x30/0x30 [ 46.632842] ? lock_downgrade+0x990/0x990 [ 46.636960] ? trace_hardirqs_on+0xd/0x10 [ 46.641095] ? refcount_sub_and_test+0x115/0x1b0 [ 46.645822] ? refcount_inc+0x50/0x50 [ 46.649593] ? refcount_inc+0x50/0x50 [ 46.653371] ? sk_destruct+0x4c/0x80 [ 46.657062] ? __sk_free+0x5c/0x230 [ 46.660667] ? sk_free+0x2f/0x40 [ 46.664005] ? __tun_detach+0x176/0x1390 [ 46.668052] ? tun_attach+0xf90/0xf90 [ 46.671833] ? locks_remove_file+0x3fa/0x5a0 [ 46.676215] ? fcntl_setlk+0x10d0/0x10d0 [ 46.680252] ? __fsnotify_parent+0xb4/0x3a0 [ 46.684546] ? fsnotify+0x1af0/0x1af0 [ 46.688322] ? __tun_detach+0x1390/0x1390 [ 46.692445] ? __tun_detach+0x1390/0x1390 [ 46.696566] rtnl_unlock+0xe/0x10 [ 46.699991] tun_chr_close+0x49/0x60 [ 46.703690] __fput+0x333/0x7f0 [ 46.706951] ? fput+0x140/0x140 [ 46.710206] ? check_same_owner+0x320/0x320 [ 46.714507] ____fput+0x15/0x20 [ 46.717769] task_work_run+0x199/0x270 [ 46.721640] ? task_work_cancel+0x210/0x210 [ 46.725938] ? free_nsproxy+0x185/0x1f0 [ 46.729885] ? switch_task_namespaces+0xa2/0xc0 [ 46.734535] do_exit+0xa52/0x1b40 [ 46.737971] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.742962] ? check_noncircular+0x20/0x20 [ 46.747178] ? mm_update_next_owner+0x930/0x930 [ 46.751818] ? __pmd_alloc+0x4e0/0x4e0 [ 46.755687] ? find_held_lock+0x39/0x1d0 [ 46.759729] ? lock_downgrade+0x990/0x990 [ 46.763872] ? handle_mm_fault+0x410/0x8d0 [ 46.768078] ? down_read_trylock+0xdb/0x170 [ 46.772373] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.776925] ? vmacache_find+0x61/0x270 [ 46.780869] ? vmacache_update+0xfe/0x130 [ 46.784994] ? up_read+0x1a/0x40 [ 46.788332] ? __do_page_fault+0x35b/0xb60 [ 46.792542] ? do_vfs_ioctl+0x492/0x1530 [ 46.796581] ? do_page_fault+0xee/0x720 [ 46.800528] ? __do_page_fault+0xb60/0xb60 [ 46.804736] ? putname+0xf3/0x130 [ 46.808166] do_group_exit+0x149/0x400 [ 46.812024] ? lockdep_sys_exit+0x47/0xf0 [ 46.816142] ? SyS_exit+0x30/0x30 [ 46.819565] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.824554] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.829283] SyS_exit_group+0x1d/0x20 [ 46.833055] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.837792] RIP: 0033:0x444db9 [ 46.840952] RSP: 002b:00007fffcf09b688 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.848633] RAX: ffffffffffffffda RBX: 00007fffcf09b6d0 RCX: 0000000000444db9 [ 46.855874] RDX: 0000000000444db9 RSI: 0000000020b28000 RDI: 0000000000000001 [ 46.863115] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fffcf09b6d0 [ 46.870356] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402160 [ 46.877596] R13: 00000000004021f0 R14: 0000000000000000 R15: 0000000000000000 [ 46.884855] [ 46.886460] Allocated by task 2982: [ 46.890058] save_stack_trace+0x16/0x20 [ 46.894004] save_stack+0x43/0xd0 [ 46.897427] kasan_kmalloc+0xad/0xe0 [ 46.901122] __kmalloc_node+0x47/0x70 [ 46.904893] kvmalloc_node+0x64/0xd0 [ 46.908589] alloc_netdev_mqs+0x16e/0xed0 [ 46.912709] __tun_chr_ioctl+0x12be/0x3d20 [ 46.916916] tun_chr_ioctl+0x2a/0x40 [ 46.920603] do_vfs_ioctl+0x1b1/0x1530 [ 46.924465] SyS_ioctl+0x8f/0xc0 [ 46.927805] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.932532] [ 46.934132] Freed by task 2982: [ 46.937381] save_stack_trace+0x16/0x20 [ 46.941324] save_stack+0x43/0xd0 [ 46.944746] kasan_slab_free+0x71/0xc0 [ 46.948605] kfree+0xca/0x250 [ 46.951683] kvfree+0x36/0x60 [ 46.954766] free_netdev+0x2cf/0x360 [ 46.958450] __tun_chr_ioctl+0x2cf6/0x3d20 [ 46.962654] tun_chr_ioctl+0x2a/0x40 [ 46.966337] do_vfs_ioctl+0x1b1/0x1530 [ 46.970194] SyS_ioctl+0x8f/0xc0 [ 46.973531] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.978254] [ 46.979852] The buggy address belongs to the object at ffff8801ce008340 [ 46.979852] which belongs to the cache kmalloc-16384 of size 16384 [ 46.992823] The buggy address is located 13312 bytes inside of [ 46.992823] 16384-byte region [ffff8801ce008340, ffff8801ce00c340) [ 47.005017] The buggy address belongs to the page: [ 47.009917] page:ffffea0007380200 count:1 mapcount:0 mapping:ffff8801ce008340 index:0x0 compound_mapcount: 0 [ 47.019865] flags: 0x200000000008100(slab|head) [ 47.024506] raw: 0200000000008100 ffff8801ce008340 0000000000000000 0000000100000001 [ 47.032355] raw: ffffea000735c020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 47.040201] page dumped because: kasan: bad access detected [ 47.045876] [ 47.047473] Memory state around the buggy address: [ 47.052368] ffff8801ce00b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.059697] ffff8801ce00b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.067027] >ffff8801ce00b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.074355] ^ [ 47.079773] ffff8801ce00b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.087116] ffff8801ce00b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 47.094448] ================================================================== [ 47.101776] Disabling lock debugging due to kernel taint [ 47.107190] Kernel panic - not syncing: panic_on_warn set ... [ 47.107190] [ 47.114524] CPU: 1 PID: 2982 Comm: syzkaller556141 Tainted: G B 4.13.0-mm1+ #7 [ 47.122974] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 47.132299] Call Trace: [ 47.134855] dump_stack+0x194/0x257 [ 47.138449] ? arch_local_irq_restore+0x53/0x53 [ 47.143083] ? vprintk_default+0x28/0x30 [ 47.147110] ? detach_if_pending+0x550/0x610 [ 47.151493] panic+0x1e4/0x417 [ 47.154651] ? __warn+0x1d9/0x1d9 [ 47.158075] ? detach_if_pending+0x557/0x610 [ 47.162455] kasan_end_report+0x50/0x50 [ 47.166393] kasan_report+0x137/0x340 [ 47.170161] __asan_report_store8_noabort+0x17/0x20 [ 47.175143] detach_if_pending+0x557/0x610 [ 47.179342] ? trace_raw_output_tick_stop+0x130/0x130 [ 47.184499] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 47.189138] ? lock_timer_base+0x1a3/0x2b0 [ 47.193336] ? lock_timer_base+0x1eb/0x2b0 [ 47.197538] ? __internal_add_timer+0x2d0/0x2d0 [ 47.202174] ? trace_hardirqs_on+0xd/0x10 [ 47.206289] try_to_del_timer_sync+0xa2/0x120 [ 47.210746] ? del_timer+0x130/0x130 [ 47.214429] ? del_timer_sync+0xeb/0x240 [ 47.218456] del_timer_sync+0x18a/0x240 [ 47.222396] tun_free_netdev+0x105/0x1b0 [ 47.226422] ? tun_xdp+0x410/0x410 [ 47.229927] ? cpumask_next+0x24/0x30 [ 47.233692] ? netdev_refcnt_read+0xed/0x150 [ 47.238068] ? tun_xdp+0x410/0x410 [ 47.241573] netdev_run_todo+0x870/0xca0 [ 47.245600] ? do_group_exit+0x149/0x400 [ 47.249629] ? register_netdev+0x30/0x30 [ 47.253657] ? lock_downgrade+0x990/0x990 [ 47.257770] ? trace_hardirqs_on+0xd/0x10 [ 47.261904] ? refcount_sub_and_test+0x115/0x1b0 [ 47.266625] ? refcount_inc+0x50/0x50 [ 47.270389] ? refcount_inc+0x50/0x50 [ 47.274154] ? sk_destruct+0x4c/0x80 [ 47.277831] ? __sk_free+0x5c/0x230 [ 47.281426] ? sk_free+0x2f/0x40 [ 47.284761] ? __tun_detach+0x176/0x1390 [ 47.288791] ? tun_attach+0xf90/0xf90 [ 47.292561] ? locks_remove_file+0x3fa/0x5a0 [ 47.296934] ? fcntl_setlk+0x10d0/0x10d0 [ 47.300961] ? __fsnotify_parent+0xb4/0x3a0 [ 47.305246] ? fsnotify+0x1af0/0x1af0 [ 47.309011] ? __tun_detach+0x1390/0x1390 [ 47.313123] ? __tun_detach+0x1390/0x1390 [ 47.317234] rtnl_unlock+0xe/0x10 [ 47.320651] tun_chr_close+0x49/0x60 [ 47.324330] __fput+0x333/0x7f0 [ 47.327576] ? fput+0x140/0x140 [ 47.330822] ? check_same_owner+0x320/0x320 [ 47.335110] ____fput+0x15/0x20 [ 47.338355] task_work_run+0x199/0x270 [ 47.342208] ? task_work_cancel+0x210/0x210 [ 47.346495] ? free_nsproxy+0x185/0x1f0 [ 47.350434] ? switch_task_namespaces+0xa2/0xc0 [ 47.355069] do_exit+0xa52/0x1b40 [ 47.358486] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.363468] ? check_noncircular+0x20/0x20 [ 47.367671] ? mm_update_next_owner+0x930/0x930 [ 47.372306] ? __pmd_alloc+0x4e0/0x4e0 [ 47.376164] ? find_held_lock+0x39/0x1d0 [ 47.380197] ? lock_downgrade+0x990/0x990 [ 47.384319] ? handle_mm_fault+0x410/0x8d0 [ 47.388517] ? down_read_trylock+0xdb/0x170 [ 47.392805] ? __handle_mm_fault+0x39c0/0x39c0 [ 47.397352] ? vmacache_find+0x61/0x270 [ 47.401289] ? vmacache_update+0xfe/0x130 [ 47.405418] ? up_read+0x1a/0x40 [ 47.408752] ? __do_page_fault+0x35b/0xb60 [ 47.412949] ? do_vfs_ioctl+0x492/0x1530 [ 47.416982] ? do_page_fault+0xee/0x720 [ 47.420922] ? __do_page_fault+0xb60/0xb60 [ 47.425119] ? putname+0xf3/0x130 [ 47.428539] do_group_exit+0x149/0x400 [ 47.432392] ? lockdep_sys_exit+0x47/0xf0 [ 47.436510] ? SyS_exit+0x30/0x30 [ 47.439929] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 47.444920] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 47.449649] SyS_exit_group+0x1d/0x20 [ 47.453427] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 47.458159] RIP: 0033:0x444db9 [ 47.461316] RSP: 002b:00007fffcf09b688 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 47.468991] RAX: ffffffffffffffda RBX: 00007fffcf09b6d0 RCX: 0000000000444db9