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-5,10.128.0.32' (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: [ 35.079343] ================================================================== [ 35.086882] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.093616] Write of size 8 at addr ffff8801cc6b37c0 by task syzkaller317586/3041 [ 35.101206] [ 35.102809] CPU: 1 PID: 3041 Comm: syzkaller317586 Not tainted 4.13.0+ #70 [ 35.109798] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.119126] Call Trace: [ 35.121693] dump_stack+0x194/0x257 [ 35.125297] ? arch_local_irq_restore+0x53/0x53 [ 35.129946] ? show_regs_print_info+0x65/0x65 [ 35.134628] ? lock_timer_base+0x1a3/0x2b0 [ 35.138841] ? detach_if_pending+0x557/0x610 [ 35.143227] print_address_description+0x73/0x250 [ 35.148049] ? detach_if_pending+0x557/0x610 [ 35.152432] kasan_report+0x24e/0x340 [ 35.156211] __asan_report_store8_noabort+0x17/0x20 [ 35.161202] detach_if_pending+0x557/0x610 [ 35.165412] ? __next_timer_interrupt+0x150/0x150 [ 35.170229] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.174875] ? lock_timer_base+0x1a3/0x2b0 [ 35.179084] ? lock_timer_base+0x1eb/0x2b0 [ 35.183306] ? __internal_add_timer+0x2d0/0x2d0 [ 35.187963] try_to_del_timer_sync+0xa2/0x120 [ 35.192433] ? del_timer+0x130/0x130 [ 35.196131] ? del_timer_sync+0xeb/0x240 [ 35.200172] del_timer_sync+0x18a/0x240 [ 35.204127] tun_free_netdev+0x105/0x1b0 [ 35.208164] ? tun_show_group+0x170/0x170 [ 35.212304] ? netdev_refcnt_read+0xf4/0x160 [ 35.216690] ? tun_show_group+0x170/0x170 [ 35.220813] netdev_run_todo+0x870/0xca0 [ 35.224848] ? do_group_exit+0x149/0x400 [ 35.228901] ? register_netdev+0x30/0x30 [ 35.232940] ? lock_downgrade+0x990/0x990 [ 35.237063] ? trace_hardirqs_on+0xd/0x10 [ 35.241203] ? refcount_sub_and_test+0x115/0x1b0 [ 35.245934] ? refcount_inc+0x50/0x50 [ 35.249711] ? refcount_inc+0x50/0x50 [ 35.253491] ? sk_destruct+0x4c/0x80 [ 35.257178] ? __sk_free+0x5c/0x230 [ 35.260784] ? sk_free+0x2f/0x40 [ 35.264124] ? __tun_detach+0x176/0x1390 [ 35.268170] ? tun_attach+0xf90/0xf90 [ 35.271954] ? locks_remove_file+0x414/0x560 [ 35.276340] ? fcntl_setlk+0x10d0/0x10d0 [ 35.280380] ? __fsnotify_parent+0xb4/0x3a0 [ 35.284683] ? fsnotify+0x1af0/0x1af0 [ 35.288464] ? __tun_detach+0x1390/0x1390 [ 35.292587] ? __tun_detach+0x1390/0x1390 [ 35.296722] rtnl_unlock+0xe/0x10 [ 35.300149] tun_chr_close+0x49/0x60 [ 35.303840] __fput+0x333/0x7f0 [ 35.307100] ? fput+0x140/0x140 [ 35.310356] ? check_same_owner+0x320/0x320 [ 35.314659] ____fput+0x15/0x20 [ 35.317910] task_work_run+0x199/0x270 [ 35.321774] ? task_work_cancel+0x210/0x210 [ 35.326069] ? free_nsproxy+0x185/0x1f0 [ 35.330019] ? switch_task_namespaces+0xa2/0xc0 [ 35.334670] do_exit+0xa52/0x1b40 [ 35.338099] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.343090] ? trace_hardirqs_on+0xd/0x10 [ 35.347216] ? kvfree+0x3b/0x60 [ 35.350471] ? mm_update_next_owner+0x930/0x930 [ 35.355117] ? rtnl_unlock+0xe/0x10 [ 35.359412] ? __tun_chr_ioctl+0x27a/0x3d70 [ 35.363716] ? unwind_get_return_address+0x64/0xa0 [ 35.368638] ? tun_select_queue+0x580/0x580 [ 35.372939] ? putname+0xee/0x130 [ 35.376366] ? save_stack+0xa3/0xd0 [ 35.380330] ? save_stack_trace+0x16/0x20 [ 35.384452] ? save_stack+0x43/0xd0 [ 35.388062] ? kasan_slab_free+0x71/0xc0 [ 35.392105] ? kmem_cache_free+0x77/0x280 [ 35.396228] ? putname+0xee/0x130 [ 35.399662] ? __lock_is_held+0xbc/0x140 [ 35.403715] ? check_same_owner+0x320/0x320 [ 35.408017] ? tun_chr_compat_ioctl+0x30/0x30 [ 35.412484] ? tun_chr_ioctl+0x2a/0x40 [ 35.416347] ? tun_chr_ioctl+0x2a/0x40 [ 35.420210] ? do_vfs_ioctl+0x492/0x1530 [ 35.424253] ? ioctl_preallocate+0x2b0/0x2b0 [ 35.428816] ? selinux_capable+0x40/0x40 [ 35.432856] ? putname+0xf3/0x130 [ 35.436297] do_group_exit+0x149/0x400 [ 35.440174] ? SyS_exit+0x30/0x30 [ 35.443604] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.448598] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.453337] SyS_exit_group+0x1d/0x20 [ 35.457120] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.461848] RIP: 0033:0x445569 [ 35.465010] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 35.472700] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569 [ 35.479941] RDX: 0000000000445569 RSI: 0000000020f6e000 RDI: 0000000000000001 [ 35.487184] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 35.494430] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bc0 [ 35.501680] R13: 0000000000402c50 R14: 0000000000000000 R15: 0000000000000000 [ 35.508942] [ 35.510545] Allocated by task 3041: [ 35.514146] save_stack_trace+0x16/0x20 [ 35.518088] save_stack+0x43/0xd0 [ 35.521512] kasan_kmalloc+0xad/0xe0 [ 35.525207] __kmalloc_node+0x47/0x70 [ 35.528977] kvmalloc_node+0x64/0xd0 [ 35.532750] alloc_netdev_mqs+0x16e/0xed0 [ 35.536880] __tun_chr_ioctl+0x12be/0x3d70 [ 35.541085] tun_chr_ioctl+0x2a/0x40 [ 35.544767] do_vfs_ioctl+0x1b1/0x1530 [ 35.548630] SyS_ioctl+0x8f/0xc0 [ 35.551984] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.556706] [ 35.558304] Freed by task 3041: [ 35.561564] save_stack_trace+0x16/0x20 [ 35.565510] save_stack+0x43/0xd0 [ 35.568933] kasan_slab_free+0x71/0xc0 [ 35.572791] kfree+0xca/0x250 [ 35.575865] kvfree+0x36/0x60 [ 35.578942] free_netdev+0x2cf/0x360 [ 35.582630] __tun_chr_ioctl+0x2d30/0x3d70 [ 35.586835] tun_chr_ioctl+0x2a/0x40 [ 35.590530] do_vfs_ioctl+0x1b1/0x1530 [ 35.594385] SyS_ioctl+0x8f/0xc0 [ 35.597724] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.602448] [ 35.604048] The buggy address belongs to the object at ffff8801cc6b03c0 [ 35.604048] which belongs to the cache kmalloc-16384 of size 16384 [ 35.617031] The buggy address is located 13312 bytes inside of [ 35.617031] 16384-byte region [ffff8801cc6b03c0, ffff8801cc6b43c0) [ 35.629335] The buggy address belongs to the page: [ 35.634247] page:ffffea000731ac00 count:1 mapcount:0 mapping:ffff8801cc6b03c0 index:0x0 compound_mapcount: 0 [ 35.644213] flags: 0x200000000008100(slab|head) [ 35.648856] raw: 0200000000008100 ffff8801cc6b03c0 0000000000000000 0000000100000001 [ 35.656712] raw: ffffea000731d620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.664569] page dumped because: kasan: bad access detected [ 35.670249] [ 35.671847] Memory state around the buggy address: [ 35.676746] ffff8801cc6b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.684081] ffff8801cc6b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.691425] >ffff8801cc6b3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.698759] ^ [ 35.704181] ffff8801cc6b3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.711524] ffff8801cc6b3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.718853] ================================================================== [ 35.726181] Disabling lock debugging due to kernel taint [ 35.731705] Kernel panic - not syncing: panic_on_warn set ... [ 35.731705] [ 35.739238] CPU: 1 PID: 3041 Comm: syzkaller317586 Tainted: G B 4.13.0+ #70 [ 35.747892] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.757402] Call Trace: [ 35.759996] dump_stack+0x194/0x257 [ 35.763600] ? arch_local_irq_restore+0x53/0x53 [ 35.768236] ? vprintk_default+0x28/0x30 [ 35.772283] ? detach_if_pending+0x4a0/0x610 [ 35.776661] panic+0x1e4/0x417 [ 35.779818] ? __warn+0x1d9/0x1d9 [ 35.783245] ? detach_if_pending+0x557/0x610 [ 35.787621] kasan_end_report+0x50/0x50 [ 35.791566] kasan_report+0x137/0x340 [ 35.795334] __asan_report_store8_noabort+0x17/0x20 [ 35.800327] detach_if_pending+0x557/0x610 [ 35.804538] ? __next_timer_interrupt+0x150/0x150 [ 35.809363] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.814013] ? lock_timer_base+0x1a3/0x2b0 [ 35.818306] ? lock_timer_base+0x1eb/0x2b0 [ 35.822529] ? __internal_add_timer+0x2d0/0x2d0 [ 35.827177] try_to_del_timer_sync+0xa2/0x120 [ 35.831663] ? del_timer+0x130/0x130 [ 35.835346] ? del_timer_sync+0xeb/0x240 [ 35.839378] del_timer_sync+0x18a/0x240 [ 35.843335] tun_free_netdev+0x105/0x1b0 [ 35.847374] ? tun_show_group+0x170/0x170 [ 35.851502] ? netdev_refcnt_read+0xf4/0x160 [ 35.855896] ? tun_show_group+0x170/0x170 [ 35.860025] netdev_run_todo+0x870/0xca0 [ 35.864165] ? do_group_exit+0x149/0x400 [ 35.868202] ? register_netdev+0x30/0x30 [ 35.872237] ? lock_downgrade+0x990/0x990 [ 35.876353] ? trace_hardirqs_on+0xd/0x10 [ 35.880479] ? refcount_sub_and_test+0x115/0x1b0 [ 35.885208] ? refcount_inc+0x50/0x50 [ 35.889008] ? refcount_inc+0x50/0x50 [ 35.892781] ? sk_destruct+0x4c/0x80 [ 35.896474] ? __sk_free+0x5c/0x230 [ 35.900080] ? sk_free+0x2f/0x40 [ 35.903426] ? __tun_detach+0x176/0x1390 [ 35.907483] ? tun_attach+0xf90/0xf90 [ 35.911258] ? locks_remove_file+0x414/0x560 [ 35.915755] ? fcntl_setlk+0x10d0/0x10d0 [ 35.919787] ? __fsnotify_parent+0xb4/0x3a0 [ 35.924188] ? fsnotify+0x1af0/0x1af0 [ 35.927974] ? __tun_detach+0x1390/0x1390 [ 35.932109] ? __tun_detach+0x1390/0x1390 [ 35.936238] rtnl_unlock+0xe/0x10 [ 35.939668] tun_chr_close+0x49/0x60 [ 35.943356] __fput+0x333/0x7f0 [ 35.946695] ? fput+0x140/0x140 [ 35.949947] ? check_same_owner+0x320/0x320 [ 35.954273] ____fput+0x15/0x20 [ 35.957523] task_work_run+0x199/0x270 [ 35.961379] ? task_work_cancel+0x210/0x210 [ 35.965671] ? free_nsproxy+0x185/0x1f0 [ 35.969630] ? switch_task_namespaces+0xa2/0xc0 [ 35.974283] do_exit+0xa52/0x1b40 [ 35.977720] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.982796] ? trace_hardirqs_on+0xd/0x10 [ 35.986920] ? kvfree+0x3b/0x60 [ 35.990189] ? mm_update_next_owner+0x930/0x930 [ 35.994825] ? rtnl_unlock+0xe/0x10 [ 35.998419] ? __tun_chr_ioctl+0x27a/0x3d70 [ 36.002714] ? unwind_get_return_address+0x64/0xa0 [ 36.007617] ? tun_select_queue+0x580/0x580 [ 36.011915] ? putname+0xee/0x130 [ 36.015339] ? save_stack+0xa3/0xd0 [ 36.018930] ? save_stack_trace+0x16/0x20 [ 36.023043] ? save_stack+0x43/0xd0 [ 36.026648] ? kasan_slab_free+0x71/0xc0 [ 36.030678] ? kmem_cache_free+0x77/0x280 [ 36.034789] ? putname+0xee/0x130 [ 36.038215] ? __lock_is_held+0xbc/0x140 [ 36.042260] ? check_same_owner+0x320/0x320 [ 36.046552] ? tun_chr_compat_ioctl+0x30/0x30 [ 36.051019] ? tun_chr_ioctl+0x2a/0x40 [ 36.054878] ? tun_chr_ioctl+0x2a/0x40 [ 36.058733] ? do_vfs_ioctl+0x492/0x1530 [ 36.062760] ? ioctl_preallocate+0x2b0/0x2b0 [ 36.067136] ? selinux_capable+0x40/0x40 [ 36.071165] ? putname+0xf3/0x130 [ 36.074593] do_group_exit+0x149/0x400 [ 36.078449] ? SyS_exit+0x30/0x30