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-6,10.128.0.10' (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: [ 34.589263] ================================================================== [ 34.596694] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 34.603419] Write of size 8 at addr ffff8801ce59b740 by task syzkaller332419/2986 [ 34.611007] [ 34.612607] CPU: 0 PID: 2986 Comm: syzkaller332419 Not tainted 4.14.0-rc4+ #128 [ 34.620022] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.629349] Call Trace: [ 34.631911] dump_stack+0x194/0x257 [ 34.635514] ? arch_local_irq_restore+0x53/0x53 [ 34.640157] ? show_regs_print_info+0x65/0x65 [ 34.644629] ? lock_timer_base+0x1a3/0x2b0 [ 34.648840] ? detach_if_pending+0x557/0x610 [ 34.653221] print_address_description+0x73/0x250 [ 34.658035] ? detach_if_pending+0x557/0x610 [ 34.662413] kasan_report+0x25b/0x340 [ 34.666187] __asan_report_store8_noabort+0x17/0x20 [ 34.671175] detach_if_pending+0x557/0x610 [ 34.675382] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.680542] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.685179] ? lock_timer_base+0x1a3/0x2b0 [ 34.689384] ? lock_timer_base+0x1eb/0x2b0 [ 34.693596] ? __internal_add_timer+0x2d0/0x2d0 [ 34.698239] ? trace_hardirqs_on+0xd/0x10 [ 34.702364] try_to_del_timer_sync+0xa2/0x120 [ 34.706830] ? del_timer+0x130/0x130 [ 34.710517] ? del_timer_sync+0xeb/0x240 [ 34.714556] del_timer_sync+0x18a/0x240 [ 34.718503] tun_free_netdev+0x105/0x1b0 [ 34.722537] ? tun_xdp+0x410/0x410 [ 34.726047] ? cpumask_next+0x24/0x30 [ 34.729821] ? netdev_refcnt_read+0xed/0x150 [ 34.734202] ? tun_xdp+0x410/0x410 [ 34.737716] netdev_run_todo+0x870/0xca0 [ 34.741762] ? do_group_exit+0x149/0x400 [ 34.745804] ? register_netdev+0x30/0x30 [ 34.749840] ? lock_downgrade+0x990/0x990 [ 34.753957] ? trace_hardirqs_on+0xd/0x10 [ 34.758093] ? refcount_sub_and_test+0x115/0x1b0 [ 34.762823] ? refcount_inc+0x50/0x50 [ 34.766595] ? refcount_inc+0x50/0x50 [ 34.770371] ? sk_destruct+0x4c/0x80 [ 34.774054] ? __sk_free+0x5c/0x230 [ 34.777652] ? sk_free+0x2f/0x40 [ 34.780990] ? __tun_detach+0x176/0x1390 [ 34.785032] ? tun_attach+0xf90/0xf90 [ 34.788812] ? locks_remove_file+0x3fa/0x5a0 [ 34.793194] ? fcntl_setlk+0x10d0/0x10d0 [ 34.797229] ? __fsnotify_parent+0xb4/0x3a0 [ 34.801524] ? fsnotify+0x1af0/0x1af0 [ 34.805302] ? __tun_detach+0x1390/0x1390 [ 34.809424] rtnl_unlock+0xe/0x10 [ 34.812846] tun_chr_close+0x49/0x60 [ 34.816531] __fput+0x333/0x7f0 [ 34.819789] ? fput+0x140/0x140 [ 34.823039] ? check_same_owner+0x320/0x320 [ 34.827341] ____fput+0x15/0x20 [ 34.830591] task_work_run+0x199/0x270 [ 34.834451] ? task_work_cancel+0x210/0x210 [ 34.838743] ? free_nsproxy+0x185/0x1f0 [ 34.842690] ? switch_task_namespaces+0xa2/0xc0 [ 34.847332] do_exit+0x9d2/0x1af0 [ 34.850761] ? mm_update_next_owner+0x930/0x930 [ 34.855399] ? find_held_lock+0x39/0x1d0 [ 34.859439] ? lock_downgrade+0x990/0x990 [ 34.863580] ? handle_mm_fault+0x410/0x8d0 [ 34.867783] ? __do_page_fault+0x31e/0xd60 [ 34.871988] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.876539] ? vmacache_find+0x5f/0x280 [ 34.880491] ? up_read+0x1a/0x40 [ 34.883827] ? __do_page_fault+0x3d6/0xd60 [ 34.888038] ? mm_fault_error+0x2c0/0x2c0 [ 34.892158] ? do_vfs_ioctl+0x492/0x1530 [ 34.896197] ? do_page_fault+0xee/0x720 [ 34.900142] ? __do_page_fault+0xd60/0xd60 [ 34.904345] ? putname+0xf3/0x130 [ 34.908205] do_group_exit+0x149/0x400 [ 34.912066] ? lockdep_sys_exit+0x47/0xf0 [ 34.916183] ? SyS_exit+0x30/0x30 [ 34.919608] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.924596] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.929325] SyS_exit_group+0x1d/0x20 [ 34.933098] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.937831] RIP: 0033:0x444eb9 [ 34.940990] RSP: 002b:00007ffe763937c8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 34.948671] RAX: ffffffffffffffda RBX: 00007ffe76393810 RCX: 0000000000444eb9 [ 34.955916] RDX: 0000000000444eb9 RSI: 0000000020d5f000 RDI: 0000000000000001 [ 34.963158] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffe76393810 [ 34.970395] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402200 [ 34.977639] R13: 0000000000402290 R14: 0000000000000000 R15: 0000000000000000 [ 34.984901] [ 34.986498] Allocated by task 2986: [ 34.990096] save_stack_trace+0x16/0x20 [ 34.994041] save_stack+0x43/0xd0 [ 34.997462] kasan_kmalloc+0xad/0xe0 [ 35.001143] __kmalloc_node+0x47/0x70 [ 35.004914] kvmalloc_node+0x64/0xd0 [ 35.008598] alloc_netdev_mqs+0x16e/0xed0 [ 35.012716] __tun_chr_ioctl+0x12be/0x3d20 [ 35.016917] tun_chr_ioctl+0x2a/0x40 [ 35.020599] do_vfs_ioctl+0x1b1/0x1530 [ 35.024455] SyS_ioctl+0x8f/0xc0 [ 35.027793] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.032513] [ 35.034110] Freed by task 2986: [ 35.037358] save_stack_trace+0x16/0x20 [ 35.041302] save_stack+0x43/0xd0 [ 35.044726] kasan_slab_free+0x71/0xc0 [ 35.048580] kfree+0xca/0x250 [ 35.051657] kvfree+0x36/0x60 [ 35.054734] free_netdev+0x2cf/0x360 [ 35.058417] __tun_chr_ioctl+0x2cf6/0x3d20 [ 35.062620] tun_chr_ioctl+0x2a/0x40 [ 35.066302] do_vfs_ioctl+0x1b1/0x1530 [ 35.070156] SyS_ioctl+0x8f/0xc0 [ 35.073491] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.078211] [ 35.079809] The buggy address belongs to the object at ffff8801ce598340 [ 35.079809] which belongs to the cache kmalloc-16384 of size 16384 [ 35.092783] The buggy address is located 13312 bytes inside of [ 35.092783] 16384-byte region [ffff8801ce598340, ffff8801ce59c340) [ 35.104971] The buggy address belongs to the page: [ 35.109869] page:ffffea0007396600 count:1 mapcount:0 mapping:ffff8801ce598340 index:0x0 compound_mapcount: 0 [ 35.119812] flags: 0x200000000008100(slab|head) [ 35.124451] raw: 0200000000008100 ffff8801ce598340 0000000000000000 0000000100000001 [ 35.132300] raw: ffffea0007334020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.140146] page dumped because: kasan: bad access detected [ 35.145822] [ 35.147417] Memory state around the buggy address: [ 35.152312] ffff8801ce59b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.159638] ffff8801ce59b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.166964] >ffff8801ce59b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.174288] ^ [ 35.179704] ffff8801ce59b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.187032] ffff8801ce59b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.194356] ================================================================== [ 35.201680] Disabling lock debugging due to kernel taint [ 35.207093] Kernel panic - not syncing: panic_on_warn set ... [ 35.207093] [ 35.214419] CPU: 0 PID: 2986 Comm: syzkaller332419 Tainted: G B 4.14.0-rc4+ #128 [ 35.223041] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.232361] Call Trace: [ 35.234915] dump_stack+0x194/0x257 [ 35.238507] ? arch_local_irq_restore+0x53/0x53 [ 35.243141] ? vprintk_default+0x28/0x30 [ 35.247168] ? detach_if_pending+0x540/0x610 [ 35.251540] panic+0x1e4/0x417 [ 35.254697] ? __warn+0x1d9/0x1d9 [ 35.258120] ? detach_if_pending+0x557/0x610 [ 35.262497] kasan_end_report+0x50/0x50 [ 35.266433] kasan_report+0x144/0x340 [ 35.270201] __asan_report_store8_noabort+0x17/0x20 [ 35.275180] detach_if_pending+0x557/0x610 [ 35.279379] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.284531] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.289164] ? lock_timer_base+0x1a3/0x2b0 [ 35.293362] ? lock_timer_base+0x1eb/0x2b0 [ 35.297563] ? __internal_add_timer+0x2d0/0x2d0 [ 35.302197] ? trace_hardirqs_on+0xd/0x10 [ 35.306312] try_to_del_timer_sync+0xa2/0x120 [ 35.310771] ? del_timer+0x130/0x130 [ 35.314460] ? del_timer_sync+0xeb/0x240 [ 35.318489] del_timer_sync+0x18a/0x240 [ 35.322427] tun_free_netdev+0x105/0x1b0 [ 35.326452] ? tun_xdp+0x410/0x410 [ 35.329954] ? cpumask_next+0x24/0x30 [ 35.333719] ? netdev_refcnt_read+0xed/0x150 [ 35.338091] ? tun_xdp+0x410/0x410 [ 35.341596] netdev_run_todo+0x870/0xca0 [ 35.345619] ? do_group_exit+0x149/0x400 [ 35.349651] ? register_netdev+0x30/0x30 [ 35.353683] ? lock_downgrade+0x990/0x990 [ 35.357793] ? trace_hardirqs_on+0xd/0x10 [ 35.361914] ? refcount_sub_and_test+0x115/0x1b0 [ 35.366632] ? refcount_inc+0x50/0x50 [ 35.370394] ? refcount_inc+0x50/0x50 [ 35.374165] ? sk_destruct+0x4c/0x80 [ 35.377844] ? __sk_free+0x5c/0x230 [ 35.381434] ? sk_free+0x2f/0x40 [ 35.384763] ? __tun_detach+0x176/0x1390 [ 35.388806] ? tun_attach+0xf90/0xf90 [ 35.392577] ? locks_remove_file+0x3fa/0x5a0 [ 35.396951] ? fcntl_setlk+0x10d0/0x10d0 [ 35.400977] ? __fsnotify_parent+0xb4/0x3a0 [ 35.405261] ? fsnotify+0x1af0/0x1af0 [ 35.409028] ? __tun_detach+0x1390/0x1390 [ 35.413139] rtnl_unlock+0xe/0x10 [ 35.416555] tun_chr_close+0x49/0x60 [ 35.420234] __fput+0x333/0x7f0 [ 35.423490] ? fput+0x140/0x140 [ 35.426742] ? check_same_owner+0x320/0x320 [ 35.431028] ____fput+0x15/0x20 [ 35.434271] task_work_run+0x199/0x270 [ 35.438121] ? task_work_cancel+0x210/0x210 [ 35.442408] ? free_nsproxy+0x185/0x1f0 [ 35.446346] ? switch_task_namespaces+0xa2/0xc0 [ 35.450979] do_exit+0x9d2/0x1af0 [ 35.454399] ? mm_update_next_owner+0x930/0x930 [ 35.459031] ? find_held_lock+0x39/0x1d0 [ 35.463063] ? lock_downgrade+0x990/0x990 [ 35.467188] ? handle_mm_fault+0x410/0x8d0 [ 35.471386] ? __do_page_fault+0x31e/0xd60 [ 35.475583] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.480127] ? vmacache_find+0x5f/0x280 [ 35.484067] ? up_read+0x1a/0x40 [ 35.487397] ? __do_page_fault+0x3d6/0xd60 [ 35.491603] ? mm_fault_error+0x2c0/0x2c0 [ 35.495715] ? do_vfs_ioctl+0x492/0x1530 [ 35.499741] ? do_page_fault+0xee/0x720 [ 35.503680] ? __do_page_fault+0xd60/0xd60 [ 35.507878] ? putname+0xf3/0x130 [ 35.511298] do_group_exit+0x149/0x400 [ 35.515148] ? lockdep_sys_exit+0x47/0xf0 [ 35.519260] ? SyS_exit+0x30/0x30 [ 35.522676] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.527655] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.532376] SyS_exit_group+0x1d/0x20 [ 35.536141] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.540857] RIP: 0033:0x444eb9 [ 35.544010] RSP: 002b:00007ffe763937c8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 35.551680] RAX: ffffffffffffffda RBX: 00007ffe76393810 RCX: 0000000000444eb9 [ 35.558915] RDX: 0000000000444eb9 RSI: 0000000020d5f000 RDI: 0000000000000001 [ 35.566148] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffe76393810 [ 35.573380] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402200 [ 35.580616] R13: 0000000000402290 R14: 0000000000000000 R15: 0000000000000000