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-8,10.128.0.63' (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.967414] ================================================================== [ 45.968536] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.969429] Write of size 8 at addr ffff8801d347b7c0 by task syzkaller875493/2984 [ 45.970450] [ 45.970684] CPU: 0 PID: 2984 Comm: syzkaller875493 Not tainted 4.13.0+ #79 [ 45.971610] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.972894] Call Trace: [ 45.973257] dump_stack+0x194/0x257 [ 45.973843] ? arch_local_irq_restore+0x53/0x53 [ 45.974484] ? show_regs_print_info+0x65/0x65 [ 45.975129] ? lock_timer_base+0x1a3/0x2b0 [ 45.975704] ? detach_if_pending+0x557/0x610 [ 45.976298] print_address_description+0x73/0x250 [ 45.976945] ? detach_if_pending+0x557/0x610 [ 45.977537] kasan_report+0x24e/0x340 [ 45.978108] __asan_report_store8_noabort+0x17/0x20 [ 45.978786] detach_if_pending+0x557/0x610 [ 45.979359] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.980052] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.980674] ? lock_timer_base+0x1a3/0x2b0 [ 45.981244] ? lock_timer_base+0x1eb/0x2b0 [ 45.981874] ? __internal_add_timer+0x2d0/0x2d0 [ 45.982502] ? trace_hardirqs_on+0xd/0x10 [ 45.983067] try_to_del_timer_sync+0xa2/0x120 [ 45.983668] ? del_timer+0x130/0x130 [ 45.984182] ? del_timer_sync+0xeb/0x240 [ 45.984778] del_timer_sync+0x18a/0x240 [ 45.985342] tun_free_netdev+0x105/0x1b0 [ 45.985900] ? tun_xdp+0x410/0x410 [ 45.986380] ? cpumask_next+0x24/0x30 [ 45.986894] ? netdev_refcnt_read+0xed/0x150 [ 45.987488] ? tun_xdp+0x410/0x410 [ 45.990710] netdev_run_todo+0x870/0xca0 [ 45.994744] ? do_group_exit+0x149/0x400 [ 45.998779] ? register_netdev+0x30/0x30 [ 46.002813] ? lock_downgrade+0x990/0x990 [ 46.006930] ? trace_hardirqs_on+0xd/0x10 [ 46.011066] ? refcount_sub_and_test+0x115/0x1b0 [ 46.015799] ? refcount_inc+0x50/0x50 [ 46.019572] ? refcount_inc+0x50/0x50 [ 46.023350] ? sk_destruct+0x4c/0x80 [ 46.027033] ? __sk_free+0x5c/0x230 [ 46.030632] ? sk_free+0x2f/0x40 [ 46.033971] ? __tun_detach+0x176/0x1390 [ 46.038015] ? tun_attach+0xf90/0xf90 [ 46.041795] ? locks_remove_file+0x3fa/0x5a0 [ 46.046174] ? fcntl_setlk+0x10d0/0x10d0 [ 46.050207] ? __fsnotify_parent+0xb4/0x3a0 [ 46.054499] ? fsnotify+0x1af0/0x1af0 [ 46.058271] ? __tun_detach+0x1390/0x1390 [ 46.062388] ? __tun_detach+0x1390/0x1390 [ 46.066507] rtnl_unlock+0xe/0x10 [ 46.069935] tun_chr_close+0x49/0x60 [ 46.073617] __fput+0x333/0x7f0 [ 46.076871] ? fput+0x140/0x140 [ 46.080119] ? check_same_owner+0x320/0x320 [ 46.084414] ____fput+0x15/0x20 [ 46.087674] task_work_run+0x199/0x270 [ 46.091548] ? task_work_cancel+0x210/0x210 [ 46.095844] ? free_nsproxy+0x185/0x1f0 [ 46.099787] ? switch_task_namespaces+0xa2/0xc0 [ 46.104428] do_exit+0xa52/0x1b40 [ 46.107852] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.112844] ? check_noncircular+0x20/0x20 [ 46.117061] ? mm_update_next_owner+0x930/0x930 [ 46.121700] ? __pmd_alloc+0x4e0/0x4e0 [ 46.125567] ? find_held_lock+0x39/0x1d0 [ 46.129610] ? lock_downgrade+0x990/0x990 [ 46.133750] ? handle_mm_fault+0x410/0x8d0 [ 46.137952] ? down_read_trylock+0xdb/0x170 [ 46.142242] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.146796] ? vmacache_find+0x61/0x270 [ 46.150739] ? vmacache_update+0xfe/0x130 [ 46.154861] ? up_read+0x1a/0x40 [ 46.158200] ? __do_page_fault+0x35b/0xb60 [ 46.162421] ? do_vfs_ioctl+0x492/0x1530 [ 46.166460] ? do_page_fault+0xee/0x720 [ 46.170405] ? __do_page_fault+0xb60/0xb60 [ 46.174621] ? putname+0xf3/0x130 [ 46.178062] do_group_exit+0x149/0x400 [ 46.181926] ? lockdep_sys_exit+0x47/0xf0 [ 46.186040] ? SyS_exit+0x30/0x30 [ 46.189478] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.194466] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.199202] SyS_exit_group+0x1d/0x20 [ 46.202984] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.207717] RIP: 0033:0x445129 [ 46.210883] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.218580] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445129 [ 46.225826] RDX: 0000000000445129 RSI: 0000000020fbcfd8 RDI: 0000000000000001 [ 46.233069] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 46.240320] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402780 [ 46.247559] R13: 0000000000402810 R14: 0000000000000000 R15: 0000000000000000 [ 46.254818] [ 46.256413] Allocated by task 2984: [ 46.260014] save_stack_trace+0x16/0x20 [ 46.263957] save_stack+0x43/0xd0 [ 46.267378] kasan_kmalloc+0xad/0xe0 [ 46.271072] __kmalloc_node+0x47/0x70 [ 46.274847] kvmalloc_node+0x64/0xd0 [ 46.278529] alloc_netdev_mqs+0x16e/0xed0 [ 46.282653] __tun_chr_ioctl+0x12be/0x3d20 [ 46.286854] tun_chr_ioctl+0x2a/0x40 [ 46.290536] do_vfs_ioctl+0x1b1/0x1530 [ 46.294391] SyS_ioctl+0x8f/0xc0 [ 46.297725] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.302444] [ 46.304042] Freed by task 2984: [ 46.307289] save_stack_trace+0x16/0x20 [ 46.311235] save_stack+0x43/0xd0 [ 46.314665] kasan_slab_free+0x71/0xc0 [ 46.318529] kfree+0xca/0x250 [ 46.321607] kvfree+0x36/0x60 [ 46.324683] free_netdev+0x2cf/0x360 [ 46.328364] __tun_chr_ioctl+0x2cf6/0x3d20 [ 46.332566] tun_chr_ioctl+0x2a/0x40 [ 46.336249] do_vfs_ioctl+0x1b1/0x1530 [ 46.340112] SyS_ioctl+0x8f/0xc0 [ 46.343448] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.348167] [ 46.349766] The buggy address belongs to the object at ffff8801d34783c0 [ 46.349766] which belongs to the cache kmalloc-16384 of size 16384 [ 46.362823] The buggy address is located 13312 bytes inside of [ 46.362823] 16384-byte region [ffff8801d34783c0, ffff8801d347c3c0) [ 46.375012] The buggy address belongs to the page: [ 46.379921] page:ffffea00074d1e00 count:1 mapcount:0 mapping:ffff8801d34783c0 index:0x0 compound_mapcount: 0 [ 46.389882] flags: 0x200000000008100(slab|head) [ 46.394520] raw: 0200000000008100 ffff8801d34783c0 0000000000000000 0000000100000001 [ 46.402369] raw: ffffea000739f420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 46.410221] page dumped because: kasan: bad access detected [ 46.415899] [ 46.417500] Memory state around the buggy address: [ 46.422408] ffff8801d347b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.429733] ffff8801d347b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.437058] >ffff8801d347b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.444393] ^ [ 46.449816] ffff8801d347b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.457142] ffff8801d347b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.464474] ================================================================== [ 46.471800] Disabling lock debugging due to kernel taint [ 46.477211] Kernel panic - not syncing: panic_on_warn set ... [ 46.477211] [ 46.484538] CPU: 0 PID: 2984 Comm: syzkaller875493 Tainted: G B 4.13.0+ #79 [ 46.492727] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.502043] Call Trace: [ 46.504597] dump_stack+0x194/0x257 [ 46.508191] ? arch_local_irq_restore+0x53/0x53 [ 46.512825] ? vprintk_default+0x28/0x30 [ 46.516851] ? detach_if_pending+0x470/0x610 [ 46.521230] panic+0x1e4/0x417 [ 46.524393] ? __warn+0x1d9/0x1d9 [ 46.527829] ? detach_if_pending+0x557/0x610 [ 46.532218] kasan_end_report+0x50/0x50 [ 46.536164] kasan_report+0x137/0x340 [ 46.539945] __asan_report_store8_noabort+0x17/0x20 [ 46.544927] detach_if_pending+0x557/0x610 [ 46.549126] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.554284] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.558920] ? lock_timer_base+0x1a3/0x2b0 [ 46.563123] ? lock_timer_base+0x1eb/0x2b0 [ 46.567327] ? __internal_add_timer+0x2d0/0x2d0 [ 46.571970] ? trace_hardirqs_on+0xd/0x10 [ 46.576100] try_to_del_timer_sync+0xa2/0x120 [ 46.580571] ? del_timer+0x130/0x130 [ 46.584257] ? del_timer_sync+0xeb/0x240 [ 46.588288] del_timer_sync+0x18a/0x240 [ 46.592228] tun_free_netdev+0x105/0x1b0 [ 46.596251] ? tun_xdp+0x410/0x410 [ 46.599753] ? cpumask_next+0x24/0x30 [ 46.603516] ? netdev_refcnt_read+0xed/0x150 [ 46.607890] ? tun_xdp+0x410/0x410 [ 46.611391] netdev_run_todo+0x870/0xca0 [ 46.615416] ? do_group_exit+0x149/0x400 [ 46.619457] ? register_netdev+0x30/0x30 [ 46.623483] ? lock_downgrade+0x990/0x990 [ 46.627594] ? trace_hardirqs_on+0xd/0x10 [ 46.631714] ? refcount_sub_and_test+0x115/0x1b0 [ 46.636431] ? refcount_inc+0x50/0x50 [ 46.640194] ? refcount_inc+0x50/0x50 [ 46.643957] ? sk_destruct+0x4c/0x80 [ 46.648042] ? __sk_free+0x5c/0x230 [ 46.651712] ? sk_free+0x2f/0x40 [ 46.655043] ? __tun_detach+0x176/0x1390 [ 46.659077] ? tun_attach+0xf90/0xf90 [ 46.662851] ? locks_remove_file+0x3fa/0x5a0 [ 46.667230] ? fcntl_setlk+0x10d0/0x10d0 [ 46.671256] ? __fsnotify_parent+0xb4/0x3a0 [ 46.675542] ? fsnotify+0x1af0/0x1af0 [ 46.679306] ? __tun_detach+0x1390/0x1390 [ 46.683418] ? __tun_detach+0x1390/0x1390 [ 46.687530] rtnl_unlock+0xe/0x10 [ 46.690944] tun_chr_close+0x49/0x60 [ 46.694624] __fput+0x333/0x7f0 [ 46.697869] ? fput+0x140/0x140 [ 46.701115] ? check_same_owner+0x320/0x320 [ 46.705405] ____fput+0x15/0x20 [ 46.708667] task_work_run+0x199/0x270 [ 46.712524] ? task_work_cancel+0x210/0x210 [ 46.716813] ? free_nsproxy+0x185/0x1f0 [ 46.720752] ? switch_task_namespaces+0xa2/0xc0 [ 46.725389] do_exit+0xa52/0x1b40 [ 46.728809] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.733789] ? check_noncircular+0x20/0x20 [ 46.737990] ? mm_update_next_owner+0x930/0x930 [ 46.742636] ? __pmd_alloc+0x4e0/0x4e0 [ 46.746495] ? find_held_lock+0x39/0x1d0 [ 46.750525] ? lock_downgrade+0x990/0x990 [ 46.754646] ? handle_mm_fault+0x410/0x8d0 [ 46.758845] ? down_read_trylock+0xdb/0x170 [ 46.763130] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.767682] ? vmacache_find+0x61/0x270 [ 46.771627] ? vmacache_update+0xfe/0x130 [ 46.775740] ? up_read+0x1a/0x40 [ 46.779072] ? __do_page_fault+0x35b/0xb60 [ 46.783271] ? do_vfs_ioctl+0x492/0x1530 [ 46.787298] ? do_page_fault+0xee/0x720 [ 46.791238] ? __do_page_fault+0xb60/0xb60 [ 46.795437] ? putname+0xf3/0x130 [ 46.798858] do_group_exit+0x149/0x400 [ 46.802709] ? lockdep_sys_exit+0x47/0xf0 [ 46.806818] ? SyS_exit+0x30/0x30 [ 46.810237] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.815221] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.819945] SyS_exit_group+0x1d/0x20 [ 46.823711] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.828427] RIP: 0033:0x445129 [ 46.831581] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 46.839253] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445129 [ 46.846487] RDX: 0000000000445129 RSI: 0000000020fbcfd8 RDI: 0000000000000001 [ 46.853724] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 46.860961] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402780 [ 46.868208] R13: 0000000000402810 R14: 0000000000000000 R15: 0000000000000000