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.215' (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: [ 41.364468] ================================================================== [ 41.371883] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.378606] Write of size 8 at addr ffff8801cdc83780 by task syzkaller238115/2984 [ 41.386192] [ 41.387793] CPU: 1 PID: 2984 Comm: syzkaller238115 Not tainted 4.13.0-next-20170913+ #21 [ 41.395986] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.405309] Call Trace: [ 41.407869] dump_stack+0x194/0x257 [ 41.411470] ? arch_local_irq_restore+0x53/0x53 [ 41.416111] ? show_regs_print_info+0x65/0x65 [ 41.420577] ? lock_timer_base+0x1a3/0x2b0 [ 41.424788] ? detach_if_pending+0x557/0x610 [ 41.429171] print_address_description+0x73/0x250 [ 41.433982] ? detach_if_pending+0x557/0x610 [ 41.438359] kasan_report+0x24e/0x340 [ 41.442134] __asan_report_store8_noabort+0x17/0x20 [ 41.447119] detach_if_pending+0x557/0x610 [ 41.451327] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.456491] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.461128] ? lock_timer_base+0x1a3/0x2b0 [ 41.465334] ? lock_timer_base+0x1eb/0x2b0 [ 41.469542] ? __internal_add_timer+0x2d0/0x2d0 [ 41.474184] ? trace_hardirqs_on+0xd/0x10 [ 41.478309] try_to_del_timer_sync+0xa2/0x120 [ 41.482775] ? del_timer+0x130/0x130 [ 41.486460] ? del_timer_sync+0xeb/0x240 [ 41.490502] del_timer_sync+0x18a/0x240 [ 41.494449] tun_free_netdev+0x105/0x1b0 [ 41.498486] ? tun_xdp+0x410/0x410 [ 41.501996] ? cpumask_next+0x24/0x30 [ 41.505772] ? netdev_refcnt_read+0xed/0x150 [ 41.510152] ? tun_xdp+0x410/0x410 [ 41.513662] netdev_run_todo+0x870/0xca0 [ 41.517692] ? do_group_exit+0x149/0x400 [ 41.521727] ? register_netdev+0x30/0x30 [ 41.525761] ? lock_downgrade+0x990/0x990 [ 41.529880] ? trace_hardirqs_on+0xd/0x10 [ 41.534013] ? refcount_sub_and_test+0x115/0x1b0 [ 41.538747] ? refcount_inc+0x50/0x50 [ 41.542525] ? refcount_inc+0x50/0x50 [ 41.546301] ? sk_destruct+0x4c/0x80 [ 41.549985] ? __sk_free+0x5c/0x230 [ 41.553584] ? sk_free+0x2f/0x40 [ 41.556924] ? __tun_detach+0x176/0x1390 [ 41.560966] ? tun_attach+0xf90/0xf90 [ 41.564749] ? locks_remove_file+0x3fa/0x5a0 [ 41.569132] ? fcntl_setlk+0x10d0/0x10d0 [ 41.573173] ? __fsnotify_parent+0xb4/0x3a0 [ 41.577466] ? fsnotify+0x1af0/0x1af0 [ 41.581246] ? __tun_detach+0x1390/0x1390 [ 41.585363] ? __tun_detach+0x1390/0x1390 [ 41.589482] rtnl_unlock+0xe/0x10 [ 41.592902] tun_chr_close+0x49/0x60 [ 41.596585] __fput+0x333/0x7f0 [ 41.599843] ? fput+0x140/0x140 [ 41.603098] ? check_same_owner+0x320/0x320 [ 41.607394] ____fput+0x15/0x20 [ 41.610642] task_work_run+0x199/0x270 [ 41.614502] ? task_work_cancel+0x210/0x210 [ 41.618794] ? free_nsproxy+0x185/0x1f0 [ 41.622737] ? switch_task_namespaces+0xa2/0xc0 [ 41.627383] do_exit+0xa52/0x1b40 [ 41.630806] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.635791] ? trace_hardirqs_on+0xd/0x10 [ 41.639915] ? kvfree+0x3b/0x60 [ 41.643165] ? mm_update_next_owner+0x930/0x930 [ 41.647802] ? rtnl_unlock+0xe/0x10 [ 41.651397] ? __tun_chr_ioctl+0x27a/0x3d20 [ 41.655702] ? tun_chr_read_iter+0x1e0/0x1e0 [ 41.660090] ? lock_downgrade+0x990/0x990 [ 41.664231] ? check_same_owner+0x320/0x320 [ 41.668521] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.673071] ? vmacache_find+0x61/0x270 [ 41.677015] ? tun_chr_compat_ioctl+0x30/0x30 [ 41.681476] ? tun_chr_ioctl+0x2a/0x40 [ 41.685332] ? tun_chr_ioctl+0x2a/0x40 [ 41.689194] ? do_vfs_ioctl+0x492/0x1530 [ 41.693227] ? ioctl_preallocate+0x2b0/0x2b0 [ 41.697608] ? selinux_capable+0x40/0x40 [ 41.701647] ? putname+0xf3/0x130 [ 41.705075] do_group_exit+0x149/0x400 [ 41.708933] ? SyS_exit+0x30/0x30 [ 41.712356] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.717342] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.722070] SyS_exit_group+0x1d/0x20 [ 41.725842] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.730565] RIP: 0033:0x445569 [ 41.733725] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 41.741406] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569 [ 41.748644] RDX: 0000000000445569 RSI: 0000000020511fd8 RDI: 0000000000000001 [ 41.755883] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 41.763121] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bc0 [ 41.770358] R13: 0000000000402c50 R14: 0000000000000000 R15: 0000000000000000 [ 41.777615] [ 41.779213] Allocated by task 2984: [ 41.782811] save_stack_trace+0x16/0x20 [ 41.786757] save_stack+0x43/0xd0 [ 41.790177] kasan_kmalloc+0xad/0xe0 [ 41.793859] __kmalloc_node+0x47/0x70 [ 41.797634] kvmalloc_node+0x64/0xd0 [ 41.801318] alloc_netdev_mqs+0x16e/0xed0 [ 41.805434] __tun_chr_ioctl+0x12be/0x3d20 [ 41.809633] tun_chr_ioctl+0x2a/0x40 [ 41.813315] do_vfs_ioctl+0x1b1/0x1530 [ 41.817168] SyS_ioctl+0x8f/0xc0 [ 41.820502] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.825223] [ 41.826818] Freed by task 2984: [ 41.830072] save_stack_trace+0x16/0x20 [ 41.834013] save_stack+0x43/0xd0 [ 41.837431] kasan_slab_free+0x71/0xc0 [ 41.841284] kfree+0xca/0x250 [ 41.844358] kvfree+0x36/0x60 [ 41.847432] free_netdev+0x2cf/0x360 [ 41.851111] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.855313] tun_chr_ioctl+0x2a/0x40 [ 41.858993] do_vfs_ioctl+0x1b1/0x1530 [ 41.862848] SyS_ioctl+0x8f/0xc0 [ 41.866181] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.870902] [ 41.872498] The buggy address belongs to the object at ffff8801cdc80380 [ 41.872498] which belongs to the cache kmalloc-16384 of size 16384 [ 41.885468] The buggy address is located 13312 bytes inside of [ 41.885468] 16384-byte region [ffff8801cdc80380, ffff8801cdc84380) [ 41.897656] The buggy address belongs to the page: [ 41.902554] page:ffffea0007372000 count:1 mapcount:0 mapping:ffff8801cdc80380 index:0x0 compound_mapcount: 0 [ 41.912495] flags: 0x200000000008100(slab|head) [ 41.917134] raw: 0200000000008100 ffff8801cdc80380 0000000000000000 0000000100000001 [ 41.924982] raw: ffffea0007370220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.932834] page dumped because: kasan: bad access detected [ 41.938513] [ 41.940112] Memory state around the buggy address: [ 41.945007] ffff8801cdc83680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.952332] ffff8801cdc83700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.959660] >ffff8801cdc83780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.966991] ^ [ 41.970323] ffff8801cdc83800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.977649] ffff8801cdc83880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.984977] ================================================================== [ 41.992301] Disabling lock debugging due to kernel taint [ 41.997710] Kernel panic - not syncing: panic_on_warn set ... [ 41.997710] [ 42.005035] CPU: 1 PID: 2984 Comm: syzkaller238115 Tainted: G B 4.13.0-next-20170913+ #21 [ 42.014440] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.023759] Call Trace: [ 42.026313] dump_stack+0x194/0x257 [ 42.029906] ? arch_local_irq_restore+0x53/0x53 [ 42.034540] ? vprintk_default+0x28/0x30 [ 42.038567] ? detach_if_pending+0x540/0x610 [ 42.042940] panic+0x1e4/0x417 [ 42.046095] ? __warn+0x1d9/0x1d9 [ 42.049516] ? detach_if_pending+0x557/0x610 [ 42.053886] kasan_end_report+0x50/0x50 [ 42.057825] kasan_report+0x137/0x340 [ 42.061591] __asan_report_store8_noabort+0x17/0x20 [ 42.066567] detach_if_pending+0x557/0x610 [ 42.070765] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.075926] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.080564] ? lock_timer_base+0x1a3/0x2b0 [ 42.084763] ? lock_timer_base+0x1eb/0x2b0 [ 42.088961] ? __internal_add_timer+0x2d0/0x2d0 [ 42.093593] ? trace_hardirqs_on+0xd/0x10 [ 42.097706] try_to_del_timer_sync+0xa2/0x120 [ 42.102163] ? del_timer+0x130/0x130 [ 42.105842] ? del_timer_sync+0xeb/0x240 [ 42.109868] del_timer_sync+0x18a/0x240 [ 42.113807] tun_free_netdev+0x105/0x1b0 [ 42.117832] ? tun_xdp+0x410/0x410 [ 42.121333] ? cpumask_next+0x24/0x30 [ 42.125097] ? netdev_refcnt_read+0xed/0x150 [ 42.129468] ? tun_xdp+0x410/0x410 [ 42.132969] netdev_run_todo+0x870/0xca0 [ 42.136996] ? do_group_exit+0x149/0x400 [ 42.141021] ? register_netdev+0x30/0x30 [ 42.145046] ? lock_downgrade+0x990/0x990 [ 42.149157] ? trace_hardirqs_on+0xd/0x10 [ 42.153277] ? refcount_sub_and_test+0x115/0x1b0 [ 42.157998] ? refcount_inc+0x50/0x50 [ 42.161763] ? refcount_inc+0x50/0x50 [ 42.165528] ? sk_destruct+0x4c/0x80 [ 42.169202] ? __sk_free+0x5c/0x230 [ 42.172792] ? sk_free+0x2f/0x40 [ 42.176129] ? __tun_detach+0x176/0x1390 [ 42.180157] ? tun_attach+0xf90/0xf90 [ 42.183924] ? locks_remove_file+0x3fa/0x5a0 [ 42.188294] ? fcntl_setlk+0x10d0/0x10d0 [ 42.192318] ? __fsnotify_parent+0xb4/0x3a0 [ 42.196602] ? fsnotify+0x1af0/0x1af0 [ 42.200369] ? __tun_detach+0x1390/0x1390 [ 42.204479] ? __tun_detach+0x1390/0x1390 [ 42.208589] rtnl_unlock+0xe/0x10 [ 42.212005] tun_chr_close+0x49/0x60 [ 42.215682] __fput+0x333/0x7f0 [ 42.218927] ? fput+0x140/0x140 [ 42.222170] ? check_same_owner+0x320/0x320 [ 42.226459] ____fput+0x15/0x20 [ 42.229702] task_work_run+0x199/0x270 [ 42.233553] ? task_work_cancel+0x210/0x210 [ 42.237839] ? free_nsproxy+0x185/0x1f0 [ 42.241776] ? switch_task_namespaces+0xa2/0xc0 [ 42.246408] do_exit+0xa52/0x1b40 [ 42.249832] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.254815] ? trace_hardirqs_on+0xd/0x10 [ 42.258935] ? kvfree+0x3b/0x60 [ 42.262179] ? mm_update_next_owner+0x930/0x930 [ 42.266811] ? rtnl_unlock+0xe/0x10 [ 42.270399] ? __tun_chr_ioctl+0x27a/0x3d20 [ 42.274687] ? tun_chr_read_iter+0x1e0/0x1e0 [ 42.279065] ? lock_downgrade+0x990/0x990 [ 42.283186] ? check_same_owner+0x320/0x320 [ 42.287473] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.292018] ? vmacache_find+0x61/0x270 [ 42.295971] ? tun_chr_compat_ioctl+0x30/0x30 [ 42.300430] ? tun_chr_ioctl+0x2a/0x40 [ 42.304278] ? tun_chr_ioctl+0x2a/0x40 [ 42.308130] ? do_vfs_ioctl+0x492/0x1530 [ 42.312155] ? ioctl_preallocate+0x2b0/0x2b0 [ 42.316529] ? selinux_capable+0x40/0x40 [ 42.320552] ? putname+0xf3/0x130 [ 42.323970] do_group_exit+0x149/0x400 [ 42.327823] ? SyS_exit+0x30/0x30 [ 42.331240] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 42.336220] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 42.340940] SyS_exit_group+0x1d/0x20 [ 42.344706] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 42.349433] RIP: 0033:0x445569 [ 42.352587] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 42.360258] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569