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.217' (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: [ 51.323356] ================================================================== [ 51.324457] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 51.325358] Write of size 8 at addr ffff8801d1f13678 by task syzkaller264667/2979 [ 51.326361] [ 51.326593] CPU: 0 PID: 2979 Comm: syzkaller264667 Not tainted 4.14.0-rc4+ #132 [ 51.327567] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.328830] Call Trace: [ 51.329189] dump_stack+0x194/0x257 [ 51.329679] ? arch_local_irq_restore+0x53/0x53 [ 51.330304] ? show_regs_print_info+0x65/0x65 [ 51.330905] ? lock_timer_base+0x1a3/0x2b0 [ 51.331476] ? detach_if_pending+0x557/0x610 [ 51.332100] print_address_description+0x73/0x250 [ 51.332827] ? detach_if_pending+0x557/0x610 [ 51.333430] kasan_report+0x25b/0x340 [ 51.333944] __asan_report_store8_noabort+0x17/0x20 [ 51.334608] detach_if_pending+0x557/0x610 [ 51.335193] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.335898] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.336519] ? lock_timer_base+0x1a3/0x2b0 [ 51.337085] ? lock_timer_base+0x1eb/0x2b0 [ 51.337656] ? __internal_add_timer+0x2d0/0x2d0 [ 51.338289] ? lock_downgrade+0x990/0x990 [ 51.338880] ? trace_hardirqs_on+0xd/0x10 [ 51.339489] try_to_del_timer_sync+0xa2/0x120 [ 51.340099] ? del_timer+0x130/0x130 [ 51.340727] ? del_timer_sync+0xeb/0x240 [ 51.341278] del_timer_sync+0x18a/0x240 [ 51.341812] tun_free_netdev+0x105/0x1b0 [ 51.342358] ? tun_xdp+0x410/0x410 [ 51.342832] ? cpumask_next+0x24/0x30 [ 51.343345] ? netdev_refcnt_read+0xed/0x150 [ 51.346922] ? tun_xdp+0x410/0x410 [ 51.350431] netdev_run_todo+0x870/0xca0 [ 51.354462] ? do_group_exit+0x149/0x400 [ 51.358493] ? mark_held_locks+0xaf/0x100 [ 51.362607] ? register_netdev+0x30/0x30 [ 51.366636] ? find_held_lock+0x35/0x1d0 [ 51.370673] ? lock_downgrade+0x990/0x990 [ 51.374793] ? refcount_sub_and_test+0x115/0x1b0 [ 51.379516] ? refcount_inc+0x50/0x50 [ 51.383285] ? refcount_inc+0x50/0x50 [ 51.387056] ? sk_destruct+0x4c/0x80 [ 51.390736] ? __sk_free+0x5c/0x230 [ 51.394328] ? sk_free+0x2f/0x40 [ 51.397659] ? __tun_detach+0x176/0x1390 [ 51.401696] ? tun_attach+0xfa0/0xfa0 [ 51.405471] ? locks_remove_file+0x3fa/0x5a0 [ 51.409849] ? fcntl_setlk+0x10c0/0x10c0 [ 51.413880] ? __fsnotify_parent+0xb4/0x3a0 [ 51.418168] ? fsnotify+0x1af0/0x1af0 [ 51.421940] ? __tun_detach+0x1390/0x1390 [ 51.426053] rtnl_unlock+0xe/0x10 [ 51.429473] tun_chr_close+0x49/0x60 [ 51.433153] __fput+0x327/0x7e0 [ 51.436404] ? fput+0x140/0x140 [ 51.439652] ? check_same_owner+0x320/0x320 [ 51.443951] ____fput+0x15/0x20 [ 51.447196] task_work_run+0x199/0x270 [ 51.451055] ? task_work_cancel+0x210/0x210 [ 51.455345] ? free_nsproxy+0x185/0x1f0 [ 51.459286] ? switch_task_namespaces+0xa2/0xc0 [ 51.463924] do_exit+0x9b5/0x1ad0 [ 51.467352] ? kvfree+0x3b/0x60 [ 51.470600] ? mm_update_next_owner+0x930/0x930 [ 51.475231] ? find_held_lock+0x35/0x1d0 [ 51.479268] ? handle_mm_fault+0x248/0x8d0 [ 51.483475] ? find_held_lock+0x35/0x1d0 [ 51.487509] ? __do_page_fault+0x64c/0xd60 [ 51.491711] ? lock_downgrade+0x990/0x990 [ 51.495847] ? handle_mm_fault+0x410/0x8d0 [ 51.500046] ? __do_page_fault+0x31e/0xd60 [ 51.504247] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.508792] ? vmacache_find+0x5f/0x280 [ 51.512737] ? up_read+0x1a/0x40 [ 51.516069] ? __do_page_fault+0x3d6/0xd60 [ 51.520276] ? mm_fault_error+0x2c0/0x2c0 [ 51.524391] ? do_vfs_ioctl+0x486/0x1520 [ 51.528424] ? do_page_fault+0xee/0x720 [ 51.532365] ? __do_page_fault+0xd60/0xd60 [ 51.536563] ? putname+0xf3/0x130 [ 51.539988] do_group_exit+0x149/0x400 [ 51.543844] ? SyS_exit+0x30/0x30 [ 51.547266] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.552247] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.556969] SyS_exit_group+0x1d/0x20 [ 51.560737] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.565455] RIP: 0033:0x444eb9 [ 51.568610] RSP: 002b:00007ffe95da0258 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 51.576281] RAX: ffffffffffffffda RBX: 00007ffe95da02a0 RCX: 0000000000444eb9 [ 51.583519] RDX: 0000000000444eb9 RSI: 0000000020ca5fd8 RDI: 0000000000000001 [ 51.590763] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffe95da02a0 [ 51.597998] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402200 [ 51.605233] R13: 0000000000402290 R14: 0000000000000000 R15: 0000000000000000 [ 51.612483] [ 51.614077] Allocated by task 2979: [ 51.617670] save_stack_trace+0x16/0x20 [ 51.621608] save_stack+0x43/0xd0 [ 51.625025] kasan_kmalloc+0xad/0xe0 [ 51.628705] __kmalloc_node+0x47/0x70 [ 51.632469] kvmalloc_node+0x64/0xd0 [ 51.636148] alloc_netdev_mqs+0x16e/0xed0 [ 51.640261] __tun_chr_ioctl+0x12b2/0x3d20 [ 51.644460] tun_chr_ioctl+0x2a/0x40 [ 51.648137] do_vfs_ioctl+0x1b1/0x1520 [ 51.651988] SyS_ioctl+0x8f/0xc0 [ 51.655332] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.660047] [ 51.661640] Freed by task 2979: [ 51.664882] save_stack_trace+0x16/0x20 [ 51.668820] save_stack+0x43/0xd0 [ 51.672237] kasan_slab_free+0x71/0xc0 [ 51.676087] kfree+0xca/0x250 [ 51.679157] kvfree+0x36/0x60 [ 51.682228] free_netdev+0x2cf/0x360 [ 51.685904] __tun_chr_ioctl+0x2cea/0x3d20 [ 51.690102] tun_chr_ioctl+0x2a/0x40 [ 51.693779] do_vfs_ioctl+0x1b1/0x1520 [ 51.697628] SyS_ioctl+0x8f/0xc0 [ 51.700962] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.705681] [ 51.707274] The buggy address belongs to the object at ffff8801d1f10340 [ 51.707274] which belongs to the cache kmalloc-16384 of size 16384 [ 51.720240] The buggy address is located 13112 bytes inside of [ 51.720240] 16384-byte region [ffff8801d1f10340, ffff8801d1f14340) [ 51.732423] The buggy address belongs to the page: [ 51.737321] page:ffffea000747c400 count:1 mapcount:0 mapping:ffff8801d1f10340 index:0x0 compound_mapcount: 0 [ 51.747254] flags: 0x200000000008100(slab|head) [ 51.751889] raw: 0200000000008100 ffff8801d1f10340 0000000000000000 0000000100000001 [ 51.759738] raw: ffffea0007443420 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 51.767580] page dumped because: kasan: bad access detected [ 51.773253] [ 51.774845] Memory state around the buggy address: [ 51.779737] ffff8801d1f13500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.787060] ffff8801d1f13580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.794383] >ffff8801d1f13600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.801722] ^ [ 51.808959] ffff8801d1f13680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.816279] ffff8801d1f13700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.823599] ================================================================== [ 51.830920] Disabling lock debugging due to kernel taint [ 51.836332] Kernel panic - not syncing: panic_on_warn set ... [ 51.836332] [ 51.843661] CPU: 0 PID: 2979 Comm: syzkaller264667 Tainted: G B 4.14.0-rc4+ #132 [ 51.852287] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.861604] Call Trace: [ 51.864162] dump_stack+0x194/0x257 [ 51.867755] ? arch_local_irq_restore+0x53/0x53 [ 51.872384] ? kasan_end_report+0x32/0x50 [ 51.876498] ? lock_downgrade+0x990/0x990 [ 51.880610] ? detach_if_pending+0x510/0x610 [ 51.884984] panic+0x1e4/0x417 [ 51.888140] ? __warn+0x1d9/0x1d9 [ 51.891563] ? detach_if_pending+0x557/0x610 [ 51.895934] kasan_end_report+0x50/0x50 [ 51.899871] kasan_report+0x144/0x340 [ 51.903638] __asan_report_store8_noabort+0x17/0x20 [ 51.908616] detach_if_pending+0x557/0x610 [ 51.912813] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.917966] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.922597] ? lock_timer_base+0x1a3/0x2b0 [ 51.926795] ? lock_timer_base+0x1eb/0x2b0 [ 51.930994] ? __internal_add_timer+0x2d0/0x2d0 [ 51.935624] ? lock_downgrade+0x990/0x990 [ 51.939733] ? trace_hardirqs_on+0xd/0x10 [ 51.943854] try_to_del_timer_sync+0xa2/0x120 [ 51.948311] ? del_timer+0x130/0x130 [ 51.951988] ? del_timer_sync+0xeb/0x240 [ 51.956014] del_timer_sync+0x18a/0x240 [ 51.959952] tun_free_netdev+0x105/0x1b0 [ 51.963977] ? tun_xdp+0x410/0x410 [ 51.967480] ? cpumask_next+0x24/0x30 [ 51.971244] ? netdev_refcnt_read+0xed/0x150 [ 51.975617] ? tun_xdp+0x410/0x410 [ 51.979124] netdev_run_todo+0x870/0xca0 [ 51.983150] ? do_group_exit+0x149/0x400 [ 51.987176] ? mark_held_locks+0xaf/0x100 [ 51.991286] ? register_netdev+0x30/0x30 [ 51.995318] ? find_held_lock+0x35/0x1d0 [ 51.999348] ? lock_downgrade+0x990/0x990 [ 52.003461] ? refcount_sub_and_test+0x115/0x1b0 [ 52.008186] ? refcount_inc+0x50/0x50 [ 52.012501] ? refcount_inc+0x50/0x50 [ 52.016269] ? sk_destruct+0x4c/0x80 [ 52.019945] ? __sk_free+0x5c/0x230 [ 52.023534] ? sk_free+0x2f/0x40 [ 52.026863] ? __tun_detach+0x176/0x1390 [ 52.030892] ? tun_attach+0xfa0/0xfa0 [ 52.034665] ? locks_remove_file+0x3fa/0x5a0 [ 52.039037] ? fcntl_setlk+0x10c0/0x10c0 [ 52.043063] ? __fsnotify_parent+0xb4/0x3a0 [ 52.047350] ? fsnotify+0x1af0/0x1af0 [ 52.051117] ? __tun_detach+0x1390/0x1390 [ 52.055231] rtnl_unlock+0xe/0x10 [ 52.058649] tun_chr_close+0x49/0x60 [ 52.062326] __fput+0x327/0x7e0 [ 52.065571] ? fput+0x140/0x140 [ 52.068815] ? check_same_owner+0x320/0x320 [ 52.073103] ____fput+0x15/0x20 [ 52.076350] task_work_run+0x199/0x270 [ 52.080206] ? task_work_cancel+0x210/0x210 [ 52.084492] ? free_nsproxy+0x185/0x1f0 [ 52.088429] ? switch_task_namespaces+0xa2/0xc0 [ 52.093063] do_exit+0x9b5/0x1ad0 [ 52.096480] ? kvfree+0x3b/0x60 [ 52.099725] ? mm_update_next_owner+0x930/0x930 [ 52.104355] ? find_held_lock+0x35/0x1d0 [ 52.108383] ? handle_mm_fault+0x248/0x8d0 [ 52.112584] ? find_held_lock+0x35/0x1d0 [ 52.116613] ? __do_page_fault+0x64c/0xd60 [ 52.120827] ? lock_downgrade+0x990/0x990 [ 52.124940] ? handle_mm_fault+0x410/0x8d0 [ 52.129137] ? __do_page_fault+0x31e/0xd60 [ 52.133336] ? __handle_mm_fault+0x39c0/0x39c0 [ 52.137880] ? vmacache_find+0x5f/0x280 [ 52.141819] ? up_read+0x1a/0x40 [ 52.145150] ? __do_page_fault+0x3d6/0xd60 [ 52.149352] ? mm_fault_error+0x2c0/0x2c0 [ 52.153466] ? do_vfs_ioctl+0x486/0x1520 [ 52.157496] ? do_page_fault+0xee/0x720 [ 52.161436] ? __do_page_fault+0xd60/0xd60 [ 52.165635] ? putname+0xf3/0x130 [ 52.169058] do_group_exit+0x149/0x400 [ 52.172908] ? SyS_exit+0x30/0x30 [ 52.176328] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.181309] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.186029] SyS_exit_group+0x1d/0x20 [ 52.189795] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.194515] RIP: 0033:0x444eb9 [ 52.197668] RSP: 002b:00007ffe95da0258 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 52.205340] RAX: ffffffffffffffda RBX: 00007ffe95da02a0 RCX: 0000000000444eb9 [ 52.212575] RDX: 0000000000444eb9 RSI: 0000000020ca5fd8 RDI: 0000000000000001 [ 52.219812] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffe95da02a0 [ 52.227045] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402200 [ 52.234281] R13: 0000000000402290 R14: 0000000000000000 R15: 0000000000000000