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-1,10.128.15.202' (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: [ 49.709241] ================================================================== [ 49.710370] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 49.711264] Write of size 8 at addr ffff8801ce7ab7c0 by task syzkaller799567/2986 [ 49.712310] [ 49.712545] CPU: 0 PID: 2986 Comm: syzkaller799567 Not tainted 4.13.0-next-20170905+ #15 [ 49.713640] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.714862] Call Trace: [ 49.715239] dump_stack+0x194/0x257 [ 49.715758] ? arch_local_irq_restore+0x53/0x53 [ 49.716382] ? show_regs_print_info+0x65/0x65 [ 49.716997] ? lock_timer_base+0x1a3/0x2b0 [ 49.717569] ? detach_if_pending+0x557/0x610 [ 49.718210] print_address_description+0x73/0x250 [ 49.718886] ? detach_if_pending+0x557/0x610 [ 49.719510] kasan_report+0x24e/0x340 [ 49.720046] __asan_report_store8_noabort+0x17/0x20 [ 49.720716] detach_if_pending+0x557/0x610 [ 49.721289] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.722031] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.722657] ? lock_timer_base+0x1a3/0x2b0 [ 49.723321] ? lock_timer_base+0x1eb/0x2b0 [ 49.723894] ? __internal_add_timer+0x2d0/0x2d0 [ 49.724526] ? trace_hardirqs_on+0xd/0x10 [ 49.725111] try_to_del_timer_sync+0xa2/0x120 [ 49.725743] ? del_timer+0x130/0x130 [ 49.726269] ? del_timer_sync+0xeb/0x240 [ 49.726823] del_timer_sync+0x18a/0x240 [ 49.727364] tun_free_netdev+0x105/0x1b0 [ 49.727913] ? tun_xdp+0x410/0x410 [ 49.728395] ? cpumask_next+0x24/0x30 [ 49.728915] ? netdev_refcnt_read+0xed/0x150 [ 49.730143] ? tun_xdp+0x410/0x410 [ 49.733662] netdev_run_todo+0x870/0xca0 [ 49.737695] ? do_group_exit+0x149/0x400 [ 49.741733] ? register_netdev+0x30/0x30 [ 49.745766] ? lock_downgrade+0x990/0x990 [ 49.749887] ? trace_hardirqs_on+0xd/0x10 [ 49.754026] ? refcount_sub_and_test+0x115/0x1b0 [ 49.758757] ? refcount_inc+0x50/0x50 [ 49.762533] ? refcount_inc+0x50/0x50 [ 49.766309] ? sk_destruct+0x4c/0x80 [ 49.769995] ? __sk_free+0x5c/0x230 [ 49.773594] ? sk_free+0x2f/0x40 [ 49.776932] ? __tun_detach+0x176/0x1390 [ 49.780974] ? tun_attach+0xf90/0xf90 [ 49.784767] ? locks_remove_file+0x3fa/0x5a0 [ 49.789153] ? fcntl_setlk+0x10d0/0x10d0 [ 49.793190] ? __fsnotify_parent+0xb4/0x3a0 [ 49.797486] ? fsnotify+0x1af0/0x1af0 [ 49.801259] ? __tun_detach+0x1390/0x1390 [ 49.805379] ? __tun_detach+0x1390/0x1390 [ 49.809498] rtnl_unlock+0xe/0x10 [ 49.812922] tun_chr_close+0x49/0x60 [ 49.816609] __fput+0x333/0x7f0 [ 49.819867] ? fput+0x140/0x140 [ 49.823121] ? check_same_owner+0x320/0x320 [ 49.827422] ____fput+0x15/0x20 [ 49.830682] task_work_run+0x199/0x270 [ 49.834560] ? task_work_cancel+0x210/0x210 [ 49.838860] ? free_nsproxy+0x185/0x1f0 [ 49.842826] ? switch_task_namespaces+0xa2/0xc0 [ 49.847478] do_exit+0xa52/0x1b40 [ 49.850912] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.855915] ? check_noncircular+0x20/0x20 [ 49.860137] ? mm_update_next_owner+0x930/0x930 [ 49.864798] ? __pmd_alloc+0x4e0/0x4e0 [ 49.868676] ? find_held_lock+0x39/0x1d0 [ 49.872731] ? lock_downgrade+0x990/0x990 [ 49.876892] ? handle_mm_fault+0x4a2/0x860 [ 49.881149] ? down_read_trylock+0xdb/0x170 [ 49.885452] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.890053] ? vmacache_find+0x61/0x270 [ 49.894005] ? vmacache_update+0xfe/0x130 [ 49.898137] ? up_read+0x1a/0x40 [ 49.901483] ? __do_page_fault+0x35b/0xb60 [ 49.905695] ? do_vfs_ioctl+0x492/0x1530 [ 49.909743] ? do_page_fault+0xee/0x720 [ 49.913698] ? __do_page_fault+0xb60/0xb60 [ 49.917911] ? putname+0xf3/0x130 [ 49.921344] do_group_exit+0x149/0x400 [ 49.925203] ? lockdep_sys_exit+0x47/0xf0 [ 49.929323] ? SyS_exit+0x30/0x30 [ 49.932792] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.937787] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.942523] SyS_exit_group+0x1d/0x20 [ 49.946297] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.951032] RIP: 0033:0x444d99 [ 49.954214] RSP: 002b:00007ffe83d47f38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 49.961899] RAX: ffffffffffffffda RBX: 00007ffe83d47f80 RCX: 0000000000444d99 [ 49.969149] RDX: 0000000000444d99 RSI: 0000000020002000 RDI: 0000000000000001 [ 49.976394] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffe83d47f80 [ 49.983641] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402140 [ 49.990894] R13: 00000000004021d0 R14: 0000000000000000 R15: 0000000000000000 [ 49.998155] [ 49.999756] Allocated by task 2986: [ 50.003356] save_stack_trace+0x16/0x20 [ 50.007302] save_stack+0x43/0xd0 [ 50.010724] kasan_kmalloc+0xad/0xe0 [ 50.014410] __kmalloc_node+0x47/0x70 [ 50.018185] kvmalloc_node+0x64/0xd0 [ 50.021870] alloc_netdev_mqs+0x16e/0xed0 [ 50.025989] __tun_chr_ioctl+0x12be/0x3d20 [ 50.030194] tun_chr_ioctl+0x2a/0x40 [ 50.033902] do_vfs_ioctl+0x1b1/0x1530 [ 50.037761] SyS_ioctl+0x8f/0xc0 [ 50.041100] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 50.045825] [ 50.047423] Freed by task 2986: [ 50.050680] save_stack_trace+0x16/0x20 [ 50.054628] save_stack+0x43/0xd0 [ 50.058051] kasan_slab_free+0x71/0xc0 [ 50.061910] kfree+0xca/0x250 [ 50.065004] kvfree+0x36/0x60 [ 50.068086] free_netdev+0x2cf/0x360 [ 50.071773] __tun_chr_ioctl+0x2cf6/0x3d20 [ 50.075979] tun_chr_ioctl+0x2a/0x40 [ 50.079676] do_vfs_ioctl+0x1b1/0x1530 [ 50.083748] SyS_ioctl+0x8f/0xc0 [ 50.087096] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 50.091819] [ 50.093421] The buggy address belongs to the object at ffff8801ce7a83c0 [ 50.093421] which belongs to the cache kmalloc-16384 of size 16384 [ 50.106406] The buggy address is located 13312 bytes inside of [ 50.106406] 16384-byte region [ffff8801ce7a83c0, ffff8801ce7ac3c0) [ 50.118611] The buggy address belongs to the page: [ 50.123519] page:ffffea000739ea00 count:1 mapcount:0 mapping:ffff8801ce7a83c0 index:0x0 compound_mapcount: 0 [ 50.133476] flags: 0x200000000008100(slab|head) [ 50.138122] raw: 0200000000008100 ffff8801ce7a83c0 0000000000000000 0000000100000001 [ 50.145973] raw: ffffea0007352e20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 50.153825] page dumped because: kasan: bad access detected [ 50.159504] [ 50.161105] Memory state around the buggy address: [ 50.166003] ffff8801ce7ab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.173334] ffff8801ce7ab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.180663] >ffff8801ce7ab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.187994] ^ [ 50.193446] ffff8801ce7ab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.200794] ffff8801ce7ab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 50.208132] ================================================================== [ 50.215461] Disabling lock debugging due to kernel taint [ 50.220875] Kernel panic - not syncing: panic_on_warn set ... [ 50.220875] [ 50.228203] CPU: 0 PID: 2986 Comm: syzkaller799567 Tainted: G B 4.13.0-next-20170905+ #15 [ 50.237610] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 50.246931] Call Trace: [ 50.249489] dump_stack+0x194/0x257 [ 50.253084] ? arch_local_irq_restore+0x53/0x53 [ 50.257728] ? vprintk_default+0x28/0x30 [ 50.261758] ? detach_if_pending+0x530/0x610 [ 50.266132] panic+0x1e4/0x417 [ 50.269288] ? __warn+0x1d9/0x1d9 [ 50.272720] ? detach_if_pending+0x557/0x610 [ 50.277098] kasan_end_report+0x50/0x50 [ 50.281041] kasan_report+0x137/0x340 [ 50.284810] __asan_report_store8_noabort+0x17/0x20 [ 50.289793] detach_if_pending+0x557/0x610 [ 50.294003] ? trace_raw_output_tick_stop+0x130/0x130 [ 50.299164] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 50.303800] ? lock_timer_base+0x1a3/0x2b0 [ 50.308010] ? lock_timer_base+0x1eb/0x2b0 [ 50.312213] ? __internal_add_timer+0x2d0/0x2d0 [ 50.316852] ? trace_hardirqs_on+0xd/0x10 [ 50.320970] try_to_del_timer_sync+0xa2/0x120 [ 50.325432] ? del_timer+0x130/0x130 [ 50.329113] ? del_timer_sync+0xeb/0x240 [ 50.333142] del_timer_sync+0x18a/0x240 [ 50.337094] tun_free_netdev+0x105/0x1b0 [ 50.341121] ? tun_xdp+0x410/0x410 [ 50.344626] ? cpumask_next+0x24/0x30 [ 50.348393] ? netdev_refcnt_read+0xed/0x150 [ 50.352776] ? tun_xdp+0x410/0x410 [ 50.356286] netdev_run_todo+0x870/0xca0 [ 50.360314] ? do_group_exit+0x149/0x400 [ 50.364343] ? register_netdev+0x30/0x30 [ 50.368381] ? lock_downgrade+0x990/0x990 [ 50.372498] ? trace_hardirqs_on+0xd/0x10 [ 50.376625] ? refcount_sub_and_test+0x115/0x1b0 [ 50.381346] ? refcount_inc+0x50/0x50 [ 50.385117] ? refcount_inc+0x50/0x50 [ 50.388887] ? sk_destruct+0x4c/0x80 [ 50.392568] ? __sk_free+0x5c/0x230 [ 50.396160] ? sk_free+0x2f/0x40 [ 50.399494] ? __tun_detach+0x176/0x1390 [ 50.403534] ? tun_attach+0xf90/0xf90 [ 50.407315] ? locks_remove_file+0x3fa/0x5a0 [ 50.411687] ? fcntl_setlk+0x10d0/0x10d0 [ 50.415718] ? __fsnotify_parent+0xb4/0x3a0 [ 50.420008] ? fsnotify+0x1af0/0x1af0 [ 50.423778] ? __tun_detach+0x1390/0x1390 [ 50.427892] ? __tun_detach+0x1390/0x1390 [ 50.432009] rtnl_unlock+0xe/0x10 [ 50.435432] tun_chr_close+0x49/0x60 [ 50.439113] __fput+0x333/0x7f0 [ 50.442364] ? fput+0x140/0x140 [ 50.445611] ? check_same_owner+0x320/0x320 [ 50.449903] ____fput+0x15/0x20 [ 50.453160] task_work_run+0x199/0x270 [ 50.457021] ? task_work_cancel+0x210/0x210 [ 50.461314] ? free_nsproxy+0x185/0x1f0 [ 50.465269] ? switch_task_namespaces+0xa2/0xc0 [ 50.469909] do_exit+0xa52/0x1b40 [ 50.473343] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 50.478341] ? check_noncircular+0x20/0x20 [ 50.482545] ? mm_update_next_owner+0x930/0x930 [ 50.487184] ? __pmd_alloc+0x4e0/0x4e0 [ 50.491047] ? find_held_lock+0x39/0x1d0 [ 50.495083] ? lock_downgrade+0x990/0x990 [ 50.499211] ? handle_mm_fault+0x4a2/0x860 [ 50.503416] ? down_read_trylock+0xdb/0x170 [ 50.507708] ? __handle_mm_fault+0x39c0/0x39c0 [ 50.512263] ? vmacache_find+0x61/0x270 [ 50.516208] ? vmacache_update+0xfe/0x130 [ 50.520334] ? up_read+0x1a/0x40 [ 50.523668] ? __do_page_fault+0x35b/0xb60 [ 50.527871] ? do_vfs_ioctl+0x492/0x1530 [ 50.531906] ? do_page_fault+0xee/0x720 [ 50.535851] ? __do_page_fault+0xb60/0xb60 [ 50.540054] ? putname+0xf3/0x130 [ 50.543478] do_group_exit+0x149/0x400 [ 50.547346] ? lockdep_sys_exit+0x47/0xf0 [ 50.551472] ? SyS_exit+0x30/0x30 [ 50.554896] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 50.559882] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 50.564607] SyS_exit_group+0x1d/0x20 [ 50.568378] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 50.573103] RIP: 0033:0x444d99 [ 50.576260] RSP: 002b:00007ffe83d47f38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 50.583936] RAX: ffffffffffffffda RBX: 00007ffe83d47f80 RCX: 0000000000444d99 [ 50.591179] RDX: 0000000000444d99 RSI: 0000000020002000 RDI: 0000000000000001 [ 50.598424] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffe83d47f80 [ 50.605682] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402140 [ 50.612932] R13: 00000000004021d0 R14: 0000000000000000 R15: 0000000000000000