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-4,10.128.15.199' (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: [ 66.026219] ================================================================== [ 66.033723] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 66.040448] Write of size 8 at addr ffff8801cf13b800 by task syzkaller260591/2983 [ 66.048053] [ 66.049654] CPU: 0 PID: 2983 Comm: syzkaller260591 Not tainted 4.13.0+ #73 [ 66.056636] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 66.065972] Call Trace: [ 66.068532] dump_stack+0x194/0x257 [ 66.072135] ? arch_local_irq_restore+0x53/0x53 [ 66.076791] ? show_regs_print_info+0x65/0x65 [ 66.081263] ? lock_timer_base+0x1a3/0x2b0 [ 66.085473] ? detach_if_pending+0x557/0x610 [ 66.089856] print_address_description+0x73/0x250 [ 66.094686] ? detach_if_pending+0x557/0x610 [ 66.099082] kasan_report+0x24e/0x340 [ 66.102867] __asan_report_store8_noabort+0x17/0x20 [ 66.107854] detach_if_pending+0x557/0x610 [ 66.112064] ? __next_timer_interrupt+0x150/0x150 [ 66.116880] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 66.121519] ? lock_timer_base+0x1a3/0x2b0 [ 66.125726] ? lock_timer_base+0x1eb/0x2b0 [ 66.129937] ? __internal_add_timer+0x2d0/0x2d0 [ 66.134585] ? trace_hardirqs_on+0xd/0x10 [ 66.138735] try_to_del_timer_sync+0xa2/0x120 [ 66.143204] ? del_timer+0x130/0x130 [ 66.146892] ? del_timer_sync+0xeb/0x240 [ 66.150935] del_timer_sync+0x18a/0x240 [ 66.154888] tun_free_netdev+0x105/0x1b0 [ 66.158922] ? tun_xdp+0x410/0x410 [ 66.162446] ? netdev_refcnt_read+0xf4/0x160 [ 66.166871] ? tun_xdp+0x410/0x410 [ 66.170383] netdev_run_todo+0x870/0xca0 [ 66.174414] ? do_group_exit+0x149/0x400 [ 66.178488] ? register_netdev+0x30/0x30 [ 66.182550] ? lock_downgrade+0x990/0x990 [ 66.186674] ? trace_hardirqs_on+0xd/0x10 [ 66.190813] ? refcount_sub_and_test+0x115/0x1b0 [ 66.195540] ? refcount_inc+0x50/0x50 [ 66.199313] ? refcount_inc+0x50/0x50 [ 66.203090] ? sk_destruct+0x4c/0x80 [ 66.206775] ? __sk_free+0x5c/0x230 [ 66.210372] ? sk_free+0x2f/0x40 [ 66.213718] ? __tun_detach+0x176/0x1390 [ 66.217764] ? tun_attach+0xf90/0xf90 [ 66.221581] ? locks_remove_file+0x3fa/0x5a0 [ 66.225961] ? fcntl_setlk+0x10d0/0x10d0 [ 66.229999] ? __fsnotify_parent+0xb4/0x3a0 [ 66.234296] ? fsnotify+0x1af0/0x1af0 [ 66.238073] ? __tun_detach+0x1390/0x1390 [ 66.242204] ? __tun_detach+0x1390/0x1390 [ 66.246326] rtnl_unlock+0xe/0x10 [ 66.249751] tun_chr_close+0x49/0x60 [ 66.253466] __fput+0x333/0x7f0 [ 66.256744] ? fput+0x140/0x140 [ 66.260005] ? check_same_owner+0x320/0x320 [ 66.264429] ____fput+0x15/0x20 [ 66.267685] task_work_run+0x199/0x270 [ 66.271563] ? task_work_cancel+0x210/0x210 [ 66.275858] ? free_nsproxy+0x185/0x1f0 [ 66.279807] ? switch_task_namespaces+0xa2/0xc0 [ 66.284479] do_exit+0xa52/0x1b40 [ 66.287929] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 66.292944] ? check_noncircular+0x20/0x20 [ 66.297177] ? mm_update_next_owner+0x930/0x930 [ 66.301822] ? __pmd_alloc+0x4e0/0x4e0 [ 66.305704] ? find_held_lock+0x39/0x1d0 [ 66.309749] ? lock_downgrade+0x990/0x990 [ 66.313891] ? handle_mm_fault+0x4a2/0x860 [ 66.318113] ? down_read_trylock+0xdb/0x170 [ 66.322414] ? __handle_mm_fault+0x3840/0x3840 [ 66.326965] ? vmacache_find+0x61/0x270 [ 66.330935] ? up_read+0x1a/0x40 [ 66.334273] ? __do_page_fault+0x35b/0xb60 [ 66.338494] ? do_vfs_ioctl+0x492/0x1530 [ 66.342538] ? do_page_fault+0xee/0x720 [ 66.346499] ? __do_page_fault+0xb60/0xb60 [ 66.350716] ? putname+0xf3/0x130 [ 66.354147] do_group_exit+0x149/0x400 [ 66.358007] ? lockdep_sys_exit+0x47/0xf0 [ 66.362125] ? SyS_exit+0x30/0x30 [ 66.365553] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 66.370543] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 66.375271] SyS_exit_group+0x1d/0x20 [ 66.379046] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 66.383774] RIP: 0033:0x445139 [ 66.386950] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 66.394672] RAX: ffffffffffffffda RBX: 4739857dcad2719c RCX: 0000000000445139 [ 66.401915] RDX: 0000000000445139 RSI: 0000000020115000 RDI: 0000000000000001 [ 66.409160] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 66.416403] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402790 [ 66.423644] R13: 0000000000402820 R14: 0000000000000000 R15: 0000000000000000 [ 66.430902] [ 66.432505] Allocated by task 2983: [ 66.436101] save_stack_trace+0x16/0x20 [ 66.440045] save_stack+0x43/0xd0 [ 66.443477] kasan_kmalloc+0xad/0xe0 [ 66.447159] __kmalloc_node+0x47/0x70 [ 66.450931] kvmalloc_node+0x64/0xd0 [ 66.454634] alloc_netdev_mqs+0x16e/0xed0 [ 66.458763] __tun_chr_ioctl+0x12be/0x3d40 [ 66.462968] tun_chr_ioctl+0x2a/0x40 [ 66.466650] do_vfs_ioctl+0x1b1/0x1530 [ 66.470505] SyS_ioctl+0x8f/0xc0 [ 66.473844] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 66.478564] [ 66.480160] Freed by task 2983: [ 66.483407] save_stack_trace+0x16/0x20 [ 66.487349] save_stack+0x43/0xd0 [ 66.490772] kasan_slab_free+0x71/0xc0 [ 66.494628] kfree+0xca/0x250 [ 66.497703] kvfree+0x36/0x60 [ 66.500789] free_netdev+0x2cf/0x360 [ 66.504473] __tun_chr_ioctl+0x2cff/0x3d40 [ 66.508678] tun_chr_ioctl+0x2a/0x40 [ 66.512372] do_vfs_ioctl+0x1b1/0x1530 [ 66.516228] SyS_ioctl+0x8f/0xc0 [ 66.519569] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 66.524294] [ 66.525895] The buggy address belongs to the object at ffff8801cf138400 [ 66.525895] which belongs to the cache kmalloc-16384 of size 16384 [ 66.538868] The buggy address is located 13312 bytes inside of [ 66.538868] 16384-byte region [ffff8801cf138400, ffff8801cf13c400) [ 66.551060] The buggy address belongs to the page: [ 66.555973] page:ffffea00073c4e00 count:1 mapcount:0 mapping:ffff8801cf138400 index:0x0 compound_mapcount: 0 [ 66.565920] flags: 0x200000000008100(slab|head) [ 66.570577] raw: 0200000000008100 ffff8801cf138400 0000000000000000 0000000100000001 [ 66.578444] raw: ffffea0007399820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 66.586294] page dumped because: kasan: bad access detected [ 66.591978] [ 66.593576] Memory state around the buggy address: [ 66.598477] ffff8801cf13b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 66.605815] ffff8801cf13b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 66.613148] >ffff8801cf13b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 66.620476] ^ [ 66.623811] ffff8801cf13b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 66.631141] ffff8801cf13b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 66.638468] ================================================================== [ 66.645794] Disabling lock debugging due to kernel taint [ 66.651209] Kernel panic - not syncing: panic_on_warn set ... [ 66.651209] [ 66.658536] CPU: 0 PID: 2983 Comm: syzkaller260591 Tainted: G B 4.13.0+ #73 [ 66.666731] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 66.676053] Call Trace: [ 66.678610] dump_stack+0x194/0x257 [ 66.682208] ? arch_local_irq_restore+0x53/0x53 [ 66.686844] ? vprintk_default+0x28/0x30 [ 66.690870] ? detach_if_pending+0x470/0x610 [ 66.695249] panic+0x1e4/0x417 [ 66.698406] ? __warn+0x1d9/0x1d9 [ 66.701841] ? detach_if_pending+0x557/0x610 [ 66.706231] kasan_end_report+0x50/0x50 [ 66.710172] kasan_report+0x137/0x340 [ 66.713940] __asan_report_store8_noabort+0x17/0x20 [ 66.718922] detach_if_pending+0x557/0x610 [ 66.723122] ? __next_timer_interrupt+0x150/0x150 [ 66.727932] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 66.732566] ? lock_timer_base+0x1a3/0x2b0 [ 66.736803] ? lock_timer_base+0x1eb/0x2b0 [ 66.741026] ? __internal_add_timer+0x2d0/0x2d0 [ 66.745662] ? trace_hardirqs_on+0xd/0x10 [ 66.749780] try_to_del_timer_sync+0xa2/0x120 [ 66.754255] ? del_timer+0x130/0x130 [ 66.757933] ? del_timer_sync+0xeb/0x240 [ 66.761965] del_timer_sync+0x18a/0x240 [ 66.765913] tun_free_netdev+0x105/0x1b0 [ 66.769941] ? tun_xdp+0x410/0x410 [ 66.773448] ? netdev_refcnt_read+0xf4/0x160 [ 66.777823] ? tun_xdp+0x410/0x410 [ 66.781331] netdev_run_todo+0x870/0xca0 [ 66.785359] ? do_group_exit+0x149/0x400 [ 66.789389] ? register_netdev+0x30/0x30 [ 66.793421] ? lock_downgrade+0x990/0x990 [ 66.797536] ? trace_hardirqs_on+0xd/0x10 [ 66.801658] ? refcount_sub_and_test+0x115/0x1b0 [ 66.806378] ? refcount_inc+0x50/0x50 [ 66.810654] ? refcount_inc+0x50/0x50 [ 66.814425] ? sk_destruct+0x4c/0x80 [ 66.818103] ? __sk_free+0x5c/0x230 [ 66.821703] ? sk_free+0x2f/0x40 [ 66.825061] ? __tun_detach+0x176/0x1390 [ 66.829107] ? tun_attach+0xf90/0xf90 [ 66.832920] ? locks_remove_file+0x3fa/0x5a0 [ 66.837308] ? fcntl_setlk+0x10d0/0x10d0 [ 66.841339] ? __fsnotify_parent+0xb4/0x3a0 [ 66.845666] ? fsnotify+0x1af0/0x1af0 [ 66.849434] ? __tun_detach+0x1390/0x1390 [ 66.853548] ? __tun_detach+0x1390/0x1390 [ 66.857667] rtnl_unlock+0xe/0x10 [ 66.861087] tun_chr_close+0x49/0x60 [ 66.864770] __fput+0x333/0x7f0 [ 66.868016] ? fput+0x140/0x140 [ 66.871263] ? check_same_owner+0x320/0x320 [ 66.875552] ____fput+0x15/0x20 [ 66.878838] task_work_run+0x199/0x270 [ 66.882720] ? task_work_cancel+0x210/0x210 [ 66.887009] ? free_nsproxy+0x185/0x1f0 [ 66.890949] ? switch_task_namespaces+0xa2/0xc0 [ 66.895585] do_exit+0xa52/0x1b40 [ 66.899099] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 66.904080] ? check_noncircular+0x20/0x20 [ 66.908296] ? mm_update_next_owner+0x930/0x930 [ 66.912933] ? __pmd_alloc+0x4e0/0x4e0 [ 66.916790] ? find_held_lock+0x39/0x1d0 [ 66.920820] ? lock_downgrade+0x990/0x990 [ 66.924944] ? handle_mm_fault+0x4a2/0x860 [ 66.929142] ? down_read_trylock+0xdb/0x170 [ 66.933431] ? __handle_mm_fault+0x3840/0x3840 [ 66.937977] ? vmacache_find+0x61/0x270 [ 66.941963] ? up_read+0x1a/0x40 [ 66.945294] ? __do_page_fault+0x35b/0xb60 [ 66.949496] ? do_vfs_ioctl+0x492/0x1530 [ 66.953527] ? do_page_fault+0xee/0x720 [ 66.957468] ? __do_page_fault+0xb60/0xb60 [ 66.961682] ? putname+0xf3/0x130 [ 66.965105] do_group_exit+0x149/0x400 [ 66.968960] ? lockdep_sys_exit+0x47/0xf0 [ 66.973074] ? SyS_exit+0x30/0x30 [ 66.976493] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 66.981477] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 66.986217] SyS_exit_group+0x1d/0x20 [ 66.989989] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 66.994709] RIP: 0033:0x445139 [ 66.997862] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 67.005534] RAX: ffffffffffffffda RBX: 4739857dcad2719c RCX: 0000000000445139 [ 67.012771] RDX: 0000000000445139 RSI: 0000000020115000 RDI: 0000000000000001 [ 67.020009] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000