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-0,10.128.0.21' (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: [ 34.925406] ================================================================== [ 34.932825] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 34.939551] Write of size 8 at addr ffff8801ce5c3780 by task syzkaller395226/2988 [ 34.947139] [ 34.948742] CPU: 0 PID: 2988 Comm: syzkaller395226 Not tainted 4.13.0-next-20170908+ #18 [ 34.956935] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.966258] Call Trace: [ 34.968820] dump_stack+0x194/0x257 [ 34.972430] ? arch_local_irq_restore+0x53/0x53 [ 34.977071] ? show_regs_print_info+0x65/0x65 [ 34.981548] ? lock_timer_base+0x1a3/0x2b0 [ 34.985763] ? detach_if_pending+0x557/0x610 [ 34.990153] print_address_description+0x73/0x250 [ 34.994971] ? detach_if_pending+0x557/0x610 [ 34.999361] kasan_report+0x24e/0x340 [ 35.003140] __asan_report_store8_noabort+0x17/0x20 [ 35.008131] detach_if_pending+0x557/0x610 [ 35.012342] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.017506] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.022145] ? lock_timer_base+0x1a3/0x2b0 [ 35.026362] ? lock_timer_base+0x1eb/0x2b0 [ 35.030580] ? __internal_add_timer+0x2d0/0x2d0 [ 35.035224] ? trace_hardirqs_on+0xd/0x10 [ 35.039356] try_to_del_timer_sync+0xa2/0x120 [ 35.043831] ? del_timer+0x130/0x130 [ 35.047519] ? del_timer_sync+0xeb/0x240 [ 35.051558] del_timer_sync+0x18a/0x240 [ 35.055539] tun_free_netdev+0x105/0x1b0 [ 35.059574] ? tun_xdp+0x410/0x410 [ 35.063088] ? cpumask_next+0x24/0x30 [ 35.066954] ? netdev_refcnt_read+0xed/0x150 [ 35.071339] ? tun_xdp+0x410/0x410 [ 35.074852] netdev_run_todo+0x870/0xca0 [ 35.078887] ? do_group_exit+0x149/0x400 [ 35.082925] ? register_netdev+0x30/0x30 [ 35.086974] ? lock_downgrade+0x990/0x990 [ 35.091103] ? trace_hardirqs_on+0xd/0x10 [ 35.095245] ? refcount_sub_and_test+0x115/0x1b0 [ 35.099982] ? refcount_inc+0x50/0x50 [ 35.103757] ? refcount_inc+0x50/0x50 [ 35.107537] ? sk_destruct+0x4c/0x80 [ 35.111223] ? __sk_free+0x5c/0x230 [ 35.114826] ? sk_free+0x2f/0x40 [ 35.118172] ? __tun_detach+0x176/0x1390 [ 35.122218] ? tun_attach+0xf90/0xf90 [ 35.126003] ? do_raw_spin_trylock+0x190/0x190 [ 35.130565] ? locks_remove_file+0x3fa/0x5a0 [ 35.134950] ? fcntl_setlk+0x10d0/0x10d0 [ 35.138990] ? __fsnotify_parent+0xb4/0x3a0 [ 35.143291] ? fsnotify+0x1af0/0x1af0 [ 35.147071] ? __tun_detach+0x1390/0x1390 [ 35.151199] ? __tun_detach+0x1390/0x1390 [ 35.155324] rtnl_unlock+0xe/0x10 [ 35.158749] tun_chr_close+0x49/0x60 [ 35.162435] __fput+0x333/0x7f0 [ 35.165699] ? fput+0x140/0x140 [ 35.168952] ? check_same_owner+0x320/0x320 [ 35.173253] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.177724] ____fput+0x15/0x20 [ 35.180977] task_work_run+0x199/0x270 [ 35.184839] ? task_work_cancel+0x210/0x210 [ 35.189166] ? _raw_spin_unlock+0x22/0x30 [ 35.193286] ? switch_task_namespaces+0x87/0xc0 [ 35.197937] do_exit+0xa52/0x1b40 [ 35.201366] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.206357] ? check_noncircular+0x20/0x20 [ 35.210572] ? mm_update_next_owner+0x930/0x930 [ 35.215214] ? __pmd_alloc+0x4e0/0x4e0 [ 35.219083] ? find_held_lock+0x39/0x1d0 [ 35.223128] ? lock_downgrade+0x990/0x990 [ 35.227267] ? handle_mm_fault+0x410/0x8d0 [ 35.231472] ? down_read_trylock+0xdb/0x170 [ 35.235768] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.240320] ? vmacache_find+0x61/0x270 [ 35.244274] ? up_read+0x1a/0x40 [ 35.247631] ? __do_page_fault+0x35b/0xb60 [ 35.251841] ? do_vfs_ioctl+0x492/0x1530 [ 35.255881] ? do_page_fault+0xee/0x720 [ 35.259830] ? __do_page_fault+0xb60/0xb60 [ 35.264036] ? putname+0xf3/0x130 [ 35.267470] do_group_exit+0x149/0x400 [ 35.271331] ? lockdep_sys_exit+0x47/0xf0 [ 35.275451] ? SyS_exit+0x30/0x30 [ 35.278884] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.283876] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.288610] SyS_exit_group+0x1d/0x20 [ 35.292385] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.297112] RIP: 0033:0x4435b8 [ 35.300282] RSP: 002b:00007ffd0046e3f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 35.307961] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435b8 [ 35.315210] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 35.322451] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 35.329697] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 35.336937] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 35.344194] [ 35.345791] Allocated by task 2988: [ 35.349392] save_stack_trace+0x16/0x20 [ 35.353336] save_stack+0x43/0xd0 [ 35.356766] kasan_kmalloc+0xad/0xe0 [ 35.360457] __kmalloc_node+0x47/0x70 [ 35.364228] kvmalloc_node+0x64/0xd0 [ 35.367944] alloc_netdev_mqs+0x16e/0xed0 [ 35.372061] __tun_chr_ioctl+0x12be/0x3d20 [ 35.376266] tun_chr_ioctl+0x2a/0x40 [ 35.379952] do_vfs_ioctl+0x1b1/0x1530 [ 35.383815] SyS_ioctl+0x8f/0xc0 [ 35.387158] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.391888] [ 35.393487] Freed by task 2988: [ 35.396750] save_stack_trace+0x16/0x20 [ 35.400699] save_stack+0x43/0xd0 [ 35.404122] kasan_slab_free+0x71/0xc0 [ 35.407983] kfree+0xca/0x250 [ 35.411068] kvfree+0x36/0x60 [ 35.414151] free_netdev+0x2cf/0x360 [ 35.417838] __tun_chr_ioctl+0x2cf6/0x3d20 [ 35.422040] tun_chr_ioctl+0x2a/0x40 [ 35.425738] do_vfs_ioctl+0x1b1/0x1530 [ 35.429597] SyS_ioctl+0x8f/0xc0 [ 35.432941] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.437667] [ 35.439267] The buggy address belongs to the object at ffff8801ce5c0380 [ 35.439267] which belongs to the cache kmalloc-16384 of size 16384 [ 35.452253] The buggy address is located 13312 bytes inside of [ 35.452253] 16384-byte region [ffff8801ce5c0380, ffff8801ce5c4380) [ 35.464449] The buggy address belongs to the page: [ 35.469352] page:ffffea0007397000 count:1 mapcount:0 mapping:ffff8801ce5c0380 index:0x0 compound_mapcount: 0 [ 35.479309] flags: 0x200000000008100(slab|head) [ 35.483954] raw: 0200000000008100 ffff8801ce5c0380 0000000000000000 0000000100000001 [ 35.491807] raw: ffffea00073af420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.499656] page dumped because: kasan: bad access detected [ 35.505336] [ 35.506934] Memory state around the buggy address: [ 35.511859] ffff8801ce5c3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.519190] ffff8801ce5c3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.526519] >ffff8801ce5c3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.533849] ^ [ 35.537199] ffff8801ce5c3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.544540] ffff8801ce5c3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.551869] ================================================================== [ 35.559196] Disabling lock debugging due to kernel taint [ 35.564613] Kernel panic - not syncing: panic_on_warn set ... [ 35.564613] [ 35.571947] CPU: 0 PID: 2988 Comm: syzkaller395226 Tainted: G B 4.13.0-next-20170908+ #18 [ 35.581704] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.591023] Call Trace: [ 35.593581] dump_stack+0x194/0x257 [ 35.597177] ? arch_local_irq_restore+0x53/0x53 [ 35.601816] ? vprintk_default+0x28/0x30 [ 35.605844] ? detach_if_pending+0x4c0/0x610 [ 35.610230] panic+0x1e4/0x417 [ 35.613392] ? __warn+0x1d9/0x1d9 [ 35.616828] ? detach_if_pending+0x557/0x610 [ 35.621202] kasan_end_report+0x50/0x50 [ 35.625143] kasan_report+0x137/0x340 [ 35.628928] __asan_report_store8_noabort+0x17/0x20 [ 35.633917] detach_if_pending+0x557/0x610 [ 35.638119] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.643284] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.647917] ? lock_timer_base+0x1a3/0x2b0 [ 35.652117] ? lock_timer_base+0x1eb/0x2b0 [ 35.656317] ? __internal_add_timer+0x2d0/0x2d0 [ 35.660950] ? trace_hardirqs_on+0xd/0x10 [ 35.665064] try_to_del_timer_sync+0xa2/0x120 [ 35.669523] ? del_timer+0x130/0x130 [ 35.673200] ? del_timer_sync+0xeb/0x240 [ 35.677227] del_timer_sync+0x18a/0x240 [ 35.681167] tun_free_netdev+0x105/0x1b0 [ 35.685191] ? tun_xdp+0x410/0x410 [ 35.688694] ? cpumask_next+0x24/0x30 [ 35.692459] ? netdev_refcnt_read+0xed/0x150 [ 35.696834] ? tun_xdp+0x410/0x410 [ 35.700339] netdev_run_todo+0x870/0xca0 [ 35.704371] ? do_group_exit+0x149/0x400 [ 35.708397] ? register_netdev+0x30/0x30 [ 35.712424] ? lock_downgrade+0x990/0x990 [ 35.716535] ? trace_hardirqs_on+0xd/0x10 [ 35.720655] ? refcount_sub_and_test+0x115/0x1b0 [ 35.725377] ? refcount_inc+0x50/0x50 [ 35.729147] ? refcount_inc+0x50/0x50 [ 35.732917] ? sk_destruct+0x4c/0x80 [ 35.736599] ? __sk_free+0x5c/0x230 [ 35.740194] ? sk_free+0x2f/0x40 [ 35.743525] ? __tun_detach+0x176/0x1390 [ 35.747554] ? tun_attach+0xf90/0xf90 [ 35.751323] ? do_raw_spin_trylock+0x190/0x190 [ 35.755874] ? locks_remove_file+0x3fa/0x5a0 [ 35.760249] ? fcntl_setlk+0x10d0/0x10d0 [ 35.764277] ? __fsnotify_parent+0xb4/0x3a0 [ 35.768576] ? fsnotify+0x1af0/0x1af0 [ 35.772357] ? __tun_detach+0x1390/0x1390 [ 35.776467] ? __tun_detach+0x1390/0x1390 [ 35.780582] rtnl_unlock+0xe/0x10 [ 35.783999] tun_chr_close+0x49/0x60 [ 35.787691] __fput+0x333/0x7f0 [ 35.790937] ? fput+0x140/0x140 [ 35.794181] ? check_same_owner+0x320/0x320 [ 35.798469] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.802930] ____fput+0x15/0x20 [ 35.806191] task_work_run+0x199/0x270 [ 35.810043] ? task_work_cancel+0x210/0x210 [ 35.814328] ? _raw_spin_unlock+0x22/0x30 [ 35.818439] ? switch_task_namespaces+0x87/0xc0 [ 35.823072] do_exit+0xa52/0x1b40 [ 35.826490] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.831470] ? check_noncircular+0x20/0x20 [ 35.835677] ? mm_update_next_owner+0x930/0x930 [ 35.840309] ? __pmd_alloc+0x4e0/0x4e0 [ 35.844167] ? find_held_lock+0x39/0x1d0 [ 35.848200] ? lock_downgrade+0x990/0x990 [ 35.852322] ? handle_mm_fault+0x410/0x8d0 [ 35.856518] ? down_read_trylock+0xdb/0x170 [ 35.860812] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.865359] ? vmacache_find+0x61/0x270 [ 35.869301] ? up_read+0x1a/0x40 [ 35.872645] ? __do_page_fault+0x35b/0xb60 [ 35.876847] ? do_vfs_ioctl+0x492/0x1530 [ 35.880880] ? do_page_fault+0xee/0x720 [ 35.884820] ? __do_page_fault+0xb60/0xb60 [ 35.889022] ? putname+0xf3/0x130 [ 35.892446] do_group_exit+0x149/0x400 [ 35.896300] ? lockdep_sys_exit+0x47/0xf0 [ 35.900499] ? SyS_exit+0x30/0x30 [ 35.903917] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.908901] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.913622] SyS_exit_group+0x1d/0x20 [ 35.917389] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.922110] RIP: 0033:0x4435b8