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.15.192' (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: [ 40.560415] ================================================================== [ 40.567841] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.574572] Write of size 8 at addr ffff8801cea3b7c0 by task syzkaller547827/2986 [ 40.582172] [ 40.583784] CPU: 0 PID: 2986 Comm: syzkaller547827 Not tainted 4.13.0-next-20170908+ #18 [ 40.591987] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.601316] Call Trace: [ 40.603885] dump_stack+0x194/0x257 [ 40.607495] ? arch_local_irq_restore+0x53/0x53 [ 40.612144] ? show_regs_print_info+0x65/0x65 [ 40.616626] ? lock_timer_base+0x1a3/0x2b0 [ 40.620845] ? detach_if_pending+0x557/0x610 [ 40.625229] print_address_description+0x73/0x250 [ 40.630044] ? detach_if_pending+0x557/0x610 [ 40.634422] kasan_report+0x24e/0x340 [ 40.638198] __asan_report_store8_noabort+0x17/0x20 [ 40.643183] detach_if_pending+0x557/0x610 [ 40.647401] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.652562] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.657198] ? lock_timer_base+0x1a3/0x2b0 [ 40.661403] ? lock_timer_base+0x1eb/0x2b0 [ 40.665611] ? __internal_add_timer+0x2d0/0x2d0 [ 40.670261] ? trace_hardirqs_on+0xd/0x10 [ 40.674389] try_to_del_timer_sync+0xa2/0x120 [ 40.678856] ? del_timer+0x130/0x130 [ 40.682550] ? del_timer_sync+0xeb/0x240 [ 40.686590] del_timer_sync+0x18a/0x240 [ 40.690543] tun_free_netdev+0x105/0x1b0 [ 40.694578] ? tun_xdp+0x410/0x410 [ 40.698094] ? cpumask_next+0x24/0x30 [ 40.701882] ? netdev_refcnt_read+0xed/0x150 [ 40.706262] ? tun_xdp+0x410/0x410 [ 40.709772] netdev_run_todo+0x870/0xca0 [ 40.713813] ? do_group_exit+0x149/0x400 [ 40.717850] ? register_netdev+0x30/0x30 [ 40.721883] ? lock_downgrade+0x990/0x990 [ 40.726003] ? trace_hardirqs_on+0xd/0x10 [ 40.730150] ? refcount_sub_and_test+0x115/0x1b0 [ 40.734878] ? refcount_inc+0x50/0x50 [ 40.738650] ? refcount_inc+0x50/0x50 [ 40.742428] ? sk_destruct+0x4c/0x80 [ 40.746113] ? __sk_free+0x5c/0x230 [ 40.749711] ? sk_free+0x2f/0x40 [ 40.753048] ? __tun_detach+0x176/0x1390 [ 40.757090] ? tun_attach+0xf90/0xf90 [ 40.760865] ? do_raw_spin_trylock+0x190/0x190 [ 40.765421] ? locks_remove_file+0x3fa/0x5a0 [ 40.769810] ? fcntl_setlk+0x10d0/0x10d0 [ 40.773846] ? __fsnotify_parent+0xb4/0x3a0 [ 40.778142] ? fsnotify+0x1af0/0x1af0 [ 40.781928] ? __tun_detach+0x1390/0x1390 [ 40.786046] ? __tun_detach+0x1390/0x1390 [ 40.790164] rtnl_unlock+0xe/0x10 [ 40.793586] tun_chr_close+0x49/0x60 [ 40.797270] __fput+0x333/0x7f0 [ 40.800543] ? fput+0x140/0x140 [ 40.803795] ? check_same_owner+0x320/0x320 [ 40.808087] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.812576] ____fput+0x15/0x20 [ 40.815828] task_work_run+0x199/0x270 [ 40.819691] ? task_work_cancel+0x210/0x210 [ 40.823988] ? _raw_spin_unlock+0x22/0x30 [ 40.828108] ? switch_task_namespaces+0x87/0xc0 [ 40.832751] do_exit+0xa52/0x1b40 [ 40.836443] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.841433] ? check_noncircular+0x20/0x20 [ 40.845650] ? mm_update_next_owner+0x930/0x930 [ 40.850292] ? __pmd_alloc+0x4e0/0x4e0 [ 40.854158] ? find_held_lock+0x39/0x1d0 [ 40.858207] ? lock_downgrade+0x990/0x990 [ 40.862347] ? handle_mm_fault+0x410/0x8d0 [ 40.866601] ? down_read_trylock+0xdb/0x170 [ 40.870897] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.875453] ? vmacache_find+0x61/0x270 [ 40.879406] ? up_read+0x1a/0x40 [ 40.882743] ? __do_page_fault+0x35b/0xb60 [ 40.886948] ? do_vfs_ioctl+0x492/0x1530 [ 40.890986] ? do_page_fault+0xee/0x720 [ 40.894933] ? __do_page_fault+0xb60/0xb60 [ 40.899137] ? putname+0xf3/0x130 [ 40.902565] do_group_exit+0x149/0x400 [ 40.906423] ? lockdep_sys_exit+0x47/0xf0 [ 40.910540] ? SyS_exit+0x30/0x30 [ 40.913964] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.918962] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.923695] SyS_exit_group+0x1d/0x20 [ 40.927467] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.932191] RIP: 0033:0x443ab8 [ 40.935349] RSP: 002b:00007ffee7ed56c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.943033] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443ab8 [ 40.950274] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.957515] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4 [ 40.964756] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 40.972012] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 40.979269] [ 40.980867] Allocated by task 2986: [ 40.984466] save_stack_trace+0x16/0x20 [ 40.988411] save_stack+0x43/0xd0 [ 40.991832] kasan_kmalloc+0xad/0xe0 [ 40.995515] __kmalloc_node+0x47/0x70 [ 40.999284] kvmalloc_node+0x64/0xd0 [ 41.002971] alloc_netdev_mqs+0x16e/0xed0 [ 41.007097] __tun_chr_ioctl+0x12be/0x3d20 [ 41.011300] tun_chr_ioctl+0x2a/0x40 [ 41.014982] do_vfs_ioctl+0x1b1/0x1530 [ 41.018837] SyS_ioctl+0x8f/0xc0 [ 41.022172] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.026898] [ 41.028494] Freed by task 2986: [ 41.031741] save_stack_trace+0x16/0x20 [ 41.035688] save_stack+0x43/0xd0 [ 41.039108] kasan_slab_free+0x71/0xc0 [ 41.042963] kfree+0xca/0x250 [ 41.046044] kvfree+0x36/0x60 [ 41.049121] free_netdev+0x2cf/0x360 [ 41.052811] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.057023] tun_chr_ioctl+0x2a/0x40 [ 41.060725] do_vfs_ioctl+0x1b1/0x1530 [ 41.064600] SyS_ioctl+0x8f/0xc0 [ 41.067948] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.072674] [ 41.074273] The buggy address belongs to the object at ffff8801cea383c0 [ 41.074273] which belongs to the cache kmalloc-16384 of size 16384 [ 41.087250] The buggy address is located 13312 bytes inside of [ 41.087250] 16384-byte region [ffff8801cea383c0, ffff8801cea3c3c0) [ 41.099437] The buggy address belongs to the page: [ 41.104335] page:ffffea00073a8e00 count:1 mapcount:0 mapping:ffff8801cea383c0 index:0x0 compound_mapcount: 0 [ 41.114275] flags: 0x200000000008100(slab|head) [ 41.118915] raw: 0200000000008100 ffff8801cea383c0 0000000000000000 0000000100000001 [ 41.126762] raw: ffffea00073afe20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.134609] page dumped because: kasan: bad access detected [ 41.140284] [ 41.141880] Memory state around the buggy address: [ 41.146776] ffff8801cea3b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.154103] ffff8801cea3b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.161429] >ffff8801cea3b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.168754] ^ [ 41.174171] ffff8801cea3b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.181497] ffff8801cea3b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.188824] ================================================================== [ 41.196150] Disabling lock debugging due to kernel taint [ 41.201562] Kernel panic - not syncing: panic_on_warn set ... [ 41.201562] [ 41.208887] CPU: 0 PID: 2986 Comm: syzkaller547827 Tainted: G B 4.13.0-next-20170908+ #18 [ 41.218293] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.227611] Call Trace: [ 41.230169] dump_stack+0x194/0x257 [ 41.233762] ? arch_local_irq_restore+0x53/0x53 [ 41.238395] ? vprintk_default+0x28/0x30 [ 41.242434] ? detach_if_pending+0x4c0/0x610 [ 41.246836] panic+0x1e4/0x417 [ 41.250011] ? __warn+0x1d9/0x1d9 [ 41.253458] ? detach_if_pending+0x557/0x610 [ 41.257833] kasan_end_report+0x50/0x50 [ 41.261773] kasan_report+0x137/0x340 [ 41.265543] __asan_report_store8_noabort+0x17/0x20 [ 41.270524] detach_if_pending+0x557/0x610 [ 41.274723] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.279878] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.284510] ? lock_timer_base+0x1a3/0x2b0 [ 41.288706] ? lock_timer_base+0x1eb/0x2b0 [ 41.292906] ? __internal_add_timer+0x2d0/0x2d0 [ 41.297540] ? trace_hardirqs_on+0xd/0x10 [ 41.301656] try_to_del_timer_sync+0xa2/0x120 [ 41.306115] ? del_timer+0x130/0x130 [ 41.309793] ? del_timer_sync+0xeb/0x240 [ 41.313821] del_timer_sync+0x18a/0x240 [ 41.317760] tun_free_netdev+0x105/0x1b0 [ 41.321785] ? tun_xdp+0x410/0x410 [ 41.325291] ? cpumask_next+0x24/0x30 [ 41.329060] ? netdev_refcnt_read+0xed/0x150 [ 41.333432] ? tun_xdp+0x410/0x410 [ 41.336941] netdev_run_todo+0x870/0xca0 [ 41.340966] ? do_group_exit+0x149/0x400 [ 41.344994] ? register_netdev+0x30/0x30 [ 41.349024] ? lock_downgrade+0x990/0x990 [ 41.353134] ? trace_hardirqs_on+0xd/0x10 [ 41.357254] ? refcount_sub_and_test+0x115/0x1b0 [ 41.361971] ? refcount_inc+0x50/0x50 [ 41.365734] ? refcount_inc+0x50/0x50 [ 41.369501] ? sk_destruct+0x4c/0x80 [ 41.373178] ? __sk_free+0x5c/0x230 [ 41.376769] ? sk_free+0x2f/0x40 [ 41.380098] ? __tun_detach+0x176/0x1390 [ 41.384129] ? tun_attach+0xf90/0xf90 [ 41.387895] ? do_raw_spin_trylock+0x190/0x190 [ 41.392442] ? locks_remove_file+0x3fa/0x5a0 [ 41.396816] ? fcntl_setlk+0x10d0/0x10d0 [ 41.400841] ? __fsnotify_parent+0xb4/0x3a0 [ 41.405129] ? fsnotify+0x1af0/0x1af0 [ 41.408901] ? __tun_detach+0x1390/0x1390 [ 41.413010] ? __tun_detach+0x1390/0x1390 [ 41.417127] rtnl_unlock+0xe/0x10 [ 41.420544] tun_chr_close+0x49/0x60 [ 41.424221] __fput+0x333/0x7f0 [ 41.427468] ? fput+0x140/0x140 [ 41.430714] ? check_same_owner+0x320/0x320 [ 41.434999] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.439461] ____fput+0x15/0x20 [ 41.442704] task_work_run+0x199/0x270 [ 41.446559] ? task_work_cancel+0x210/0x210 [ 41.450846] ? _raw_spin_unlock+0x22/0x30 [ 41.454958] ? switch_task_namespaces+0x87/0xc0 [ 41.459591] do_exit+0xa52/0x1b40 [ 41.463013] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.467994] ? check_noncircular+0x20/0x20 [ 41.472197] ? mm_update_next_owner+0x930/0x930 [ 41.476830] ? __pmd_alloc+0x4e0/0x4e0 [ 41.480686] ? find_held_lock+0x39/0x1d0 [ 41.484714] ? lock_downgrade+0x990/0x990 [ 41.488837] ? handle_mm_fault+0x410/0x8d0 [ 41.493033] ? down_read_trylock+0xdb/0x170 [ 41.497324] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.501873] ? vmacache_find+0x61/0x270 [ 41.505814] ? up_read+0x1a/0x40 [ 41.509147] ? __do_page_fault+0x35b/0xb60 [ 41.513345] ? do_vfs_ioctl+0x492/0x1530 [ 41.517382] ? do_page_fault+0xee/0x720 [ 41.521320] ? __do_page_fault+0xb60/0xb60 [ 41.525516] ? putname+0xf3/0x130 [ 41.528936] do_group_exit+0x149/0x400 [ 41.532786] ? lockdep_sys_exit+0x47/0xf0 [ 41.536897] ? SyS_exit+0x30/0x30 [ 41.540313] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.545292] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.550014] SyS_exit_group+0x1d/0x20 [ 41.553780] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.558497] RIP: 0033:0x443ab8