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-4,10.128.0.41' (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: [ 31.896496] ================================================================== [ 31.903945] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.910682] Write of size 8 at addr ffff8801ce8fb780 by task syzkaller779491/2982 [ 31.918277] [ 31.919884] CPU: 0 PID: 2982 Comm: syzkaller779491 Not tainted 4.13.0-next-20170911+ #19 [ 31.928084] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.937410] Call Trace: [ 31.939973] dump_stack+0x194/0x257 [ 31.943577] ? arch_local_irq_restore+0x53/0x53 [ 31.948218] ? show_regs_print_info+0x65/0x65 [ 31.952687] ? lock_timer_base+0x1a3/0x2b0 [ 31.956894] ? detach_if_pending+0x557/0x610 [ 31.961277] print_address_description+0x73/0x250 [ 31.966092] ? detach_if_pending+0x557/0x610 [ 31.970473] kasan_report+0x24e/0x340 [ 31.974249] __asan_report_store8_noabort+0x17/0x20 [ 31.979236] detach_if_pending+0x557/0x610 [ 31.983458] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.989280] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.993921] ? lock_timer_base+0x1a3/0x2b0 [ 31.998135] ? lock_timer_base+0x1eb/0x2b0 [ 32.002346] ? __internal_add_timer+0x2d0/0x2d0 [ 32.006989] ? trace_hardirqs_on+0xd/0x10 [ 32.011115] try_to_del_timer_sync+0xa2/0x120 [ 32.015582] ? del_timer+0x130/0x130 [ 32.019271] ? del_timer_sync+0xeb/0x240 [ 32.023322] del_timer_sync+0x18a/0x240 [ 32.027272] tun_free_netdev+0x105/0x1b0 [ 32.031305] ? tun_xdp+0x410/0x410 [ 32.034817] ? cpumask_next+0x24/0x30 [ 32.038594] ? netdev_refcnt_read+0xed/0x150 [ 32.042979] ? tun_xdp+0x410/0x410 [ 32.046492] netdev_run_todo+0x870/0xca0 [ 32.050525] ? do_group_exit+0x149/0x400 [ 32.054567] ? register_netdev+0x30/0x30 [ 32.058607] ? lock_downgrade+0x990/0x990 [ 32.062741] ? trace_hardirqs_on+0xd/0x10 [ 32.066886] ? refcount_sub_and_test+0x115/0x1b0 [ 32.071615] ? refcount_inc+0x50/0x50 [ 32.075388] ? refcount_inc+0x50/0x50 [ 32.079167] ? sk_destruct+0x4c/0x80 [ 32.082853] ? __sk_free+0x5c/0x230 [ 32.086452] ? sk_free+0x2f/0x40 [ 32.089792] ? __tun_detach+0x176/0x1390 [ 32.093839] ? tun_attach+0xf90/0xf90 [ 32.097622] ? locks_remove_file+0x3fa/0x5a0 [ 32.102010] ? fcntl_setlk+0x10d0/0x10d0 [ 32.106064] ? __fsnotify_parent+0xb4/0x3a0 [ 32.110362] ? fsnotify+0x1af0/0x1af0 [ 32.114139] ? __tun_detach+0x1390/0x1390 [ 32.118269] ? __tun_detach+0x1390/0x1390 [ 32.122391] rtnl_unlock+0xe/0x10 [ 32.125816] tun_chr_close+0x49/0x60 [ 32.129503] __fput+0x333/0x7f0 [ 32.132760] ? fput+0x140/0x140 [ 32.136015] ? check_same_owner+0x320/0x320 [ 32.140318] ____fput+0x15/0x20 [ 32.143573] task_work_run+0x199/0x270 [ 32.147437] ? task_work_cancel+0x210/0x210 [ 32.151733] ? free_nsproxy+0x185/0x1f0 [ 32.155684] ? switch_task_namespaces+0xa2/0xc0 [ 32.160332] do_exit+0xa52/0x1b40 [ 32.163770] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.168766] ? trace_hardirqs_on+0xd/0x10 [ 32.172897] ? kvfree+0x3b/0x60 [ 32.176154] ? mm_update_next_owner+0x930/0x930 [ 32.180800] ? rtnl_unlock+0xe/0x10 [ 32.184404] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.188709] ? tun_chr_read_iter+0x1e0/0x1e0 [ 32.193104] ? lock_downgrade+0x990/0x990 [ 32.197251] ? check_same_owner+0x320/0x320 [ 32.201546] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.206103] ? vmacache_find+0x61/0x270 [ 32.210052] ? tun_chr_compat_ioctl+0x30/0x30 [ 32.214517] ? tun_chr_ioctl+0x2a/0x40 [ 32.218378] ? tun_chr_ioctl+0x2a/0x40 [ 32.222240] ? do_vfs_ioctl+0x492/0x1530 [ 32.226281] ? ioctl_preallocate+0x2b0/0x2b0 [ 32.230668] ? selinux_capable+0x40/0x40 [ 32.234703] ? putname+0xf3/0x130 [ 32.238137] do_group_exit+0x149/0x400 [ 32.241998] ? SyS_exit+0x30/0x30 [ 32.245426] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.250418] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.255157] SyS_exit_group+0x1d/0x20 [ 32.258931] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.263660] RIP: 0033:0x445569 [ 32.266824] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 32.274508] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569 [ 32.281748] RDX: 0000000000445569 RSI: 0000000020d8bfd8 RDI: 0000000000000001 [ 32.288990] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 32.296232] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bc0 [ 32.303473] R13: 0000000000402c50 R14: 0000000000000000 R15: 0000000000000000 [ 32.310735] [ 32.312336] Allocated by task 2982: [ 32.315938] save_stack_trace+0x16/0x20 [ 32.319884] save_stack+0x43/0xd0 [ 32.323309] kasan_kmalloc+0xad/0xe0 [ 32.326994] __kmalloc_node+0x47/0x70 [ 32.330765] kvmalloc_node+0x64/0xd0 [ 32.334453] alloc_netdev_mqs+0x16e/0xed0 [ 32.338586] __tun_chr_ioctl+0x12be/0x3d20 [ 32.342793] tun_chr_ioctl+0x2a/0x40 [ 32.346486] do_vfs_ioctl+0x1b1/0x1530 [ 32.350342] SyS_ioctl+0x8f/0xc0 [ 32.353681] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.358405] [ 32.360003] Freed by task 2982: [ 32.363253] save_stack_trace+0x16/0x20 [ 32.367198] save_stack+0x43/0xd0 [ 32.370624] kasan_slab_free+0x71/0xc0 [ 32.374483] kfree+0xca/0x250 [ 32.377559] kvfree+0x36/0x60 [ 32.380637] free_netdev+0x2cf/0x360 [ 32.384319] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.388523] tun_chr_ioctl+0x2a/0x40 [ 32.392207] do_vfs_ioctl+0x1b1/0x1530 [ 32.396065] SyS_ioctl+0x8f/0xc0 [ 32.399404] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.404125] [ 32.405728] The buggy address belongs to the object at ffff8801ce8f8380 [ 32.405728] which belongs to the cache kmalloc-16384 of size 16384 [ 32.418701] The buggy address is located 13312 bytes inside of [ 32.418701] 16384-byte region [ffff8801ce8f8380, ffff8801ce8fc380) [ 32.430892] The buggy address belongs to the page: [ 32.436404] page:ffffea00073a3e00 count:1 mapcount:0 mapping:ffff8801ce8f8380 index:0x0 compound_mapcount: 0 [ 32.446350] flags: 0x200000000008100(slab|head) [ 32.450991] raw: 0200000000008100 ffff8801ce8f8380 0000000000000000 0000000100000001 [ 32.458842] raw: ffffea000738ae20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.466691] page dumped because: kasan: bad access detected [ 32.472369] [ 32.473966] Memory state around the buggy address: [ 32.478865] ffff8801ce8fb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.486194] ffff8801ce8fb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.493524] >ffff8801ce8fb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.500851] ^ [ 32.504185] ffff8801ce8fb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.511514] ffff8801ce8fb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.518851] ================================================================== [ 32.526188] Disabling lock debugging due to kernel taint [ 32.531605] Kernel panic - not syncing: panic_on_warn set ... [ 32.531605] [ 32.538931] CPU: 0 PID: 2982 Comm: syzkaller779491 Tainted: G B 4.13.0-next-20170911+ #19 [ 32.548337] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.557666] Call Trace: [ 32.560223] dump_stack+0x194/0x257 [ 32.563818] ? arch_local_irq_restore+0x53/0x53 [ 32.568454] ? vprintk_default+0x28/0x30 [ 32.572485] ? detach_if_pending+0x4c0/0x610 [ 32.576861] panic+0x1e4/0x417 [ 32.580019] ? __warn+0x1d9/0x1d9 [ 32.583443] ? detach_if_pending+0x557/0x610 [ 32.587818] kasan_end_report+0x50/0x50 [ 32.591756] kasan_report+0x137/0x340 [ 32.595521] __asan_report_store8_noabort+0x17/0x20 [ 32.600502] detach_if_pending+0x557/0x610 [ 32.604702] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.609857] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.614490] ? lock_timer_base+0x1a3/0x2b0 [ 32.618692] ? lock_timer_base+0x1eb/0x2b0 [ 32.622895] ? __internal_add_timer+0x2d0/0x2d0 [ 32.627531] ? trace_hardirqs_on+0xd/0x10 [ 32.631649] try_to_del_timer_sync+0xa2/0x120 [ 32.636109] ? del_timer+0x130/0x130 [ 32.639799] ? del_timer_sync+0xeb/0x240 [ 32.643828] del_timer_sync+0x18a/0x240 [ 32.647768] tun_free_netdev+0x105/0x1b0 [ 32.651792] ? tun_xdp+0x410/0x410 [ 32.655298] ? cpumask_next+0x24/0x30 [ 32.659065] ? netdev_refcnt_read+0xed/0x150 [ 32.663439] ? tun_xdp+0x410/0x410 [ 32.666947] netdev_run_todo+0x870/0xca0 [ 32.670973] ? do_group_exit+0x149/0x400 [ 32.675003] ? register_netdev+0x30/0x30 [ 32.679031] ? lock_downgrade+0x990/0x990 [ 32.683147] ? trace_hardirqs_on+0xd/0x10 [ 32.687272] ? refcount_sub_and_test+0x115/0x1b0 [ 32.691994] ? refcount_inc+0x50/0x50 [ 32.695759] ? refcount_inc+0x50/0x50 [ 32.699528] ? sk_destruct+0x4c/0x80 [ 32.703207] ? __sk_free+0x5c/0x230 [ 32.706800] ? sk_free+0x2f/0x40 [ 32.710133] ? __tun_detach+0x176/0x1390 [ 32.714164] ? tun_attach+0xf90/0xf90 [ 32.717935] ? locks_remove_file+0x3fa/0x5a0 [ 32.722310] ? fcntl_setlk+0x10d0/0x10d0 [ 32.726337] ? __fsnotify_parent+0xb4/0x3a0 [ 32.730626] ? fsnotify+0x1af0/0x1af0 [ 32.734393] ? __tun_detach+0x1390/0x1390 [ 32.738506] ? __tun_detach+0x1390/0x1390 [ 32.742619] rtnl_unlock+0xe/0x10 [ 32.746036] tun_chr_close+0x49/0x60 [ 32.749716] __fput+0x333/0x7f0 [ 32.752963] ? fput+0x140/0x140 [ 32.756219] ? check_same_owner+0x320/0x320 [ 32.760515] ____fput+0x15/0x20 [ 32.763765] task_work_run+0x199/0x270 [ 32.767620] ? task_work_cancel+0x210/0x210 [ 32.771920] ? free_nsproxy+0x185/0x1f0 [ 32.775862] ? switch_task_namespaces+0xa2/0xc0 [ 32.780498] do_exit+0xa52/0x1b40 [ 32.783919] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.788913] ? trace_hardirqs_on+0xd/0x10 [ 32.793029] ? kvfree+0x3b/0x60 [ 32.796275] ? mm_update_next_owner+0x930/0x930 [ 32.800910] ? rtnl_unlock+0xe/0x10 [ 32.804513] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.808802] ? tun_chr_read_iter+0x1e0/0x1e0 [ 32.813182] ? lock_downgrade+0x990/0x990 [ 32.817318] ? check_same_owner+0x320/0x320 [ 32.821605] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.826151] ? vmacache_find+0x61/0x270 [ 32.830092] ? tun_chr_compat_ioctl+0x30/0x30 [ 32.834552] ? tun_chr_ioctl+0x2a/0x40 [ 32.838404] ? tun_chr_ioctl+0x2a/0x40 [ 32.842257] ? do_vfs_ioctl+0x492/0x1530 [ 32.846287] ? ioctl_preallocate+0x2b0/0x2b0 [ 32.850666] ? selinux_capable+0x40/0x40 [ 32.854700] ? putname+0xf3/0x130 [ 32.858125] do_group_exit+0x149/0x400 [ 32.861979] ? SyS_exit+0x30/0x30 [ 32.865400] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.870385] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.875195] SyS_exit_group+0x1d/0x20 [ 32.878975] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 32.883694] RIP: 0033:0x445569 [ 32.886850] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7