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-next-kasan-gce-6,10.128.0.18' (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: [ 45.433415] ================================================================== [ 45.440852] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 45.447597] Write of size 8 at addr ffff8801ce05b780 by task syzkaller119593/2987 [ 45.455195] [ 45.456802] CPU: 0 PID: 2987 Comm: syzkaller119593 Not tainted 4.13.0-next-20170904+ #14 [ 45.465011] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 45.474347] Call Trace: [ 45.476913] dump_stack+0x194/0x257 [ 45.480520] ? arch_local_irq_restore+0x53/0x53 [ 45.485168] ? show_regs_print_info+0x65/0x65 [ 45.489646] ? lock_timer_base+0x1a3/0x2b0 [ 45.493862] ? detach_if_pending+0x557/0x610 [ 45.498250] print_address_description+0x73/0x250 [ 45.503074] ? detach_if_pending+0x557/0x610 [ 45.507461] kasan_report+0x24e/0x340 [ 45.511249] __asan_report_store8_noabort+0x17/0x20 [ 45.516282] detach_if_pending+0x557/0x610 [ 45.520512] ? trace_raw_output_tick_stop+0x130/0x130 [ 45.525691] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 45.530345] ? lock_timer_base+0x1a3/0x2b0 [ 45.534570] ? lock_timer_base+0x1eb/0x2b0 [ 45.538796] ? __internal_add_timer+0x2d0/0x2d0 [ 45.543449] ? trace_hardirqs_on+0xd/0x10 [ 45.547585] try_to_del_timer_sync+0xa2/0x120 [ 45.552059] ? del_timer+0x130/0x130 [ 45.555753] ? del_timer_sync+0xeb/0x240 [ 45.559802] del_timer_sync+0x18a/0x240 [ 45.563755] tun_free_netdev+0x105/0x1b0 [ 45.567799] ? tun_xdp+0x410/0x410 [ 45.571316] ? cpumask_next+0x24/0x30 [ 45.575095] ? netdev_refcnt_read+0xed/0x150 [ 45.579487] ? tun_xdp+0x410/0x410 [ 45.583004] netdev_run_todo+0x870/0xca0 [ 45.587043] ? do_group_exit+0x149/0x400 [ 45.591087] ? register_netdev+0x30/0x30 [ 45.595135] ? lock_downgrade+0x990/0x990 [ 45.599271] ? trace_hardirqs_on+0xd/0x10 [ 45.603431] ? refcount_sub_and_test+0x115/0x1b0 [ 45.608171] ? refcount_inc+0x50/0x50 [ 45.611950] ? refcount_inc+0x50/0x50 [ 45.615731] ? sk_destruct+0x4c/0x80 [ 45.619424] ? __sk_free+0x5c/0x230 [ 45.623031] ? sk_free+0x2f/0x40 [ 45.626374] ? __tun_detach+0x176/0x1390 [ 45.630423] ? tun_attach+0xf90/0xf90 [ 45.634215] ? locks_remove_file+0x3fa/0x5a0 [ 45.638603] ? fcntl_setlk+0x10d0/0x10d0 [ 45.642660] ? __fsnotify_parent+0xb4/0x3a0 [ 45.646978] ? fsnotify+0x1af0/0x1af0 [ 45.650758] ? rcu_note_context_switch+0x710/0x710 [ 45.655677] ? __tun_detach+0x1390/0x1390 [ 45.659807] ? __tun_detach+0x1390/0x1390 [ 45.663948] rtnl_unlock+0xe/0x10 [ 45.667396] tun_chr_close+0x49/0x60 [ 45.671087] __fput+0x333/0x7f0 [ 45.674350] ? fput+0x140/0x140 [ 45.677614] ? check_same_owner+0x320/0x320 [ 45.681918] ____fput+0x15/0x20 [ 45.685178] task_work_run+0x199/0x270 [ 45.689044] ? task_work_cancel+0x210/0x210 [ 45.693343] ? free_nsproxy+0x185/0x1f0 [ 45.697296] ? switch_task_namespaces+0xa2/0xc0 [ 45.701957] do_exit+0xa52/0x1b40 [ 45.705390] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.710386] ? trace_hardirqs_on+0xd/0x10 [ 45.714517] ? kvfree+0x3b/0x60 [ 45.717773] ? mm_update_next_owner+0x930/0x930 [ 45.722419] ? rtnl_unlock+0xe/0x10 [ 45.726022] ? __tun_chr_ioctl+0x27a/0x3d20 [ 45.730329] ? tun_chr_read_iter+0x1e0/0x1e0 [ 45.734731] ? lock_downgrade+0x990/0x990 [ 45.738880] ? check_same_owner+0x320/0x320 [ 45.743178] ? __handle_mm_fault+0x39c0/0x39c0 [ 45.747745] ? tun_chr_compat_ioctl+0x30/0x30 [ 45.752220] ? tun_chr_ioctl+0x2a/0x40 [ 45.756087] ? tun_chr_ioctl+0x2a/0x40 [ 45.760140] ? do_vfs_ioctl+0x492/0x1530 [ 45.764183] ? _cond_resched+0x14/0x30 [ 45.768058] ? ioctl_preallocate+0x2b0/0x2b0 [ 45.772450] ? selinux_capable+0x40/0x40 [ 45.776493] ? putname+0xf3/0x130 [ 45.779929] do_group_exit+0x149/0x400 [ 45.783794] ? SyS_exit+0x30/0x30 [ 45.787250] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 45.792246] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 45.796981] SyS_exit_group+0x1d/0x20 [ 45.800760] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.805498] RIP: 0033:0x445319 [ 45.808662] RSP: 002b:00007ffd04f3e7c8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 45.816347] RAX: ffffffffffffffda RBX: 00007ffd04f3e800 RCX: 0000000000445319 [ 45.823590] RDX: 0000000000445319 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 45.830834] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffd04f3e800 [ 45.838082] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402660 [ 45.845334] R13: 00000000004026f0 R14: 0000000000000000 R15: 0000000000000000 [ 45.852599] [ 45.854199] Allocated by task 2987: [ 45.857801] save_stack_trace+0x16/0x20 [ 45.861746] save_stack+0x43/0xd0 [ 45.865171] kasan_kmalloc+0xad/0xe0 [ 45.868858] __kmalloc_node+0x47/0x70 [ 45.872630] kvmalloc_node+0x64/0xd0 [ 45.876324] alloc_netdev_mqs+0x16e/0xed0 [ 45.880458] __tun_chr_ioctl+0x12be/0x3d20 [ 45.884665] tun_chr_ioctl+0x2a/0x40 [ 45.888362] do_vfs_ioctl+0x1b1/0x1530 [ 45.892222] SyS_ioctl+0x8f/0xc0 [ 45.895569] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.900301] [ 45.901903] Freed by task 2987: [ 45.905158] save_stack_trace+0x16/0x20 [ 45.909123] save_stack+0x43/0xd0 [ 45.912549] kasan_slab_free+0x71/0xc0 [ 45.916413] kfree+0xca/0x250 [ 45.919494] kvfree+0x36/0x60 [ 45.922575] free_netdev+0x2cf/0x360 [ 45.926263] __tun_chr_ioctl+0x2cf6/0x3d20 [ 45.930476] tun_chr_ioctl+0x2a/0x40 [ 45.934168] do_vfs_ioctl+0x1b1/0x1530 [ 45.938031] SyS_ioctl+0x8f/0xc0 [ 45.941372] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 45.946100] [ 45.947704] The buggy address belongs to the object at ffff8801ce058380 [ 45.947704] which belongs to the cache kmalloc-16384 of size 16384 [ 45.960688] The buggy address is located 13312 bytes inside of [ 45.960688] 16384-byte region [ffff8801ce058380, ffff8801ce05c380) [ 45.972891] The buggy address belongs to the page: [ 45.977802] page:ffffea0007381600 count:1 mapcount:0 mapping:ffff8801ce058380 index:0x0 compound_mapcount: 0 [ 45.987762] flags: 0x200000000008100(slab|head) [ 45.992415] raw: 0200000000008100 ffff8801ce058380 0000000000000000 0000000100000001 [ 46.000285] raw: ffffea0007355a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 46.008151] page dumped because: kasan: bad access detected [ 46.014014] [ 46.015616] Memory state around the buggy address: [ 46.020522] ffff8801ce05b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.027874] ffff8801ce05b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.035228] >ffff8801ce05b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.042570] ^ [ 46.045924] ffff8801ce05b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.053273] ffff8801ce05b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 46.060617] ================================================================== [ 46.067968] Disabling lock debugging due to kernel taint [ 46.073392] Kernel panic - not syncing: panic_on_warn set ... [ 46.073392] [ 46.080730] CPU: 0 PID: 2987 Comm: syzkaller119593 Tainted: G B 4.13.0-next-20170904+ #14 [ 46.090157] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 46.099498] Call Trace: [ 46.102065] dump_stack+0x194/0x257 [ 46.105674] ? arch_local_irq_restore+0x53/0x53 [ 46.110315] ? vprintk_default+0x28/0x30 [ 46.114349] ? detach_if_pending+0x4e0/0x610 [ 46.118736] panic+0x1e4/0x417 [ 46.121912] ? __warn+0x1d9/0x1d9 [ 46.125522] ? detach_if_pending+0x557/0x610 [ 46.129907] kasan_end_report+0x50/0x50 [ 46.133853] kasan_report+0x137/0x340 [ 46.137629] __asan_report_store8_noabort+0x17/0x20 [ 46.142624] detach_if_pending+0x557/0x610 [ 46.146834] ? trace_raw_output_tick_stop+0x130/0x130 [ 46.152769] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 46.157410] ? lock_timer_base+0x1a3/0x2b0 [ 46.161618] ? lock_timer_base+0x1eb/0x2b0 [ 46.165829] ? __internal_add_timer+0x2d0/0x2d0 [ 46.170476] ? trace_hardirqs_on+0xd/0x10 [ 46.174627] try_to_del_timer_sync+0xa2/0x120 [ 46.179125] ? del_timer+0x130/0x130 [ 46.182828] ? del_timer_sync+0xeb/0x240 [ 46.186878] del_timer_sync+0x18a/0x240 [ 46.190829] tun_free_netdev+0x105/0x1b0 [ 46.194873] ? tun_xdp+0x410/0x410 [ 46.198385] ? cpumask_next+0x24/0x30 [ 46.202160] ? netdev_refcnt_read+0xed/0x150 [ 46.206544] ? tun_xdp+0x410/0x410 [ 46.210068] netdev_run_todo+0x870/0xca0 [ 46.214100] ? do_group_exit+0x149/0x400 [ 46.218133] ? register_netdev+0x30/0x30 [ 46.222340] ? lock_downgrade+0x990/0x990 [ 46.226460] ? trace_hardirqs_on+0xd/0x10 [ 46.230588] ? refcount_sub_and_test+0x115/0x1b0 [ 46.235323] ? refcount_inc+0x50/0x50 [ 46.239094] ? refcount_inc+0x50/0x50 [ 46.242871] ? sk_destruct+0x4c/0x80 [ 46.246580] ? __sk_free+0x5c/0x230 [ 46.250185] ? sk_free+0x2f/0x40 [ 46.253528] ? __tun_detach+0x176/0x1390 [ 46.257584] ? tun_attach+0xf90/0xf90 [ 46.261377] ? locks_remove_file+0x3fa/0x5a0 [ 46.265770] ? fcntl_setlk+0x10d0/0x10d0 [ 46.269836] ? __fsnotify_parent+0xb4/0x3a0 [ 46.274136] ? fsnotify+0x1af0/0x1af0 [ 46.277924] ? rcu_note_context_switch+0x710/0x710 [ 46.282825] ? __tun_detach+0x1390/0x1390 [ 46.286942] ? __tun_detach+0x1390/0x1390 [ 46.291062] rtnl_unlock+0xe/0x10 [ 46.294490] tun_chr_close+0x49/0x60 [ 46.298181] __fput+0x333/0x7f0 [ 46.301436] ? fput+0x140/0x140 [ 46.304691] ? check_same_owner+0x320/0x320 [ 46.308993] ____fput+0x15/0x20 [ 46.312247] task_work_run+0x199/0x270 [ 46.316117] ? task_work_cancel+0x210/0x210 [ 46.320422] ? free_nsproxy+0x185/0x1f0 [ 46.324371] ? switch_task_namespaces+0xa2/0xc0 [ 46.329020] do_exit+0xa52/0x1b40 [ 46.332452] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.337446] ? trace_hardirqs_on+0xd/0x10 [ 46.341571] ? kvfree+0x3b/0x60 [ 46.344823] ? mm_update_next_owner+0x930/0x930 [ 46.349467] ? rtnl_unlock+0xe/0x10 [ 46.353071] ? __tun_chr_ioctl+0x27a/0x3d20 [ 46.357369] ? tun_chr_read_iter+0x1e0/0x1e0 [ 46.361763] ? lock_downgrade+0x990/0x990 [ 46.365897] ? check_same_owner+0x320/0x320 [ 46.370207] ? __handle_mm_fault+0x39c0/0x39c0 [ 46.374773] ? tun_chr_compat_ioctl+0x30/0x30 [ 46.379250] ? tun_chr_ioctl+0x2a/0x40 [ 46.383107] ? tun_chr_ioctl+0x2a/0x40 [ 46.386983] ? do_vfs_ioctl+0x492/0x1530 [ 46.391021] ? _cond_resched+0x14/0x30 [ 46.394906] ? ioctl_preallocate+0x2b0/0x2b0 [ 46.399290] ? selinux_capable+0x40/0x40 [ 46.403330] ? putname+0xf3/0x130 [ 46.406764] do_group_exit+0x149/0x400 [ 46.410628] ? SyS_exit+0x30/0x30 [ 46.414055] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 46.419045] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 46.423796] SyS_exit_group+0x1d/0x20 [ 46.427570] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 46.432300] RIP: 0033:0x445319