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.0.21' (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: [ 26.491612] ================================================================== [ 26.492694] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 26.493594] Write of size 8 at addr ffff8801d06bb6f8 by task syzkaller616075/3004 [ 26.494589] [ 26.494847] CPU: 0 PID: 3004 Comm: syzkaller616075 Not tainted 4.13.0-rc6+ #45 [ 26.495843] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 26.497105] Call Trace: [ 26.497512] dump_stack+0x194/0x257 [ 26.498014] ? arch_local_irq_restore+0x53/0x53 [ 26.498674] ? show_regs_print_info+0x65/0x65 [ 26.499277] ? lock_timer_base+0x1a3/0x2b0 [ 26.499874] ? detach_if_pending+0x557/0x610 [ 26.500486] print_address_description+0x73/0x250 [ 26.501176] ? detach_if_pending+0x557/0x610 [ 26.501766] kasan_report+0x24e/0x340 [ 26.502296] __asan_report_store8_noabort+0x17/0x20 [ 26.502984] detach_if_pending+0x557/0x610 [ 26.503552] ? __next_timer_interrupt+0x150/0x150 [ 26.504196] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 26.504882] ? lock_timer_base+0x1a3/0x2b0 [ 26.505447] ? lock_timer_base+0x1eb/0x2b0 [ 26.506016] ? __internal_add_timer+0x2d0/0x2d0 [ 26.506672] ? lock_downgrade+0x990/0x990 [ 26.507250] try_to_del_timer_sync+0xa2/0x120 [ 26.507869] ? del_timer+0x130/0x130 [ 26.508386] ? del_timer_sync+0xeb/0x240 [ 26.508935] del_timer_sync+0x18a/0x240 [ 26.509505] tun_free_netdev+0x105/0x1b0 [ 26.510065] ? tun_show_group+0x170/0x170 [ 26.510622] ? netdev_refcnt_read+0xf4/0x160 [ 26.511295] ? tun_show_group+0x170/0x170 [ 26.511849] netdev_run_todo+0x870/0xca0 [ 26.515878] ? do_group_exit+0x149/0x400 [ 26.519914] ? mark_held_locks+0xaf/0x100 [ 26.524037] ? register_netdev+0x30/0x30 [ 26.528069] ? find_held_lock+0x35/0x1d0 [ 26.532106] ? lock_downgrade+0x990/0x990 [ 26.536229] ? refcount_sub_and_test+0x115/0x1b0 [ 26.540954] ? refcount_inc+0x50/0x50 [ 26.544719] ? refcount_inc+0x50/0x50 [ 26.548490] ? sk_destruct+0x4c/0x80 [ 26.552169] ? __sk_free+0x5c/0x230 [ 26.555763] ? sk_free+0x2f/0x40 [ 26.559097] ? __tun_detach+0x176/0x1390 [ 26.563134] ? tun_attach+0xfa0/0xfa0 [ 26.566913] ? locks_remove_file+0x414/0x560 [ 26.571288] ? fcntl_setlk+0x10c0/0x10c0 [ 26.575326] ? __fsnotify_parent+0xb4/0x3a0 [ 26.579615] ? fsnotify+0x1af0/0x1af0 [ 26.583388] ? __tun_detach+0x1390/0x1390 [ 26.587506] rtnl_unlock+0xe/0x10 [ 26.590926] tun_chr_close+0x49/0x60 [ 26.594606] __fput+0x327/0x7e0 [ 26.597879] ? fput+0x140/0x140 [ 26.601126] ? check_same_owner+0x320/0x320 [ 26.605423] ____fput+0x15/0x20 [ 26.608668] task_work_run+0x18a/0x260 [ 26.612525] ? task_work_cancel+0x210/0x210 [ 26.616818] ? free_nsproxy+0x185/0x1f0 [ 26.620761] ? switch_task_namespaces+0xa2/0xc0 [ 26.625400] do_exit+0xa3a/0x1b10 [ 26.628825] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.633810] ? trace_hardirqs_on+0xd/0x10 [ 26.637927] ? kvfree+0x3b/0x60 [ 26.641173] ? mm_update_next_owner+0x930/0x930 [ 26.645805] ? rtnl_unlock+0xe/0x10 [ 26.649412] ? __tun_chr_ioctl+0x27a/0x3d60 [ 26.653712] ? tun_select_queue+0x580/0x580 [ 26.658001] ? check_noncircular+0x20/0x20 [ 26.662219] ? get_unused_fd_flags+0x190/0x190 [ 26.666781] ? __handle_mm_fault+0x577/0x3860 [ 26.671240] ? check_noncircular+0x20/0x20 [ 26.675442] ? check_noncircular+0x20/0x20 [ 26.679639] ? __pmd_alloc+0x4e0/0x4e0 [ 26.683508] ? check_same_owner+0x320/0x320 [ 26.687795] ? handle_mm_fault+0x23e/0x860 [ 26.692171] ? tun_chr_compat_ioctl+0x30/0x30 [ 26.696633] ? tun_chr_ioctl+0x2a/0x40 [ 26.700490] ? tun_chr_ioctl+0x2a/0x40 [ 26.704353] ? do_vfs_ioctl+0x486/0x1520 [ 26.708386] ? ioctl_preallocate+0x2b0/0x2b0 [ 26.712767] ? selinux_capable+0x40/0x40 [ 26.716797] ? __handle_mm_fault+0x3860/0x3860 [ 26.721349] do_group_exit+0x149/0x400 [ 26.725214] ? SyS_exit+0x30/0x30 [ 26.728650] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 26.733634] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 26.738358] SyS_exit_group+0x1d/0x20 [ 26.742124] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.746845] RIP: 0033:0x445649 [ 26.750008] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 26.757681] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445649 [ 26.764919] RDX: 0000000000445649 RSI: 0000000020681000 RDI: 0000000000000001 [ 26.772156] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 26.779394] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402ca0 [ 26.786631] R13: 0000000000402d30 R14: 0000000000000000 R15: 0000000000000000 [ 26.793882] [ 26.795477] Allocated by task 3004: [ 26.799071] save_stack_trace+0x16/0x20 [ 26.803013] save_stack+0x43/0xd0 [ 26.806442] kasan_kmalloc+0xad/0xe0 [ 26.810120] __kmalloc_node+0x47/0x70 [ 26.813885] kvmalloc_node+0x64/0xd0 [ 26.817567] alloc_netdev_mqs+0x16e/0xed0 [ 26.821684] __tun_chr_ioctl+0x12b2/0x3d60 [ 26.825883] tun_chr_ioctl+0x2a/0x40 [ 26.829561] do_vfs_ioctl+0x1b1/0x1520 [ 26.833412] SyS_ioctl+0x8f/0xc0 [ 26.836747] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.841464] [ 26.843057] Freed by task 3004: [ 26.846302] save_stack_trace+0x16/0x20 [ 26.850243] save_stack+0x43/0xd0 [ 26.853660] kasan_slab_free+0x71/0xc0 [ 26.857512] kfree+0xca/0x250 [ 26.860585] kvfree+0x36/0x60 [ 26.863655] free_netdev+0x2cf/0x360 [ 26.867334] __tun_chr_ioctl+0x2d24/0x3d60 [ 26.871538] tun_chr_ioctl+0x2a/0x40 [ 26.875225] do_vfs_ioctl+0x1b1/0x1520 [ 26.879078] SyS_ioctl+0x8f/0xc0 [ 26.882409] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 26.887125] [ 26.888718] The buggy address belongs to the object at ffff8801d06b83c0 [ 26.888718] which belongs to the cache kmalloc-16384 of size 16384 [ 26.901692] The buggy address is located 13112 bytes inside of [ 26.901692] 16384-byte region [ffff8801d06b83c0, ffff8801d06bc3c0) [ 26.913879] The buggy address belongs to the page: [ 26.918774] page:ffffea000741ae00 count:1 mapcount:0 mapping:ffff8801d06b83c0 index:0x0 compound_mapcount: 0 [ 26.928714] flags: 0x200000000008100(slab|head) [ 26.933347] raw: 0200000000008100 ffff8801d06b83c0 0000000000000000 0000000100000001 [ 26.941192] raw: ffffea00073e2020 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 26.949037] page dumped because: kasan: bad access detected [ 26.954715] [ 26.956313] Memory state around the buggy address: [ 26.961228] ffff8801d06bb580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.968551] ffff8801d06bb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.975874] >ffff8801d06bb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.983197] ^ [ 26.990433] ffff8801d06bb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 26.997755] ffff8801d06bb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 27.005086] ================================================================== [ 27.012420] Disabling lock debugging due to kernel taint [ 27.017832] Kernel panic - not syncing: panic_on_warn set ... [ 27.017832] [ 27.025158] CPU: 0 PID: 3004 Comm: syzkaller616075 Tainted: G B 4.13.0-rc6+ #45 [ 27.033701] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 27.043019] Call Trace: [ 27.045574] dump_stack+0x194/0x257 [ 27.049169] ? arch_local_irq_restore+0x53/0x53 [ 27.053808] ? kasan_end_report+0x32/0x50 [ 27.057919] ? lock_downgrade+0x990/0x990 [ 27.062037] ? detach_if_pending+0x550/0x610 [ 27.066422] panic+0x1e4/0x417 [ 27.069580] ? __warn+0x1d9/0x1d9 [ 27.073002] ? detach_if_pending+0x557/0x610 [ 27.077374] kasan_end_report+0x50/0x50 [ 27.081311] kasan_report+0x137/0x340 [ 27.085085] __asan_report_store8_noabort+0x17/0x20 [ 27.090065] detach_if_pending+0x557/0x610 [ 27.094271] ? __next_timer_interrupt+0x150/0x150 [ 27.099077] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 27.103708] ? lock_timer_base+0x1a3/0x2b0 [ 27.107905] ? lock_timer_base+0x1eb/0x2b0 [ 27.112104] ? __internal_add_timer+0x2d0/0x2d0 [ 27.116750] ? lock_downgrade+0x990/0x990 [ 27.120876] try_to_del_timer_sync+0xa2/0x120 [ 27.125342] ? del_timer+0x130/0x130 [ 27.129028] ? del_timer_sync+0xeb/0x240 [ 27.133053] del_timer_sync+0x18a/0x240 [ 27.136993] tun_free_netdev+0x105/0x1b0 [ 27.141019] ? tun_show_group+0x170/0x170 [ 27.145132] ? netdev_refcnt_read+0xf4/0x160 [ 27.149509] ? tun_show_group+0x170/0x170 [ 27.153622] netdev_run_todo+0x870/0xca0 [ 27.157650] ? do_group_exit+0x149/0x400 [ 27.161679] ? mark_held_locks+0xaf/0x100 [ 27.165794] ? register_netdev+0x30/0x30 [ 27.169817] ? find_held_lock+0x35/0x1d0 [ 27.173845] ? lock_downgrade+0x990/0x990 [ 27.177959] ? refcount_sub_and_test+0x115/0x1b0 [ 27.182676] ? refcount_inc+0x50/0x50 [ 27.186442] ? refcount_inc+0x50/0x50 [ 27.190210] ? sk_destruct+0x4c/0x80 [ 27.193889] ? __sk_free+0x5c/0x230 [ 27.197478] ? sk_free+0x2f/0x40 [ 27.200807] ? __tun_detach+0x176/0x1390 [ 27.204841] ? tun_attach+0xfa0/0xfa0 [ 27.208616] ? locks_remove_file+0x414/0x560 [ 27.212986] ? fcntl_setlk+0x10c0/0x10c0 [ 27.217020] ? __fsnotify_parent+0xb4/0x3a0 [ 27.221319] ? fsnotify+0x1af0/0x1af0 [ 27.225091] ? __tun_detach+0x1390/0x1390 [ 27.229205] rtnl_unlock+0xe/0x10 [ 27.232662] tun_chr_close+0x49/0x60 [ 27.236342] __fput+0x327/0x7e0 [ 27.239590] ? fput+0x140/0x140 [ 27.242840] ? check_same_owner+0x320/0x320 [ 27.247130] ____fput+0x15/0x20 [ 27.250376] task_work_run+0x18a/0x260 [ 27.254228] ? task_work_cancel+0x210/0x210 [ 27.258510] ? free_nsproxy+0x185/0x1f0 [ 27.262454] ? switch_task_namespaces+0xa2/0xc0 [ 27.267134] do_exit+0xa3a/0x1b10 [ 27.270558] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.275538] ? trace_hardirqs_on+0xd/0x10 [ 27.279649] ? kvfree+0x3b/0x60 [ 27.282948] ? mm_update_next_owner+0x930/0x930 [ 27.287583] ? rtnl_unlock+0xe/0x10 [ 27.291178] ? __tun_chr_ioctl+0x27a/0x3d60 [ 27.295467] ? tun_select_queue+0x580/0x580 [ 27.299753] ? check_noncircular+0x20/0x20 [ 27.303949] ? get_unused_fd_flags+0x190/0x190 [ 27.308497] ? __handle_mm_fault+0x577/0x3860 [ 27.312972] ? check_noncircular+0x20/0x20 [ 27.317172] ? check_noncircular+0x20/0x20 [ 27.321368] ? __pmd_alloc+0x4e0/0x4e0 [ 27.325226] ? check_same_owner+0x320/0x320 [ 27.329515] ? handle_mm_fault+0x23e/0x860 [ 27.333716] ? tun_chr_compat_ioctl+0x30/0x30 [ 27.338178] ? tun_chr_ioctl+0x2a/0x40 [ 27.342032] ? tun_chr_ioctl+0x2a/0x40 [ 27.345887] ? do_vfs_ioctl+0x486/0x1520 [ 27.349914] ? ioctl_preallocate+0x2b0/0x2b0 [ 27.354294] ? selinux_capable+0x40/0x40 [ 27.358335] ? __handle_mm_fault+0x3860/0x3860 [ 27.362888] do_group_exit+0x149/0x400 [ 27.366742] ? SyS_exit+0x30/0x30 [ 27.370161] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 27.375151] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 27.379870] SyS_exit_group+0x1d/0x20 [ 27.383634] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 27.388351] RIP: 0033:0x445649 [ 27.391506] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 27.399179] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445649 [ 27.406415] RDX: 0000000000445649 RSI: 0000000020681000 RDI: 0000000000000001 [ 27.413647] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 27.420881] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402ca0 [ 27.428119] R13: 0000000000402d30 R14: 0000000000000000 R15: 0000000000000000