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-2,10.128.15.208' (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: [ 39.811287] ================================================================== [ 39.818703] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 39.825429] Write of size 8 at addr ffff8801cef23780 by task syzkaller314185/2986 [ 39.833019] [ 39.834622] CPU: 1 PID: 2986 Comm: syzkaller314185 Not tainted 4.14.0-rc2-next-20170929+ #32 [ 39.843166] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 39.852495] Call Trace: [ 39.855060] dump_stack+0x194/0x257 [ 39.858669] ? arch_local_irq_restore+0x53/0x53 [ 39.863318] ? show_regs_print_info+0x65/0x65 [ 39.867794] ? lock_timer_base+0x1a3/0x2b0 [ 39.872175] ? detach_if_pending+0x557/0x610 [ 39.876556] print_address_description+0x73/0x250 [ 39.881369] ? detach_if_pending+0x557/0x610 [ 39.885750] kasan_report+0x25b/0x340 [ 39.889524] __asan_report_store8_noabort+0x17/0x20 [ 39.894510] detach_if_pending+0x557/0x610 [ 39.898721] ? trace_raw_output_tick_stop+0x130/0x130 [ 39.903883] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 39.908522] ? lock_timer_base+0x1a3/0x2b0 [ 39.912729] ? lock_timer_base+0x1eb/0x2b0 [ 39.916946] ? __internal_add_timer+0x2d0/0x2d0 [ 39.921595] ? trace_hardirqs_on+0xd/0x10 [ 39.925724] try_to_del_timer_sync+0xa2/0x120 [ 39.930189] ? del_timer+0x130/0x130 [ 39.933874] ? del_timer_sync+0xeb/0x240 [ 39.937910] del_timer_sync+0x18a/0x240 [ 39.942559] tun_free_netdev+0x105/0x1b0 [ 39.946591] ? tun_xdp+0x410/0x410 [ 39.950100] ? cpumask_next+0x24/0x30 [ 39.953873] ? netdev_refcnt_read+0xed/0x150 [ 39.958254] ? tun_xdp+0x410/0x410 [ 39.961779] netdev_run_todo+0x870/0xca0 [ 39.965812] ? do_group_exit+0x149/0x400 [ 39.969848] ? register_netdev+0x30/0x30 [ 39.973889] ? do_raw_spin_trylock+0x190/0x190 [ 39.978459] ? refcount_sub_and_test+0x115/0x1b0 [ 39.983188] ? refcount_inc+0x50/0x50 [ 39.986962] ? refcount_inc+0x50/0x50 [ 39.990744] ? sk_destruct+0x4c/0x80 [ 39.994428] ? __sk_free+0x5c/0x230 [ 39.998038] ? sk_free+0x2f/0x40 [ 40.001586] ? __tun_detach+0x760/0x1570 [ 40.005632] ? tun_attach+0x1070/0x1070 [ 40.009581] ? do_raw_spin_trylock+0x190/0x190 [ 40.014138] ? locks_remove_file+0x3fa/0x5a0 [ 40.018526] ? fcntl_setlk+0x10d0/0x10d0 [ 40.022560] ? __fsnotify_parent+0xb4/0x3a0 [ 40.026869] ? fsnotify+0x1af0/0x1af0 [ 40.030647] ? rcu_note_context_switch+0x710/0x710 [ 40.035551] ? __tun_detach+0x1570/0x1570 [ 40.039668] rtnl_unlock+0xe/0x10 [ 40.043093] tun_chr_close+0x49/0x60 [ 40.046778] __fput+0x333/0x7f0 [ 40.050042] ? fput+0x140/0x140 [ 40.053296] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 40.059149] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.063619] ____fput+0x15/0x20 [ 40.066871] task_work_run+0x199/0x270 [ 40.070732] ? task_work_cancel+0x210/0x210 [ 40.075025] ? _raw_spin_unlock+0x22/0x30 [ 40.079149] ? switch_task_namespaces+0x87/0xc0 [ 40.083805] do_exit+0x9c8/0x1b00 [ 40.087236] ? mm_update_next_owner+0x930/0x930 [ 40.091877] ? find_held_lock+0x39/0x1d0 [ 40.095919] ? lock_downgrade+0x990/0x990 [ 40.100061] ? handle_mm_fault+0x410/0x8d0 [ 40.104266] ? __do_page_fault+0x31e/0xd60 [ 40.108474] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.113024] ? vmacache_find+0x5f/0x280 [ 40.116981] ? up_read+0x1a/0x40 [ 40.120317] ? __do_page_fault+0x3d6/0xd60 [ 40.124529] ? mm_fault_error+0x2c0/0x2c0 [ 40.128649] ? do_vfs_ioctl+0x492/0x1530 [ 40.132680] ? _cond_resched+0x14/0x30 [ 40.136543] ? do_page_fault+0xee/0x720 [ 40.140486] ? __do_page_fault+0xd60/0xd60 [ 40.144692] ? putname+0xf3/0x130 [ 40.148123] do_group_exit+0x149/0x400 [ 40.151978] ? lockdep_sys_exit+0x47/0xf0 [ 40.156103] ? SyS_exit+0x30/0x30 [ 40.159534] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.164521] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.169250] SyS_exit_group+0x1d/0x20 [ 40.173023] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.177760] RIP: 0033:0x443628 [ 40.180921] RSP: 002b:00007ffd9708eed8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 40.188610] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443628 [ 40.195850] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 40.203089] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 40.210346] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 40.217718] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 40.225151] [ 40.226754] Allocated by task 2986: [ 40.230354] save_stack_trace+0x16/0x20 [ 40.234297] save_stack+0x43/0xd0 [ 40.237719] kasan_kmalloc+0xad/0xe0 [ 40.241403] __kmalloc_node+0x47/0x70 [ 40.245172] kvmalloc_node+0x64/0xd0 [ 40.248856] alloc_netdev_mqs+0x16d/0xed0 [ 40.252975] __tun_chr_ioctl+0x1386/0x3e40 [ 40.257182] tun_chr_ioctl+0x2a/0x40 [ 40.260878] do_vfs_ioctl+0x1b1/0x1530 [ 40.264735] SyS_ioctl+0x8f/0xc0 [ 40.268079] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.272801] [ 40.274413] Freed by task 2986: [ 40.277665] save_stack_trace+0x16/0x20 [ 40.281609] save_stack+0x43/0xd0 [ 40.285033] kasan_slab_free+0x71/0xc0 [ 40.288897] kfree+0xca/0x250 [ 40.291972] kvfree+0x36/0x60 [ 40.295049] free_netdev+0x2cf/0x360 [ 40.298732] __tun_chr_ioctl+0x2df6/0x3e40 [ 40.302943] tun_chr_ioctl+0x2a/0x40 [ 40.306628] do_vfs_ioctl+0x1b1/0x1530 [ 40.310484] SyS_ioctl+0x8f/0xc0 [ 40.313822] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.318545] [ 40.320146] The buggy address belongs to the object at ffff8801cef20380 [ 40.320146] which belongs to the cache kmalloc-16384 of size 16384 [ 40.333118] The buggy address is located 13312 bytes inside of [ 40.333118] 16384-byte region [ffff8801cef20380, ffff8801cef24380) [ 40.345487] The buggy address belongs to the page: [ 40.350388] page:ffffea00073bc800 count:1 mapcount:0 mapping:ffff8801cef20380 index:0x0 compound_mapcount: 0 [ 40.360333] flags: 0x200000000008100(slab|head) [ 40.364983] raw: 0200000000008100 ffff8801cef20380 0000000000000000 0000000100000001 [ 40.372844] raw: ffffea000739c620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.380703] page dumped because: kasan: bad access detected [ 40.386381] [ 40.387975] Memory state around the buggy address: [ 40.392871] ffff8801cef23680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.400197] ffff8801cef23700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.407523] >ffff8801cef23780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.414948] ^ [ 40.418282] ffff8801cef23800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.425609] ffff8801cef23880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.432937] ================================================================== [ 40.440263] Disabling lock debugging due to kernel taint [ 40.445677] Kernel panic - not syncing: panic_on_warn set ... [ 40.445677] [ 40.453005] CPU: 1 PID: 2986 Comm: syzkaller314185 Tainted: G B 4.14.0-rc2-next-20170929+ #32 [ 40.462761] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.472078] Call Trace: [ 40.474632] dump_stack+0x194/0x257 [ 40.478225] ? arch_local_irq_restore+0x53/0x53 [ 40.482861] ? vprintk_default+0x28/0x30 [ 40.486889] ? detach_if_pending+0x4b0/0x610 [ 40.491263] panic+0x1e4/0x41c [ 40.494420] ? refcount_error_report+0x214/0x214 [ 40.499146] ? detach_if_pending+0x557/0x610 [ 40.503517] kasan_end_report+0x50/0x50 [ 40.507454] kasan_report+0x144/0x340 [ 40.511307] __asan_report_store8_noabort+0x17/0x20 [ 40.516286] detach_if_pending+0x557/0x610 [ 40.520488] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.525642] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.530275] ? lock_timer_base+0x1a3/0x2b0 [ 40.534561] ? lock_timer_base+0x1eb/0x2b0 [ 40.538763] ? __internal_add_timer+0x2d0/0x2d0 [ 40.543397] ? trace_hardirqs_on+0xd/0x10 [ 40.547513] try_to_del_timer_sync+0xa2/0x120 [ 40.551972] ? del_timer+0x130/0x130 [ 40.555650] ? del_timer_sync+0xeb/0x240 [ 40.559682] del_timer_sync+0x18a/0x240 [ 40.563630] tun_free_netdev+0x105/0x1b0 [ 40.567654] ? tun_xdp+0x410/0x410 [ 40.571158] ? cpumask_next+0x24/0x30 [ 40.574926] ? netdev_refcnt_read+0xed/0x150 [ 40.579301] ? tun_xdp+0x410/0x410 [ 40.582805] netdev_run_todo+0x870/0xca0 [ 40.586830] ? do_group_exit+0x149/0x400 [ 40.590862] ? register_netdev+0x30/0x30 [ 40.594902] ? do_raw_spin_trylock+0x190/0x190 [ 40.599455] ? refcount_sub_and_test+0x115/0x1b0 [ 40.604179] ? refcount_inc+0x50/0x50 [ 40.607943] ? refcount_inc+0x50/0x50 [ 40.611709] ? sk_destruct+0x4c/0x80 [ 40.615387] ? __sk_free+0x5c/0x230 [ 40.618977] ? sk_free+0x2f/0x40 [ 40.622310] ? __tun_detach+0x760/0x1570 [ 40.626341] ? tun_attach+0x1070/0x1070 [ 40.630281] ? do_raw_spin_trylock+0x190/0x190 [ 40.634829] ? locks_remove_file+0x3fa/0x5a0 [ 40.639201] ? fcntl_setlk+0x10d0/0x10d0 [ 40.643230] ? __fsnotify_parent+0xb4/0x3a0 [ 40.647516] ? fsnotify+0x1af0/0x1af0 [ 40.651291] ? rcu_note_context_switch+0x710/0x710 [ 40.656190] ? __tun_detach+0x1570/0x1570 [ 40.660302] rtnl_unlock+0xe/0x10 [ 40.663729] tun_chr_close+0x49/0x60 [ 40.667408] __fput+0x333/0x7f0 [ 40.670656] ? fput+0x140/0x140 [ 40.673918] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 40.679766] ? _raw_spin_unlock_irq+0x27/0x70 [ 40.684229] ____fput+0x15/0x20 [ 40.687482] task_work_run+0x199/0x270 [ 40.691335] ? task_work_cancel+0x210/0x210 [ 40.695620] ? _raw_spin_unlock+0x22/0x30 [ 40.699736] ? switch_task_namespaces+0x87/0xc0 [ 40.704378] do_exit+0x9c8/0x1b00 [ 40.707797] ? mm_update_next_owner+0x930/0x930 [ 40.712431] ? find_held_lock+0x39/0x1d0 [ 40.716461] ? lock_downgrade+0x990/0x990 [ 40.720586] ? handle_mm_fault+0x410/0x8d0 [ 40.724785] ? __do_page_fault+0x31e/0xd60 [ 40.728983] ? __handle_mm_fault+0x39c0/0x39c0 [ 40.733531] ? vmacache_find+0x5f/0x280 [ 40.737474] ? up_read+0x1a/0x40 [ 40.740802] ? __do_page_fault+0x3d6/0xd60 [ 40.745019] ? mm_fault_error+0x2c0/0x2c0 [ 40.749136] ? do_vfs_ioctl+0x492/0x1530 [ 40.753158] ? _cond_resched+0x14/0x30 [ 40.757012] ? do_page_fault+0xee/0x720 [ 40.760950] ? __do_page_fault+0xd60/0xd60 [ 40.765149] ? putname+0xf3/0x130 [ 40.768567] do_group_exit+0x149/0x400 [ 40.772419] ? lockdep_sys_exit+0x47/0xf0 [ 40.776531] ? SyS_exit+0x30/0x30 [ 40.779958] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.784954] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.789674] SyS_exit_group+0x1d/0x20 [ 40.793445] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.798162] RIP: 0033:0x443628 [ 40.801316] RSP: 002b:00007ffd9708eed8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7