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-1,10.128.15.208' (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: [ 34.376339] ================================================================== [ 34.383756] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 34.390480] Write of size 8 at addr ffff8801cf163780 by task syzkaller509383/2983 [ 34.398068] [ 34.399672] CPU: 0 PID: 2983 Comm: syzkaller509383 Not tainted 4.13.0+ #77 [ 34.406742] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.416066] Call Trace: [ 34.418626] dump_stack+0x194/0x257 [ 34.422230] ? arch_local_irq_restore+0x53/0x53 [ 34.426871] ? show_regs_print_info+0x65/0x65 [ 34.431338] ? lock_timer_base+0x1a3/0x2b0 [ 34.435548] ? detach_if_pending+0x557/0x610 [ 34.439930] print_address_description+0x73/0x250 [ 34.444744] ? detach_if_pending+0x557/0x610 [ 34.449122] kasan_report+0x24e/0x340 [ 34.452899] __asan_report_store8_noabort+0x17/0x20 [ 34.457883] detach_if_pending+0x557/0x610 [ 34.462089] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.467250] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.471885] ? lock_timer_base+0x1a3/0x2b0 [ 34.476088] ? lock_timer_base+0x1eb/0x2b0 [ 34.480296] ? __internal_add_timer+0x2d0/0x2d0 [ 34.484946] ? trace_hardirqs_on+0xd/0x10 [ 34.489071] try_to_del_timer_sync+0xa2/0x120 [ 34.493535] ? del_timer+0x130/0x130 [ 34.497217] ? del_timer_sync+0xeb/0x240 [ 34.501252] del_timer_sync+0x18a/0x240 [ 34.505208] tun_free_netdev+0x105/0x1b0 [ 34.509238] ? tun_xdp+0x410/0x410 [ 34.512746] ? cpumask_next+0x24/0x30 [ 34.516518] ? netdev_refcnt_read+0xed/0x150 [ 34.520899] ? tun_xdp+0x410/0x410 [ 34.524410] netdev_run_todo+0x870/0xca0 [ 34.528442] ? do_group_exit+0x149/0x400 [ 34.532479] ? register_netdev+0x30/0x30 [ 34.536517] ? lock_downgrade+0x990/0x990 [ 34.540635] ? trace_hardirqs_on+0xd/0x10 [ 34.544770] ? refcount_sub_and_test+0x115/0x1b0 [ 34.549497] ? refcount_inc+0x50/0x50 [ 34.553268] ? refcount_inc+0x50/0x50 [ 34.557041] ? sk_destruct+0x4c/0x80 [ 34.560725] ? __sk_free+0x5c/0x230 [ 34.564322] ? sk_free+0x2f/0x40 [ 34.567658] ? __tun_detach+0x176/0x1390 [ 34.571714] ? tun_attach+0xf90/0xf90 [ 34.575489] ? do_raw_spin_trylock+0x190/0x190 [ 34.580044] ? locks_remove_file+0x3fa/0x5a0 [ 34.584425] ? fcntl_setlk+0x10d0/0x10d0 [ 34.588458] ? __fsnotify_parent+0xb4/0x3a0 [ 34.592750] ? fsnotify+0x1af0/0x1af0 [ 34.596526] ? __tun_detach+0x1390/0x1390 [ 34.600642] ? __tun_detach+0x1390/0x1390 [ 34.604761] rtnl_unlock+0xe/0x10 [ 34.608182] tun_chr_close+0x49/0x60 [ 34.611864] __fput+0x333/0x7f0 [ 34.615117] ? fput+0x140/0x140 [ 34.618368] ? check_same_owner+0x320/0x320 [ 34.622658] ? _raw_spin_unlock_irq+0x27/0x70 [ 34.627129] ____fput+0x15/0x20 [ 34.630378] task_work_run+0x199/0x270 [ 34.634237] ? task_work_cancel+0x210/0x210 [ 34.638528] ? _raw_spin_unlock+0x22/0x30 [ 34.642657] ? switch_task_namespaces+0x87/0xc0 [ 34.647301] do_exit+0xa52/0x1b40 [ 34.650725] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.655715] ? check_noncircular+0x20/0x20 [ 34.659927] ? mm_update_next_owner+0x930/0x930 [ 34.664569] ? __pmd_alloc+0x4e0/0x4e0 [ 34.668438] ? find_held_lock+0x39/0x1d0 [ 34.672479] ? lock_downgrade+0x990/0x990 [ 34.676617] ? handle_mm_fault+0x410/0x8d0 [ 34.680818] ? down_read_trylock+0xdb/0x170 [ 34.685111] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.689661] ? vmacache_find+0x61/0x270 [ 34.693613] ? up_read+0x1a/0x40 [ 34.696953] ? __do_page_fault+0x35b/0xb60 [ 34.701155] ? do_vfs_ioctl+0x492/0x1530 [ 34.705193] ? do_page_fault+0xee/0x720 [ 34.709136] ? __do_page_fault+0xb60/0xb60 [ 34.713339] ? putname+0xf3/0x130 [ 34.716770] do_group_exit+0x149/0x400 [ 34.720636] ? lockdep_sys_exit+0x47/0xf0 [ 34.724754] ? SyS_exit+0x30/0x30 [ 34.728178] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.733165] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.737892] SyS_exit_group+0x1d/0x20 [ 34.741662] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.746384] RIP: 0033:0x443cf8 [ 34.749542] RSP: 002b:00007fffde086918 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 34.757231] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443cf8 [ 34.764472] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 34.771712] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 34.778950] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 34.786188] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 34.793453] [ 34.795050] Allocated by task 2983: [ 34.798648] save_stack_trace+0x16/0x20 [ 34.802591] save_stack+0x43/0xd0 [ 34.806011] kasan_kmalloc+0xad/0xe0 [ 34.809696] __kmalloc_node+0x47/0x70 [ 34.813466] kvmalloc_node+0x64/0xd0 [ 34.817149] alloc_netdev_mqs+0x16e/0xed0 [ 34.821263] __tun_chr_ioctl+0x12be/0x3d20 [ 34.825474] tun_chr_ioctl+0x2a/0x40 [ 34.829156] do_vfs_ioctl+0x1b1/0x1530 [ 34.833010] SyS_ioctl+0x8f/0xc0 [ 34.836344] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.841062] [ 34.843074] Freed by task 2983: [ 34.846326] save_stack_trace+0x16/0x20 [ 34.850267] save_stack+0x43/0xd0 [ 34.853704] kasan_slab_free+0x71/0xc0 [ 34.857560] kfree+0xca/0x250 [ 34.860635] kvfree+0x36/0x60 [ 34.863709] free_netdev+0x2cf/0x360 [ 34.867391] __tun_chr_ioctl+0x2cf6/0x3d20 [ 34.871592] tun_chr_ioctl+0x2a/0x40 [ 34.875275] do_vfs_ioctl+0x1b1/0x1530 [ 34.879130] SyS_ioctl+0x8f/0xc0 [ 34.882466] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.887187] [ 34.888783] The buggy address belongs to the object at ffff8801cf160380 [ 34.888783] which belongs to the cache kmalloc-16384 of size 16384 [ 34.901752] The buggy address is located 13312 bytes inside of [ 34.901752] 16384-byte region [ffff8801cf160380, ffff8801cf164380) [ 34.913941] The buggy address belongs to the page: [ 34.918840] page:ffffea00073c5800 count:1 mapcount:0 mapping:ffff8801cf160380 index:0x0 compound_mapcount: 0 [ 34.928780] flags: 0x200000000008100(slab|head) [ 34.933419] raw: 0200000000008100 ffff8801cf160380 0000000000000000 0000000100000001 [ 34.941271] raw: ffffea0007380020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 34.949116] page dumped because: kasan: bad access detected [ 34.954794] [ 34.956397] Memory state around the buggy address: [ 34.961291] ffff8801cf163680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.968617] ffff8801cf163700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.975941] >ffff8801cf163780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.983266] ^ [ 34.986601] ffff8801cf163800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.993926] ffff8801cf163880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.001250] ================================================================== [ 35.008574] Disabling lock debugging due to kernel taint [ 35.013984] Kernel panic - not syncing: panic_on_warn set ... [ 35.013984] [ 35.021308] CPU: 0 PID: 2983 Comm: syzkaller509383 Tainted: G B 4.13.0+ #77 [ 35.029495] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.038809] Call Trace: [ 35.041362] dump_stack+0x194/0x257 [ 35.044954] ? arch_local_irq_restore+0x53/0x53 [ 35.049588] ? vprintk_default+0x28/0x30 [ 35.053615] ? detach_if_pending+0x470/0x610 [ 35.057994] panic+0x1e4/0x417 [ 35.061151] ? __warn+0x1d9/0x1d9 [ 35.064573] ? detach_if_pending+0x557/0x610 [ 35.068943] kasan_end_report+0x50/0x50 [ 35.072880] kasan_report+0x137/0x340 [ 35.076654] __asan_report_store8_noabort+0x17/0x20 [ 35.081807] detach_if_pending+0x557/0x610 [ 35.086006] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.091160] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.095789] ? lock_timer_base+0x1a3/0x2b0 [ 35.099986] ? lock_timer_base+0x1eb/0x2b0 [ 35.104185] ? __internal_add_timer+0x2d0/0x2d0 [ 35.108817] ? trace_hardirqs_on+0xd/0x10 [ 35.112929] try_to_del_timer_sync+0xa2/0x120 [ 35.117392] ? del_timer+0x130/0x130 [ 35.121070] ? del_timer_sync+0xeb/0x240 [ 35.125095] del_timer_sync+0x18a/0x240 [ 35.129043] tun_free_netdev+0x105/0x1b0 [ 35.133069] ? tun_xdp+0x410/0x410 [ 35.136571] ? cpumask_next+0x24/0x30 [ 35.140337] ? netdev_refcnt_read+0xed/0x150 [ 35.144709] ? tun_xdp+0x410/0x410 [ 35.148210] netdev_run_todo+0x870/0xca0 [ 35.152234] ? do_group_exit+0x149/0x400 [ 35.156347] ? register_netdev+0x30/0x30 [ 35.160373] ? lock_downgrade+0x990/0x990 [ 35.164486] ? trace_hardirqs_on+0xd/0x10 [ 35.168614] ? refcount_sub_and_test+0x115/0x1b0 [ 35.173340] ? refcount_inc+0x50/0x50 [ 35.177115] ? refcount_inc+0x50/0x50 [ 35.180883] ? sk_destruct+0x4c/0x80 [ 35.184559] ? __sk_free+0x5c/0x230 [ 35.188148] ? sk_free+0x2f/0x40 [ 35.191477] ? __tun_detach+0x176/0x1390 [ 35.195507] ? tun_attach+0xf90/0xf90 [ 35.199273] ? do_raw_spin_trylock+0x190/0x190 [ 35.203820] ? locks_remove_file+0x3fa/0x5a0 [ 35.208193] ? fcntl_setlk+0x10d0/0x10d0 [ 35.212220] ? __fsnotify_parent+0xb4/0x3a0 [ 35.216505] ? fsnotify+0x1af0/0x1af0 [ 35.220273] ? __tun_detach+0x1390/0x1390 [ 35.224385] ? __tun_detach+0x1390/0x1390 [ 35.228500] rtnl_unlock+0xe/0x10 [ 35.231933] tun_chr_close+0x49/0x60 [ 35.235614] __fput+0x333/0x7f0 [ 35.238862] ? fput+0x140/0x140 [ 35.242106] ? check_same_owner+0x320/0x320 [ 35.246391] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.250852] ____fput+0x15/0x20 [ 35.254095] task_work_run+0x199/0x270 [ 35.257945] ? task_work_cancel+0x210/0x210 [ 35.262232] ? _raw_spin_unlock+0x22/0x30 [ 35.266346] ? switch_task_namespaces+0x87/0xc0 [ 35.270979] do_exit+0xa52/0x1b40 [ 35.274400] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.279380] ? check_noncircular+0x20/0x20 [ 35.283583] ? mm_update_next_owner+0x930/0x930 [ 35.288215] ? __pmd_alloc+0x4e0/0x4e0 [ 35.292081] ? find_held_lock+0x39/0x1d0 [ 35.296113] ? lock_downgrade+0x990/0x990 [ 35.300233] ? handle_mm_fault+0x410/0x8d0 [ 35.304432] ? down_read_trylock+0xdb/0x170 [ 35.308717] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.313263] ? vmacache_find+0x61/0x270 [ 35.317203] ? up_read+0x1a/0x40 [ 35.320535] ? __do_page_fault+0x35b/0xb60 [ 35.324735] ? do_vfs_ioctl+0x492/0x1530 [ 35.328763] ? do_page_fault+0xee/0x720 [ 35.332699] ? __do_page_fault+0xb60/0xb60 [ 35.336898] ? putname+0xf3/0x130 [ 35.340320] do_group_exit+0x149/0x400 [ 35.344172] ? lockdep_sys_exit+0x47/0xf0 [ 35.348281] ? SyS_exit+0x30/0x30 [ 35.351698] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.356682] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.361406] SyS_exit_group+0x1d/0x20 [ 35.365171] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.369890] RIP: 0033:0x443cf8 [ 35.373045] RSP: 002b:00007fffde086918 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7