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-7,10.128.15.209' (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: [ 42.995365] ================================================================== [ 43.002797] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 43.009531] Write of size 8 at addr ffff8801ce033780 by task syzkaller644945/2983 [ 43.017119] [ 43.018722] CPU: 1 PID: 2983 Comm: syzkaller644945 Not tainted 4.13.0-next-20170913+ #21 [ 43.026917] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.036240] Call Trace: [ 43.038804] dump_stack+0x194/0x257 [ 43.042408] ? arch_local_irq_restore+0x53/0x53 [ 43.047046] ? show_regs_print_info+0x65/0x65 [ 43.051512] ? lock_timer_base+0x1a3/0x2b0 [ 43.055717] ? detach_if_pending+0x557/0x610 [ 43.060098] print_address_description+0x73/0x250 [ 43.064912] ? detach_if_pending+0x557/0x610 [ 43.069291] kasan_report+0x24e/0x340 [ 43.073082] __asan_report_store8_noabort+0x17/0x20 [ 43.078068] detach_if_pending+0x557/0x610 [ 43.082283] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.087443] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.092089] ? lock_timer_base+0x1a3/0x2b0 [ 43.096293] ? lock_timer_base+0x1eb/0x2b0 [ 43.100501] ? __internal_add_timer+0x2d0/0x2d0 [ 43.105141] ? trace_hardirqs_on+0xd/0x10 [ 43.109273] try_to_del_timer_sync+0xa2/0x120 [ 43.113749] ? del_timer+0x130/0x130 [ 43.117434] ? del_timer_sync+0xeb/0x240 [ 43.121473] del_timer_sync+0x18a/0x240 [ 43.125419] tun_free_netdev+0x105/0x1b0 [ 43.129449] ? tun_xdp+0x410/0x410 [ 43.132957] ? cpumask_next+0x24/0x30 [ 43.136728] ? netdev_refcnt_read+0xed/0x150 [ 43.141109] ? tun_xdp+0x410/0x410 [ 43.144616] netdev_run_todo+0x870/0xca0 [ 43.148648] ? do_group_exit+0x149/0x400 [ 43.152688] ? register_netdev+0x30/0x30 [ 43.156723] ? lock_downgrade+0x990/0x990 [ 43.160845] ? trace_hardirqs_on+0xd/0x10 [ 43.164982] ? refcount_sub_and_test+0x115/0x1b0 [ 43.169709] ? refcount_inc+0x50/0x50 [ 43.173480] ? refcount_inc+0x50/0x50 [ 43.177257] ? sk_destruct+0x4c/0x80 [ 43.180941] ? __sk_free+0x5c/0x230 [ 43.184540] ? sk_free+0x2f/0x40 [ 43.187883] ? __tun_detach+0x176/0x1390 [ 43.191924] ? tun_attach+0xf90/0xf90 [ 43.195704] ? locks_remove_file+0x3fa/0x5a0 [ 43.200083] ? fcntl_setlk+0x10d0/0x10d0 [ 43.204117] ? __fsnotify_parent+0xb4/0x3a0 [ 43.208412] ? fsnotify+0x1af0/0x1af0 [ 43.212193] ? __tun_detach+0x1390/0x1390 [ 43.216312] ? __tun_detach+0x1390/0x1390 [ 43.220431] rtnl_unlock+0xe/0x10 [ 43.223853] tun_chr_close+0x49/0x60 [ 43.227540] __fput+0x333/0x7f0 [ 43.230796] ? fput+0x140/0x140 [ 43.234054] ? check_same_owner+0x320/0x320 [ 43.238355] ____fput+0x15/0x20 [ 43.241609] task_work_run+0x199/0x270 [ 43.245472] ? task_work_cancel+0x210/0x210 [ 43.249766] ? free_nsproxy+0x185/0x1f0 [ 43.253711] ? switch_task_namespaces+0xa2/0xc0 [ 43.258355] do_exit+0xa52/0x1b40 [ 43.261780] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.266773] ? check_noncircular+0x20/0x20 [ 43.270996] ? mm_update_next_owner+0x930/0x930 [ 43.275636] ? __pmd_alloc+0x4e0/0x4e0 [ 43.279504] ? find_held_lock+0x39/0x1d0 [ 43.283555] ? lock_downgrade+0x990/0x990 [ 43.287693] ? handle_mm_fault+0x410/0x8d0 [ 43.291897] ? down_read_trylock+0xdb/0x170 [ 43.296189] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.300740] ? vmacache_find+0x61/0x270 [ 43.304692] ? vmacache_update+0xfe/0x130 [ 43.308819] ? up_read+0x1a/0x40 [ 43.312158] ? __do_page_fault+0x35b/0xb60 [ 43.316365] ? do_vfs_ioctl+0x492/0x1530 [ 43.320404] ? do_page_fault+0xee/0x720 [ 43.324348] ? __do_page_fault+0xb60/0xb60 [ 43.328554] ? putname+0xf3/0x130 [ 43.331983] do_group_exit+0x149/0x400 [ 43.335851] ? lockdep_sys_exit+0x47/0xf0 [ 43.339969] ? SyS_exit+0x30/0x30 [ 43.343395] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.348381] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.353122] SyS_exit_group+0x1d/0x20 [ 43.356903] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.361627] RIP: 0033:0x445169 [ 43.364788] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 43.372470] RAX: ffffffffffffffda RBX: ff78959a035af43e RCX: 0000000000445169 [ 43.379711] RDX: 0000000000445169 RSI: 0000000020f5efd8 RDI: 0000000000000001 [ 43.386951] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 43.394189] R10: 0000000000000000 R11: 0000000000000206 R12: 00000000004027c0 [ 43.401431] R13: 0000000000402850 R14: 0000000000000000 R15: 0000000000000000 [ 43.408687] [ 43.410284] Allocated by task 2983: [ 43.413882] save_stack_trace+0x16/0x20 [ 43.417824] save_stack+0x43/0xd0 [ 43.421245] kasan_kmalloc+0xad/0xe0 [ 43.424926] __kmalloc_node+0x47/0x70 [ 43.428696] kvmalloc_node+0x64/0xd0 [ 43.432381] alloc_netdev_mqs+0x16e/0xed0 [ 43.436509] __tun_chr_ioctl+0x12be/0x3d20 [ 43.440712] tun_chr_ioctl+0x2a/0x40 [ 43.444394] do_vfs_ioctl+0x1b1/0x1530 [ 43.448251] SyS_ioctl+0x8f/0xc0 [ 43.451585] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.456307] [ 43.457905] Freed by task 2983: [ 43.461154] save_stack_trace+0x16/0x20 [ 43.465096] save_stack+0x43/0xd0 [ 43.468516] kasan_slab_free+0x71/0xc0 [ 43.472373] kfree+0xca/0x250 [ 43.475446] kvfree+0x36/0x60 [ 43.478518] free_netdev+0x2cf/0x360 [ 43.482206] __tun_chr_ioctl+0x2cf6/0x3d20 [ 43.486414] tun_chr_ioctl+0x2a/0x40 [ 43.490096] do_vfs_ioctl+0x1b1/0x1530 [ 43.493950] SyS_ioctl+0x8f/0xc0 [ 43.497285] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.502006] [ 43.503604] The buggy address belongs to the object at ffff8801ce030380 [ 43.503604] which belongs to the cache kmalloc-16384 of size 16384 [ 43.516575] The buggy address is located 13312 bytes inside of [ 43.516575] 16384-byte region [ffff8801ce030380, ffff8801ce034380) [ 43.528760] The buggy address belongs to the page: [ 43.533660] page:ffffea0007380c00 count:1 mapcount:0 mapping:ffff8801ce030380 index:0x0 compound_mapcount: 0 [ 43.543601] flags: 0x200000000008100(slab|head) [ 43.548239] raw: 0200000000008100 ffff8801ce030380 0000000000000000 0000000100000001 [ 43.556087] raw: ffffea0007382820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 43.563935] page dumped because: kasan: bad access detected [ 43.569611] [ 43.571207] Memory state around the buggy address: [ 43.576104] ffff8801ce033680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.583431] ffff8801ce033700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.590758] >ffff8801ce033780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.598084] ^ [ 43.601420] ffff8801ce033800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.608750] ffff8801ce033880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.616075] ================================================================== [ 43.623397] Disabling lock debugging due to kernel taint [ 43.628809] Kernel panic - not syncing: panic_on_warn set ... [ 43.628809] [ 43.636134] CPU: 1 PID: 2983 Comm: syzkaller644945 Tainted: G B 4.13.0-next-20170913+ #21 [ 43.645540] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.654857] Call Trace: [ 43.657411] dump_stack+0x194/0x257 [ 43.661005] ? arch_local_irq_restore+0x53/0x53 [ 43.665639] ? vprintk_default+0x28/0x30 [ 43.669667] ? detach_if_pending+0x540/0x610 [ 43.674040] panic+0x1e4/0x417 [ 43.677196] ? __warn+0x1d9/0x1d9 [ 43.680619] ? detach_if_pending+0x557/0x610 [ 43.684992] kasan_end_report+0x50/0x50 [ 43.688928] kasan_report+0x137/0x340 [ 43.692695] __asan_report_store8_noabort+0x17/0x20 [ 43.697672] detach_if_pending+0x557/0x610 [ 43.701878] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.707034] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.711664] ? lock_timer_base+0x1a3/0x2b0 [ 43.715860] ? lock_timer_base+0x1eb/0x2b0 [ 43.720061] ? __internal_add_timer+0x2d0/0x2d0 [ 43.724706] ? trace_hardirqs_on+0xd/0x10 [ 43.728828] try_to_del_timer_sync+0xa2/0x120 [ 43.733289] ? del_timer+0x130/0x130 [ 43.736966] ? del_timer_sync+0xeb/0x240 [ 43.740993] del_timer_sync+0x18a/0x240 [ 43.744931] tun_free_netdev+0x105/0x1b0 [ 43.748955] ? tun_xdp+0x410/0x410 [ 43.752459] ? cpumask_next+0x24/0x30 [ 43.756224] ? netdev_refcnt_read+0xed/0x150 [ 43.760601] ? tun_xdp+0x410/0x410 [ 43.764103] netdev_run_todo+0x870/0xca0 [ 43.768129] ? do_group_exit+0x149/0x400 [ 43.772155] ? register_netdev+0x30/0x30 [ 43.776182] ? lock_downgrade+0x990/0x990 [ 43.780292] ? trace_hardirqs_on+0xd/0x10 [ 43.784412] ? refcount_sub_and_test+0x115/0x1b0 [ 43.789130] ? refcount_inc+0x50/0x50 [ 43.792894] ? refcount_inc+0x50/0x50 [ 43.796671] ? sk_destruct+0x4c/0x80 [ 43.800352] ? __sk_free+0x5c/0x230 [ 43.803942] ? sk_free+0x2f/0x40 [ 43.807273] ? __tun_detach+0x176/0x1390 [ 43.811302] ? tun_attach+0xf90/0xf90 [ 43.815073] ? locks_remove_file+0x3fa/0x5a0 [ 43.819446] ? fcntl_setlk+0x10d0/0x10d0 [ 43.823473] ? __fsnotify_parent+0xb4/0x3a0 [ 43.827758] ? fsnotify+0x1af0/0x1af0 [ 43.831524] ? __tun_detach+0x1390/0x1390 [ 43.835633] ? __tun_detach+0x1390/0x1390 [ 43.839745] rtnl_unlock+0xe/0x10 [ 43.843159] tun_chr_close+0x49/0x60 [ 43.846835] __fput+0x333/0x7f0 [ 43.850079] ? fput+0x140/0x140 [ 43.853322] ? check_same_owner+0x320/0x320 [ 43.857610] ____fput+0x15/0x20 [ 43.860855] task_work_run+0x199/0x270 [ 43.864709] ? task_work_cancel+0x210/0x210 [ 43.868994] ? free_nsproxy+0x185/0x1f0 [ 43.872932] ? switch_task_namespaces+0xa2/0xc0 [ 43.877566] do_exit+0xa52/0x1b40 [ 43.880983] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.885963] ? check_noncircular+0x20/0x20 [ 43.890166] ? mm_update_next_owner+0x930/0x930 [ 43.894801] ? __pmd_alloc+0x4e0/0x4e0 [ 43.898656] ? find_held_lock+0x39/0x1d0 [ 43.902685] ? lock_downgrade+0x990/0x990 [ 43.906814] ? handle_mm_fault+0x410/0x8d0 [ 43.911012] ? down_read_trylock+0xdb/0x170 [ 43.915297] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.919844] ? vmacache_find+0x61/0x270 [ 43.923783] ? vmacache_update+0xfe/0x130 [ 43.927896] ? up_read+0x1a/0x40 [ 43.931227] ? __do_page_fault+0x35b/0xb60 [ 43.935425] ? do_vfs_ioctl+0x492/0x1530 [ 43.939453] ? do_page_fault+0xee/0x720 [ 43.943392] ? __do_page_fault+0xb60/0xb60 [ 43.947594] ? putname+0xf3/0x130 [ 43.951013] do_group_exit+0x149/0x400 [ 43.954863] ? lockdep_sys_exit+0x47/0xf0 [ 43.958974] ? SyS_exit+0x30/0x30 [ 43.962505] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.967500] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.972221] SyS_exit_group+0x1d/0x20 [ 43.975989] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.980707] RIP: 0033:0x445169 [ 43.983861] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 43.991531] RAX: ffffffffffffffda RBX: ff78959a035af43e RCX: 0000000000445169