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.4' (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: [ 58.949348] ================================================================== [ 58.956802] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 58.963535] Write of size 8 at addr ffff8801ccab3740 by task syzkaller003877/2985 [ 58.971125] [ 58.972727] CPU: 0 PID: 2985 Comm: syzkaller003877 Not tainted 4.14.0-rc2-next-20170929+ #32 [ 58.981271] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 58.990595] Call Trace: [ 58.993159] dump_stack+0x194/0x257 [ 58.997371] ? arch_local_irq_restore+0x53/0x53 [ 59.002014] ? show_regs_print_info+0x65/0x65 [ 59.006487] ? lock_timer_base+0x1a3/0x2b0 [ 59.010699] ? detach_if_pending+0x557/0x610 [ 59.015084] print_address_description+0x73/0x250 [ 59.019900] ? detach_if_pending+0x557/0x610 [ 59.024279] kasan_report+0x25b/0x340 [ 59.028056] __asan_report_store8_noabort+0x17/0x20 [ 59.033043] detach_if_pending+0x557/0x610 [ 59.037251] ? trace_raw_output_tick_stop+0x130/0x130 [ 59.042418] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 59.047060] ? lock_timer_base+0x1a3/0x2b0 [ 59.051266] ? lock_timer_base+0x1eb/0x2b0 [ 59.055475] ? __internal_add_timer+0x2d0/0x2d0 [ 59.060116] ? trace_hardirqs_on+0xd/0x10 [ 59.064246] try_to_del_timer_sync+0xa2/0x120 [ 59.068716] ? del_timer+0x130/0x130 [ 59.072403] ? del_timer_sync+0xeb/0x240 [ 59.076442] del_timer_sync+0x18a/0x240 [ 59.080390] tun_free_netdev+0x105/0x1b0 [ 59.084427] ? tun_xdp+0x410/0x410 [ 59.087938] ? cpumask_next+0x24/0x30 [ 59.091714] ? netdev_refcnt_read+0xed/0x150 [ 59.096097] ? tun_xdp+0x410/0x410 [ 59.099611] netdev_run_todo+0x870/0xca0 [ 59.103644] ? do_group_exit+0x149/0x400 [ 59.107693] ? register_netdev+0x30/0x30 [ 59.111731] ? lock_downgrade+0x990/0x990 [ 59.115849] ? trace_hardirqs_on+0xd/0x10 [ 59.119987] ? refcount_sub_and_test+0x115/0x1b0 [ 59.124711] ? refcount_inc+0x50/0x50 [ 59.128482] ? refcount_inc+0x50/0x50 [ 59.132260] ? sk_destruct+0x4c/0x80 [ 59.135944] ? __sk_free+0x5c/0x230 [ 59.139543] ? sk_free+0x2f/0x40 [ 59.142882] ? __tun_detach+0x760/0x1570 [ 59.146926] ? tun_attach+0x1070/0x1070 [ 59.150886] ? locks_remove_file+0x3fa/0x5a0 [ 59.155268] ? fcntl_setlk+0x10d0/0x10d0 [ 59.159303] ? __fsnotify_parent+0xb4/0x3a0 [ 59.163597] ? fsnotify+0x1af0/0x1af0 [ 59.167371] ? rcu_note_context_switch+0x710/0x710 [ 59.172276] ? __tun_detach+0x1570/0x1570 [ 59.176395] rtnl_unlock+0xe/0x10 [ 59.179816] tun_chr_close+0x49/0x60 [ 59.183503] __fput+0x333/0x7f0 [ 59.186759] ? fput+0x140/0x140 [ 59.190011] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 59.195874] ____fput+0x15/0x20 [ 59.199124] task_work_run+0x199/0x270 [ 59.202988] ? task_work_cancel+0x210/0x210 [ 59.207280] ? free_nsproxy+0x185/0x1f0 [ 59.211230] ? switch_task_namespaces+0xa2/0xc0 [ 59.215876] do_exit+0x9c8/0x1b00 [ 59.219307] ? mm_update_next_owner+0x930/0x930 [ 59.223949] ? find_held_lock+0x39/0x1d0 [ 59.227994] ? lock_downgrade+0x990/0x990 [ 59.232138] ? handle_mm_fault+0x410/0x8d0 [ 59.236343] ? __do_page_fault+0x31e/0xd60 [ 59.240552] ? __handle_mm_fault+0x39c0/0x39c0 [ 59.245104] ? vmacache_find+0x5f/0x280 [ 59.249056] ? up_read+0x1a/0x40 [ 59.252392] ? __do_page_fault+0x3d6/0xd60 [ 59.256609] ? mm_fault_error+0x2c0/0x2c0 [ 59.260730] ? do_vfs_ioctl+0x492/0x1530 [ 59.264763] ? _cond_resched+0x14/0x30 [ 59.268630] ? do_page_fault+0xee/0x720 [ 59.272581] ? __do_page_fault+0xd60/0xd60 [ 59.276791] ? putname+0xf3/0x130 [ 59.280223] do_group_exit+0x149/0x400 [ 59.284081] ? lockdep_sys_exit+0x47/0xf0 [ 59.288200] ? SyS_exit+0x30/0x30 [ 59.291625] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 59.296614] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 59.301343] SyS_exit_group+0x1d/0x20 [ 59.305117] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 59.309840] RIP: 0033:0x444ee9 [ 59.312998] RSP: 002b:00007ffd0d236288 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 59.320678] RAX: ffffffffffffffda RBX: 00007ffd0d2362d0 RCX: 0000000000444ee9 [ 59.327918] RDX: 0000000000444ee9 RSI: 0000000020927fd8 RDI: 0000000000000001 [ 59.335159] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffd0d2362d0 [ 59.342398] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402230 [ 59.349640] R13: 00000000004022c0 R14: 0000000000000000 R15: 0000000000000000 [ 59.357465] [ 59.359065] Allocated by task 2985: [ 59.362671] save_stack_trace+0x16/0x20 [ 59.366616] save_stack+0x43/0xd0 [ 59.370040] kasan_kmalloc+0xad/0xe0 [ 59.373725] __kmalloc_node+0x47/0x70 [ 59.377496] kvmalloc_node+0x64/0xd0 [ 59.381179] alloc_netdev_mqs+0x16d/0xed0 [ 59.385297] __tun_chr_ioctl+0x1386/0x3e40 [ 59.389498] tun_chr_ioctl+0x2a/0x40 [ 59.393182] do_vfs_ioctl+0x1b1/0x1530 [ 59.397040] SyS_ioctl+0x8f/0xc0 [ 59.400378] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 59.405101] [ 59.406698] Freed by task 2985: [ 59.409947] save_stack_trace+0x16/0x20 [ 59.413891] save_stack+0x43/0xd0 [ 59.417314] kasan_slab_free+0x71/0xc0 [ 59.421170] kfree+0xca/0x250 [ 59.424244] kvfree+0x36/0x60 [ 59.427319] free_netdev+0x2cf/0x360 [ 59.431003] __tun_chr_ioctl+0x2df6/0x3e40 [ 59.435206] tun_chr_ioctl+0x2a/0x40 [ 59.438890] do_vfs_ioctl+0x1b1/0x1530 [ 59.442748] SyS_ioctl+0x8f/0xc0 [ 59.446086] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 59.450809] [ 59.452407] The buggy address belongs to the object at ffff8801ccab0340 [ 59.452407] which belongs to the cache kmalloc-16384 of size 16384 [ 59.465378] The buggy address is located 13312 bytes inside of [ 59.465378] 16384-byte region [ffff8801ccab0340, ffff8801ccab4340) [ 59.477573] The buggy address belongs to the page: [ 59.482474] page:ffffea000732ac00 count:1 mapcount:0 mapping:ffff8801ccab0340 index:0x0 compound_mapcount: 0 [ 59.492419] flags: 0x200000000008100(slab|head) [ 59.497059] raw: 0200000000008100 ffff8801ccab0340 0000000000000000 0000000100000001 [ 59.504909] raw: ffffea0007337420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 59.512756] page dumped because: kasan: bad access detected [ 59.518431] [ 59.520032] Memory state around the buggy address: [ 59.524929] ffff8801ccab3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 59.532254] ffff8801ccab3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 59.539583] >ffff8801ccab3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 59.546911] ^ [ 59.552328] ffff8801ccab3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 59.559656] ffff8801ccab3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 59.566981] ================================================================== [ 59.574308] Disabling lock debugging due to kernel taint [ 59.579721] Kernel panic - not syncing: panic_on_warn set ... [ 59.579721] [ 59.587047] CPU: 0 PID: 2985 Comm: syzkaller003877 Tainted: G B 4.14.0-rc2-next-20170929+ #32 [ 59.596800] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 59.606116] Call Trace: [ 59.608676] dump_stack+0x194/0x257 [ 59.612270] ? arch_local_irq_restore+0x53/0x53 [ 59.616903] ? vprintk_default+0x28/0x30 [ 59.620930] ? detach_if_pending+0x4b0/0x610 [ 59.625304] panic+0x1e4/0x41c [ 59.628463] ? refcount_error_report+0x214/0x214 [ 59.633189] ? detach_if_pending+0x557/0x610 [ 59.637562] kasan_end_report+0x50/0x50 [ 59.641499] kasan_report+0x144/0x340 [ 59.645266] __asan_report_store8_noabort+0x17/0x20 [ 59.650245] detach_if_pending+0x557/0x610 [ 59.654445] ? trace_raw_output_tick_stop+0x130/0x130 [ 59.659601] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 59.664232] ? lock_timer_base+0x1a3/0x2b0 [ 59.668435] ? lock_timer_base+0x1eb/0x2b0 [ 59.672638] ? __internal_add_timer+0x2d0/0x2d0 [ 59.677276] ? trace_hardirqs_on+0xd/0x10 [ 59.681392] try_to_del_timer_sync+0xa2/0x120 [ 59.685852] ? del_timer+0x130/0x130 [ 59.689529] ? del_timer_sync+0xeb/0x240 [ 59.693559] del_timer_sync+0x18a/0x240 [ 59.697502] tun_free_netdev+0x105/0x1b0 [ 59.701528] ? tun_xdp+0x410/0x410 [ 59.705032] ? cpumask_next+0x24/0x30 [ 59.708800] ? netdev_refcnt_read+0xed/0x150 [ 59.713177] ? tun_xdp+0x410/0x410 [ 59.716681] netdev_run_todo+0x870/0xca0 [ 59.720707] ? do_group_exit+0x149/0x400 [ 59.724735] ? register_netdev+0x30/0x30 [ 59.728764] ? lock_downgrade+0x990/0x990 [ 59.732883] ? trace_hardirqs_on+0xd/0x10 [ 59.737010] ? refcount_sub_and_test+0x115/0x1b0 [ 59.741730] ? refcount_inc+0x50/0x50 [ 59.745494] ? refcount_inc+0x50/0x50 [ 59.749263] ? sk_destruct+0x4c/0x80 [ 59.752941] ? __sk_free+0x5c/0x230 [ 59.756532] ? sk_free+0x2f/0x40 [ 59.759863] ? __tun_detach+0x760/0x1570 [ 59.763892] ? tun_attach+0x1070/0x1070 [ 59.767838] ? locks_remove_file+0x3fa/0x5a0 [ 59.772213] ? fcntl_setlk+0x10d0/0x10d0 [ 59.776246] ? __fsnotify_parent+0xb4/0x3a0 [ 59.780538] ? fsnotify+0x1af0/0x1af0 [ 59.784308] ? rcu_note_context_switch+0x710/0x710 [ 59.789206] ? __tun_detach+0x1570/0x1570 [ 59.793325] rtnl_unlock+0xe/0x10 [ 59.796743] tun_chr_close+0x49/0x60 [ 59.800424] __fput+0x333/0x7f0 [ 59.803674] ? fput+0x140/0x140 [ 59.806921] ? trace_event_raw_event_sched_switch+0x770/0x770 [ 59.812774] ____fput+0x15/0x20 [ 59.816019] task_work_run+0x199/0x270 [ 59.819872] ? task_work_cancel+0x210/0x210 [ 59.824158] ? free_nsproxy+0x185/0x1f0 [ 59.828105] ? switch_task_namespaces+0xa2/0xc0 [ 59.832744] do_exit+0x9c8/0x1b00 [ 59.836164] ? mm_update_next_owner+0x930/0x930 [ 59.840798] ? find_held_lock+0x39/0x1d0 [ 59.844829] ? lock_downgrade+0x990/0x990 [ 59.848954] ? handle_mm_fault+0x410/0x8d0 [ 59.853153] ? __do_page_fault+0x31e/0xd60 [ 59.857354] ? __handle_mm_fault+0x39c0/0x39c0 [ 59.861901] ? vmacache_find+0x5f/0x280 [ 59.865843] ? up_read+0x1a/0x40 [ 59.869173] ? __do_page_fault+0x3d6/0xd60 [ 59.873374] ? mm_fault_error+0x2c0/0x2c0 [ 59.877489] ? do_vfs_ioctl+0x492/0x1530 [ 59.881515] ? _cond_resched+0x14/0x30 [ 59.885371] ? do_page_fault+0xee/0x720 [ 59.889315] ? __do_page_fault+0xd60/0xd60 [ 59.893515] ? putname+0xf3/0x130 [ 59.896934] do_group_exit+0x149/0x400 [ 59.900785] ? lockdep_sys_exit+0x47/0xf0 [ 59.904900] ? SyS_exit+0x30/0x30 [ 59.908325] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 59.913309] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 59.918034] SyS_exit_group+0x1d/0x20 [ 59.921802] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 59.926521] RIP: 0033:0x444ee9 [ 59.929674] RSP: 002b:00007ffd0d236288 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 59.937346] RAX: ffffffffffffffda RBX: 00007ffd0d2362d0 RCX: 0000000000444ee9 [ 59.944596] RDX: 0000000000444ee9 RSI: 0000000020927fd8 RDI: 0000000000000001