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-0,10.128.15.203' (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: [ 41.000470] ================================================================== [ 41.007964] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.014706] Write of size 8 at addr ffff8801cf10b780 by task syzkaller625420/2987 [ 41.022295] [ 41.023902] CPU: 1 PID: 2987 Comm: syzkaller625420 Not tainted 4.13.0+ #82 [ 41.030885] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.040209] Call Trace: [ 41.042774] dump_stack+0x194/0x257 [ 41.046377] ? arch_local_irq_restore+0x53/0x53 [ 41.051026] ? show_regs_print_info+0x65/0x65 [ 41.055503] ? lock_timer_base+0x1a3/0x2b0 [ 41.059711] ? detach_if_pending+0x557/0x610 [ 41.064093] print_address_description+0x73/0x250 [ 41.068908] ? detach_if_pending+0x557/0x610 [ 41.073289] kasan_report+0x24e/0x340 [ 41.077065] __asan_report_store8_noabort+0x17/0x20 [ 41.082050] detach_if_pending+0x557/0x610 [ 41.086259] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.091426] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.096064] ? lock_timer_base+0x1a3/0x2b0 [ 41.100272] ? lock_timer_base+0x1eb/0x2b0 [ 41.104482] ? __internal_add_timer+0x2d0/0x2d0 [ 41.109125] ? trace_hardirqs_on+0xd/0x10 [ 41.113253] try_to_del_timer_sync+0xa2/0x120 [ 41.117720] ? del_timer+0x130/0x130 [ 41.121412] ? del_timer_sync+0xeb/0x240 [ 41.125451] del_timer_sync+0x18a/0x240 [ 41.129404] tun_free_netdev+0x105/0x1b0 [ 41.133438] ? tun_xdp+0x410/0x410 [ 41.136955] ? cpumask_next+0x24/0x30 [ 41.140729] ? netdev_refcnt_read+0xed/0x150 [ 41.145113] ? tun_xdp+0x410/0x410 [ 41.148629] netdev_run_todo+0x870/0xca0 [ 41.152662] ? do_group_exit+0x149/0x400 [ 41.156699] ? register_netdev+0x30/0x30 [ 41.160747] ? lock_downgrade+0x990/0x990 [ 41.164868] ? trace_hardirqs_on+0xd/0x10 [ 41.169005] ? refcount_sub_and_test+0x115/0x1b0 [ 41.173733] ? refcount_inc+0x50/0x50 [ 41.177506] ? refcount_inc+0x50/0x50 [ 41.181283] ? sk_destruct+0x4c/0x80 [ 41.184967] ? __sk_free+0x5c/0x230 [ 41.188572] ? sk_free+0x2f/0x40 [ 41.191911] ? __tun_detach+0x176/0x1390 [ 41.195954] ? tun_attach+0xf90/0xf90 [ 41.199736] ? locks_remove_file+0x3fa/0x5a0 [ 41.204117] ? fcntl_setlk+0x10d0/0x10d0 [ 41.208155] ? __fsnotify_parent+0xb4/0x3a0 [ 41.212451] ? fsnotify+0x1af0/0x1af0 [ 41.216226] ? __tun_detach+0x1390/0x1390 [ 41.220346] ? __tun_detach+0x1390/0x1390 [ 41.224466] rtnl_unlock+0xe/0x10 [ 41.227899] tun_chr_close+0x49/0x60 [ 41.232723] __fput+0x333/0x7f0 [ 41.235980] ? fput+0x140/0x140 [ 41.239232] ? check_same_owner+0x320/0x320 [ 41.243533] ____fput+0x15/0x20 [ 41.246785] task_work_run+0x199/0x270 [ 41.250647] ? task_work_cancel+0x210/0x210 [ 41.254940] ? free_nsproxy+0x185/0x1f0 [ 41.258887] ? switch_task_namespaces+0xa2/0xc0 [ 41.263533] do_exit+0xa52/0x1b40 [ 41.266959] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.271949] ? check_noncircular+0x20/0x20 [ 41.276163] ? mm_update_next_owner+0x930/0x930 [ 41.280803] ? __pmd_alloc+0x4e0/0x4e0 [ 41.284933] ? find_held_lock+0x39/0x1d0 [ 41.288976] ? lock_downgrade+0x990/0x990 [ 41.293115] ? handle_mm_fault+0x410/0x8d0 [ 41.297318] ? down_read_trylock+0xdb/0x170 [ 41.301613] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.306166] ? vmacache_find+0x61/0x270 [ 41.310109] ? vmacache_update+0xfe/0x130 [ 41.314238] ? up_read+0x1a/0x40 [ 41.317583] ? __do_page_fault+0x35b/0xb60 [ 41.321791] ? do_vfs_ioctl+0x492/0x1530 [ 41.325837] ? do_page_fault+0xee/0x720 [ 41.329792] ? __do_page_fault+0xb60/0xb60 [ 41.334006] ? putname+0xf3/0x130 [ 41.337438] do_group_exit+0x149/0x400 [ 41.341303] ? lockdep_sys_exit+0x47/0xf0 [ 41.345429] ? SyS_exit+0x30/0x30 [ 41.348857] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.353848] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.358579] SyS_exit_group+0x1d/0x20 [ 41.362357] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.367095] RIP: 0033:0x445169 [ 41.370256] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 41.377939] RAX: ffffffffffffffda RBX: ff78959a035af43e RCX: 0000000000445169 [ 41.385185] RDX: 0000000000445169 RSI: 0000000020f5efd8 RDI: 0000000000000001 [ 41.392428] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 41.399669] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027c0 [ 41.406922] R13: 0000000000402850 R14: 0000000000000000 R15: 0000000000000000 [ 41.414187] [ 41.415789] Allocated by task 2987: [ 41.419395] save_stack_trace+0x16/0x20 [ 41.423345] save_stack+0x43/0xd0 [ 41.426767] kasan_kmalloc+0xad/0xe0 [ 41.430468] __kmalloc_node+0x47/0x70 [ 41.434242] kvmalloc_node+0x64/0xd0 [ 41.437930] alloc_netdev_mqs+0x16e/0xed0 [ 41.442049] __tun_chr_ioctl+0x12be/0x3d20 [ 41.446252] tun_chr_ioctl+0x2a/0x40 [ 41.449949] do_vfs_ioctl+0x1b1/0x1530 [ 41.453806] SyS_ioctl+0x8f/0xc0 [ 41.457145] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.461868] [ 41.463468] Freed by task 2987: [ 41.466721] save_stack_trace+0x16/0x20 [ 41.470668] save_stack+0x43/0xd0 [ 41.474092] kasan_slab_free+0x71/0xc0 [ 41.477951] kfree+0xca/0x250 [ 41.481029] kvfree+0x36/0x60 [ 41.484106] free_netdev+0x2cf/0x360 [ 41.487789] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.491991] tun_chr_ioctl+0x2a/0x40 [ 41.495678] do_vfs_ioctl+0x1b1/0x1530 [ 41.499536] SyS_ioctl+0x8f/0xc0 [ 41.502898] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.507627] [ 41.509230] The buggy address belongs to the object at ffff8801cf108380 [ 41.509230] which belongs to the cache kmalloc-16384 of size 16384 [ 41.522217] The buggy address is located 13312 bytes inside of [ 41.522217] 16384-byte region [ffff8801cf108380, ffff8801cf10c380) [ 41.534445] The buggy address belongs to the page: [ 41.539354] page:ffffea00073c4200 count:1 mapcount:0 mapping:ffff8801cf108380 index:0x0 compound_mapcount: 0 [ 41.549299] flags: 0x200000000008100(slab|head) [ 41.553940] raw: 0200000000008100 ffff8801cf108380 0000000000000000 0000000100000001 [ 41.561789] raw: ffffea0007366820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.569637] page dumped because: kasan: bad access detected [ 41.575315] [ 41.576912] Memory state around the buggy address: [ 41.581808] ffff8801cf10b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.589135] ffff8801cf10b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.596464] >ffff8801cf10b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.603789] ^ [ 41.607123] ffff8801cf10b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.614449] ffff8801cf10b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.621775] ================================================================== [ 41.629103] Disabling lock debugging due to kernel taint [ 41.634518] Kernel panic - not syncing: panic_on_warn set ... [ 41.634518] [ 41.641859] CPU: 1 PID: 2987 Comm: syzkaller625420 Tainted: G B 4.13.0+ #82 [ 41.650050] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.659370] Call Trace: [ 41.661930] dump_stack+0x194/0x257 [ 41.665534] ? arch_local_irq_restore+0x53/0x53 [ 41.670170] ? vprintk_default+0x28/0x30 [ 41.674199] ? detach_if_pending+0x550/0x610 [ 41.678576] panic+0x1e4/0x417 [ 41.681748] ? __warn+0x1d9/0x1d9 [ 41.685176] ? detach_if_pending+0x557/0x610 [ 41.689555] kasan_end_report+0x50/0x50 [ 41.693494] kasan_report+0x137/0x340 [ 41.697262] __asan_report_store8_noabort+0x17/0x20 [ 41.702243] detach_if_pending+0x557/0x610 [ 41.706448] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.711610] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.716243] ? lock_timer_base+0x1a3/0x2b0 [ 41.720452] ? lock_timer_base+0x1eb/0x2b0 [ 41.724664] ? __internal_add_timer+0x2d0/0x2d0 [ 41.729306] ? trace_hardirqs_on+0xd/0x10 [ 41.733425] try_to_del_timer_sync+0xa2/0x120 [ 41.737884] ? del_timer+0x130/0x130 [ 41.741565] ? del_timer_sync+0xeb/0x240 [ 41.745594] del_timer_sync+0x18a/0x240 [ 41.749537] tun_free_netdev+0x105/0x1b0 [ 41.753580] ? tun_xdp+0x410/0x410 [ 41.757088] ? cpumask_next+0x24/0x30 [ 41.760856] ? netdev_refcnt_read+0xed/0x150 [ 41.765229] ? tun_xdp+0x410/0x410 [ 41.768734] netdev_run_todo+0x870/0xca0 [ 41.772764] ? do_group_exit+0x149/0x400 [ 41.776792] ? register_netdev+0x30/0x30 [ 41.780822] ? lock_downgrade+0x990/0x990 [ 41.784936] ? trace_hardirqs_on+0xd/0x10 [ 41.789062] ? refcount_sub_and_test+0x115/0x1b0 [ 41.793786] ? refcount_inc+0x50/0x50 [ 41.797552] ? refcount_inc+0x50/0x50 [ 41.801321] ? sk_destruct+0x4c/0x80 [ 41.804997] ? __sk_free+0x5c/0x230 [ 41.808590] ? sk_free+0x2f/0x40 [ 41.811922] ? __tun_detach+0x176/0x1390 [ 41.815952] ? tun_attach+0xf90/0xf90 [ 41.819722] ? locks_remove_file+0x3fa/0x5a0 [ 41.824094] ? fcntl_setlk+0x10d0/0x10d0 [ 41.828124] ? __fsnotify_parent+0xb4/0x3a0 [ 41.832412] ? fsnotify+0x1af0/0x1af0 [ 41.836178] ? __tun_detach+0x1390/0x1390 [ 41.840289] ? __tun_detach+0x1390/0x1390 [ 41.844404] rtnl_unlock+0xe/0x10 [ 41.847821] tun_chr_close+0x49/0x60 [ 41.851501] __fput+0x333/0x7f0 [ 41.854749] ? fput+0x140/0x140 [ 41.857995] ? check_same_owner+0x320/0x320 [ 41.862284] ____fput+0x15/0x20 [ 41.865528] task_work_run+0x199/0x270 [ 41.869382] ? task_work_cancel+0x210/0x210 [ 41.873669] ? free_nsproxy+0x185/0x1f0 [ 41.877609] ? switch_task_namespaces+0xa2/0xc0 [ 41.882243] do_exit+0xa52/0x1b40 [ 41.885663] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.890645] ? check_noncircular+0x20/0x20 [ 41.894849] ? mm_update_next_owner+0x930/0x930 [ 41.899483] ? __pmd_alloc+0x4e0/0x4e0 [ 41.903340] ? find_held_lock+0x39/0x1d0 [ 41.907370] ? lock_downgrade+0x990/0x990 [ 41.911494] ? handle_mm_fault+0x410/0x8d0 [ 41.915697] ? down_read_trylock+0xdb/0x170 [ 41.919983] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.924531] ? vmacache_find+0x61/0x270 [ 41.928469] ? vmacache_update+0xfe/0x130 [ 41.932584] ? up_read+0x1a/0x40 [ 41.935919] ? __do_page_fault+0x35b/0xb60 [ 41.940119] ? do_vfs_ioctl+0x492/0x1530 [ 41.944147] ? do_page_fault+0xee/0x720 [ 41.948086] ? __do_page_fault+0xb60/0xb60 [ 41.952284] ? putname+0xf3/0x130 [ 41.955704] do_group_exit+0x149/0x400 [ 41.959558] ? lockdep_sys_exit+0x47/0xf0 [ 41.963669] ? SyS_exit+0x30/0x30 [ 41.967098] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.972083] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.976804] SyS_exit_group+0x1d/0x20 [ 41.980575] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.985298] RIP: 0033:0x445169 [ 41.988454] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 41.996126] RAX: ffffffffffffffda RBX: ff78959a035af43e RCX: 0000000000445169