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.14' (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: [ 43.346307] ================================================================== [ 43.353718] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 43.360441] Write of size 8 at addr ffff8801cd1f3780 by task syzkaller592101/2982 [ 43.368026] [ 43.369625] CPU: 1 PID: 2982 Comm: syzkaller592101 Not tainted 4.13.0-next-20170905+ #15 [ 43.377819] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.387144] Call Trace: [ 43.389719] dump_stack+0x194/0x257 [ 43.393319] ? arch_local_irq_restore+0x53/0x53 [ 43.397960] ? show_regs_print_info+0x65/0x65 [ 43.402431] ? lock_timer_base+0x1a3/0x2b0 [ 43.406638] ? detach_if_pending+0x557/0x610 [ 43.411020] print_address_description+0x73/0x250 [ 43.415829] ? detach_if_pending+0x557/0x610 [ 43.420206] kasan_report+0x24e/0x340 [ 43.423981] __asan_report_store8_noabort+0x17/0x20 [ 43.428965] detach_if_pending+0x557/0x610 [ 43.433172] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.438333] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.442972] ? lock_timer_base+0x1a3/0x2b0 [ 43.447178] ? lock_timer_base+0x1eb/0x2b0 [ 43.451387] ? __internal_add_timer+0x2d0/0x2d0 [ 43.456027] ? trace_hardirqs_on+0xd/0x10 [ 43.460155] try_to_del_timer_sync+0xa2/0x120 [ 43.464621] ? del_timer+0x130/0x130 [ 43.468308] ? del_timer_sync+0xeb/0x240 [ 43.472356] del_timer_sync+0x18a/0x240 [ 43.476306] tun_free_netdev+0x105/0x1b0 [ 43.480340] ? tun_xdp+0x410/0x410 [ 43.483861] ? cpumask_next+0x24/0x30 [ 43.487636] ? netdev_refcnt_read+0xed/0x150 [ 43.492019] ? tun_xdp+0x410/0x410 [ 43.495531] netdev_run_todo+0x870/0xca0 [ 43.499562] ? do_group_exit+0x149/0x400 [ 43.503599] ? register_netdev+0x30/0x30 [ 43.507632] ? lock_downgrade+0x990/0x990 [ 43.511748] ? trace_hardirqs_on+0xd/0x10 [ 43.515884] ? refcount_sub_and_test+0x115/0x1b0 [ 43.520611] ? refcount_inc+0x50/0x50 [ 43.524382] ? refcount_inc+0x50/0x50 [ 43.528161] ? sk_destruct+0x4c/0x80 [ 43.531845] ? __sk_free+0x5c/0x230 [ 43.535447] ? sk_free+0x2f/0x40 [ 43.538785] ? __tun_detach+0x176/0x1390 [ 43.542831] ? tun_attach+0xf90/0xf90 [ 43.546606] ? do_raw_spin_trylock+0x190/0x190 [ 43.551163] ? locks_remove_file+0x3fa/0x5a0 [ 43.555547] ? fcntl_setlk+0x10d0/0x10d0 [ 43.559584] ? __fsnotify_parent+0xb4/0x3a0 [ 43.563880] ? fsnotify+0x1af0/0x1af0 [ 43.567658] ? __tun_detach+0x1390/0x1390 [ 43.571782] ? __tun_detach+0x1390/0x1390 [ 43.575904] rtnl_unlock+0xe/0x10 [ 43.579326] tun_chr_close+0x49/0x60 [ 43.583011] __fput+0x333/0x7f0 [ 43.586268] ? fput+0x140/0x140 [ 43.589522] ? check_same_owner+0x320/0x320 [ 43.593815] ? _raw_spin_unlock_irq+0x27/0x70 [ 43.598289] ____fput+0x15/0x20 [ 43.601539] task_work_run+0x199/0x270 [ 43.605402] ? task_work_cancel+0x210/0x210 [ 43.609729] ? _raw_spin_unlock+0x22/0x30 [ 43.613853] ? switch_task_namespaces+0x87/0xc0 [ 43.618501] do_exit+0xa52/0x1b40 [ 43.621927] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.626917] ? check_noncircular+0x20/0x20 [ 43.631136] ? mm_update_next_owner+0x930/0x930 [ 43.635780] ? __pmd_alloc+0x4e0/0x4e0 [ 43.639648] ? find_held_lock+0x39/0x1d0 [ 43.643691] ? lock_downgrade+0x990/0x990 [ 43.647830] ? handle_mm_fault+0x4a2/0x860 [ 43.652038] ? down_read_trylock+0xdb/0x170 [ 43.656335] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.660889] ? vmacache_find+0x61/0x270 [ 43.664842] ? up_read+0x1a/0x40 [ 43.668183] ? __do_page_fault+0x35b/0xb60 [ 43.672384] ? do_vfs_ioctl+0x492/0x1530 [ 43.676434] ? do_page_fault+0xee/0x720 [ 43.680379] ? __do_page_fault+0xb60/0xb60 [ 43.684583] ? putname+0xf3/0x130 [ 43.688016] do_group_exit+0x149/0x400 [ 43.691891] ? lockdep_sys_exit+0x47/0xf0 [ 43.696012] ? SyS_exit+0x30/0x30 [ 43.699435] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.704421] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.709164] SyS_exit_group+0x1d/0x20 [ 43.712938] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.717662] RIP: 0033:0x4436a8 [ 43.720825] RSP: 002b:00007ffc4a73eaf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 43.728507] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004436a8 [ 43.735749] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 43.743003] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 43.750244] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 43.757495] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 43.764760] [ 43.766359] Allocated by task 2982: [ 43.769960] save_stack_trace+0x16/0x20 [ 43.773902] save_stack+0x43/0xd0 [ 43.777324] kasan_kmalloc+0xad/0xe0 [ 43.781015] __kmalloc_node+0x47/0x70 [ 43.784788] kvmalloc_node+0x64/0xd0 [ 43.788474] alloc_netdev_mqs+0x16e/0xed0 [ 43.792594] __tun_chr_ioctl+0x12be/0x3d20 [ 43.796796] tun_chr_ioctl+0x2a/0x40 [ 43.800479] do_vfs_ioctl+0x1b1/0x1530 [ 43.804335] SyS_ioctl+0x8f/0xc0 [ 43.807681] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.812401] [ 43.813997] Freed by task 2982: [ 43.817244] save_stack_trace+0x16/0x20 [ 43.821188] save_stack+0x43/0xd0 [ 43.824609] kasan_slab_free+0x71/0xc0 [ 43.828462] kfree+0xca/0x250 [ 43.831545] kvfree+0x36/0x60 [ 43.834623] free_netdev+0x2cf/0x360 [ 43.838305] __tun_chr_ioctl+0x2cf6/0x3d20 [ 43.842508] tun_chr_ioctl+0x2a/0x40 [ 43.846189] do_vfs_ioctl+0x1b1/0x1530 [ 43.850045] SyS_ioctl+0x8f/0xc0 [ 43.853383] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.858105] [ 43.859702] The buggy address belongs to the object at ffff8801cd1f0380 [ 43.859702] which belongs to the cache kmalloc-16384 of size 16384 [ 43.872692] The buggy address is located 13312 bytes inside of [ 43.872692] 16384-byte region [ffff8801cd1f0380, ffff8801cd1f4380) [ 43.884888] The buggy address belongs to the page: [ 43.889789] page:ffffea0007347c00 count:1 mapcount:0 mapping:ffff8801cd1f0380 index:0x0 compound_mapcount: 0 [ 43.899735] flags: 0x200000000008100(slab|head) [ 43.904387] raw: 0200000000008100 ffff8801cd1f0380 0000000000000000 0000000100000001 [ 43.912238] raw: ffffea0007355e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 43.920085] page dumped because: kasan: bad access detected [ 43.925766] [ 43.927363] Memory state around the buggy address: [ 43.932262] ffff8801cd1f3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.939590] ffff8801cd1f3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.946919] >ffff8801cd1f3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.954247] ^ [ 43.957581] ffff8801cd1f3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.964908] ffff8801cd1f3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.972239] ================================================================== [ 43.979565] Disabling lock debugging due to kernel taint [ 43.984976] Kernel panic - not syncing: panic_on_warn set ... [ 43.984976] [ 43.992302] CPU: 1 PID: 2982 Comm: syzkaller592101 Tainted: G B 4.13.0-next-20170905+ #15 [ 44.001706] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 44.011030] Call Trace: [ 44.013583] dump_stack+0x194/0x257 [ 44.017185] ? arch_local_irq_restore+0x53/0x53 [ 44.021818] ? vprintk_default+0x28/0x30 [ 44.025844] ? detach_if_pending+0x530/0x610 [ 44.030220] panic+0x1e4/0x417 [ 44.033391] ? __warn+0x1d9/0x1d9 [ 44.036814] ? detach_if_pending+0x557/0x610 [ 44.041188] kasan_end_report+0x50/0x50 [ 44.045125] kasan_report+0x137/0x340 [ 44.048901] __asan_report_store8_noabort+0x17/0x20 [ 44.053881] detach_if_pending+0x557/0x610 [ 44.058078] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.063233] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.067862] ? lock_timer_base+0x1a3/0x2b0 [ 44.072063] ? lock_timer_base+0x1eb/0x2b0 [ 44.076263] ? __internal_add_timer+0x2d0/0x2d0 [ 44.080898] ? trace_hardirqs_on+0xd/0x10 [ 44.085015] try_to_del_timer_sync+0xa2/0x120 [ 44.089474] ? del_timer+0x130/0x130 [ 44.093151] ? del_timer_sync+0xeb/0x240 [ 44.097182] del_timer_sync+0x18a/0x240 [ 44.101136] tun_free_netdev+0x105/0x1b0 [ 44.105159] ? tun_xdp+0x410/0x410 [ 44.108661] ? cpumask_next+0x24/0x30 [ 44.112430] ? netdev_refcnt_read+0xed/0x150 [ 44.116903] ? tun_xdp+0x410/0x410 [ 44.120408] netdev_run_todo+0x870/0xca0 [ 44.124433] ? do_group_exit+0x149/0x400 [ 44.128457] ? register_netdev+0x30/0x30 [ 44.132484] ? lock_downgrade+0x990/0x990 [ 44.136596] ? trace_hardirqs_on+0xd/0x10 [ 44.140717] ? refcount_sub_and_test+0x115/0x1b0 [ 44.145440] ? refcount_inc+0x50/0x50 [ 44.149205] ? refcount_inc+0x50/0x50 [ 44.152970] ? sk_destruct+0x4c/0x80 [ 44.156644] ? __sk_free+0x5c/0x230 [ 44.160235] ? sk_free+0x2f/0x40 [ 44.163565] ? __tun_detach+0x176/0x1390 [ 44.167608] ? tun_attach+0xf90/0xf90 [ 44.171376] ? do_raw_spin_trylock+0x190/0x190 [ 44.175934] ? locks_remove_file+0x3fa/0x5a0 [ 44.180315] ? fcntl_setlk+0x10d0/0x10d0 [ 44.184345] ? __fsnotify_parent+0xb4/0x3a0 [ 44.188630] ? fsnotify+0x1af0/0x1af0 [ 44.192397] ? __tun_detach+0x1390/0x1390 [ 44.196511] ? __tun_detach+0x1390/0x1390 [ 44.200624] rtnl_unlock+0xe/0x10 [ 44.204041] tun_chr_close+0x49/0x60 [ 44.207717] __fput+0x333/0x7f0 [ 44.210961] ? fput+0x140/0x140 [ 44.214205] ? check_same_owner+0x320/0x320 [ 44.218488] ? _raw_spin_unlock_irq+0x27/0x70 [ 44.222951] ____fput+0x15/0x20 [ 44.226203] task_work_run+0x199/0x270 [ 44.230057] ? task_work_cancel+0x210/0x210 [ 44.234344] ? _raw_spin_unlock+0x22/0x30 [ 44.238471] ? switch_task_namespaces+0x87/0xc0 [ 44.243107] do_exit+0xa52/0x1b40 [ 44.246524] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.251503] ? check_noncircular+0x20/0x20 [ 44.255703] ? mm_update_next_owner+0x930/0x930 [ 44.260335] ? __pmd_alloc+0x4e0/0x4e0 [ 44.264191] ? find_held_lock+0x39/0x1d0 [ 44.268223] ? lock_downgrade+0x990/0x990 [ 44.272346] ? handle_mm_fault+0x4a2/0x860 [ 44.276542] ? down_read_trylock+0xdb/0x170 [ 44.280828] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.285376] ? vmacache_find+0x61/0x270 [ 44.289316] ? up_read+0x1a/0x40 [ 44.292649] ? __do_page_fault+0x35b/0xb60 [ 44.296847] ? do_vfs_ioctl+0x492/0x1530 [ 44.300878] ? do_page_fault+0xee/0x720 [ 44.304819] ? __do_page_fault+0xb60/0xb60 [ 44.309022] ? putname+0xf3/0x130 [ 44.312445] do_group_exit+0x149/0x400 [ 44.316315] ? lockdep_sys_exit+0x47/0xf0 [ 44.320428] ? SyS_exit+0x30/0x30 [ 44.323845] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.328824] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 44.333546] SyS_exit_group+0x1d/0x20 [ 44.337312] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.342030] RIP: 0033:0x4436a8