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-kasan-gce-5,10.128.0.52' (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: [ 60.475490] ================================================================== [ 60.482957] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 60.489699] Write of size 8 at addr ffff8801ce15b780 by task syzkaller619948/2983 [ 60.497289] [ 60.498893] CPU: 0 PID: 2983 Comm: syzkaller619948 Not tainted 4.13.0+ #78 [ 60.505880] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 60.515206] Call Trace: [ 60.517769] dump_stack+0x194/0x257 [ 60.521371] ? arch_local_irq_restore+0x53/0x53 [ 60.526016] ? show_regs_print_info+0x65/0x65 [ 60.530488] ? lock_timer_base+0x1a3/0x2b0 [ 60.534722] ? detach_if_pending+0x557/0x610 [ 60.539104] print_address_description+0x73/0x250 [ 60.543920] ? detach_if_pending+0x557/0x610 [ 60.548302] kasan_report+0x24e/0x340 [ 60.552079] __asan_report_store8_noabort+0x17/0x20 [ 60.557091] detach_if_pending+0x557/0x610 [ 60.561299] ? trace_raw_output_tick_stop+0x130/0x130 [ 60.566463] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 60.571100] ? lock_timer_base+0x1a3/0x2b0 [ 60.575308] ? lock_timer_base+0x1eb/0x2b0 [ 60.579516] ? __internal_add_timer+0x2d0/0x2d0 [ 60.584158] ? trace_hardirqs_on+0xd/0x10 [ 60.588284] try_to_del_timer_sync+0xa2/0x120 [ 60.592762] ? del_timer+0x130/0x130 [ 60.596450] ? del_timer_sync+0xeb/0x240 [ 60.600490] del_timer_sync+0x18a/0x240 [ 60.604441] tun_free_netdev+0x105/0x1b0 [ 60.608473] ? tun_xdp+0x410/0x410 [ 60.611986] ? cpumask_next+0x24/0x30 [ 60.615763] ? netdev_refcnt_read+0xed/0x150 [ 60.620147] ? tun_xdp+0x410/0x410 [ 60.623661] netdev_run_todo+0x870/0xca0 [ 60.627694] ? do_group_exit+0x149/0x400 [ 60.631731] ? register_netdev+0x30/0x30 [ 60.635767] ? lock_downgrade+0x990/0x990 [ 60.639887] ? trace_hardirqs_on+0xd/0x10 [ 60.644022] ? refcount_sub_and_test+0x115/0x1b0 [ 60.648746] ? refcount_inc+0x50/0x50 [ 60.652517] ? refcount_inc+0x50/0x50 [ 60.656305] ? sk_destruct+0x4c/0x80 [ 60.659987] ? __sk_free+0x5c/0x230 [ 60.663588] ? sk_free+0x2f/0x40 [ 60.666926] ? __tun_detach+0x176/0x1390 [ 60.670967] ? tun_attach+0xf90/0xf90 [ 60.674748] ? locks_remove_file+0x3fa/0x5a0 [ 60.679128] ? fcntl_setlk+0x10d0/0x10d0 [ 60.683164] ? __fsnotify_parent+0xb4/0x3a0 [ 60.687459] ? fsnotify+0x1af0/0x1af0 [ 60.691233] ? __tun_detach+0x1390/0x1390 [ 60.695350] ? __tun_detach+0x1390/0x1390 [ 60.699470] rtnl_unlock+0xe/0x10 [ 60.702893] tun_chr_close+0x49/0x60 [ 60.706580] __fput+0x333/0x7f0 [ 60.709835] ? fput+0x140/0x140 [ 60.713088] ? check_same_owner+0x320/0x320 [ 60.717386] ____fput+0x15/0x20 [ 60.720637] task_work_run+0x199/0x270 [ 60.724496] ? task_work_cancel+0x210/0x210 [ 60.728790] ? free_nsproxy+0x185/0x1f0 [ 60.732735] ? switch_task_namespaces+0xa2/0xc0 [ 60.737378] do_exit+0xa52/0x1b40 [ 60.740806] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 60.745793] ? check_noncircular+0x20/0x20 [ 60.750004] ? mm_update_next_owner+0x930/0x930 [ 60.754644] ? __pmd_alloc+0x4e0/0x4e0 [ 60.758511] ? find_held_lock+0x39/0x1d0 [ 60.762554] ? lock_downgrade+0x990/0x990 [ 60.766697] ? handle_mm_fault+0x410/0x8d0 [ 60.770900] ? down_read_trylock+0xdb/0x170 [ 60.775193] ? __handle_mm_fault+0x39c0/0x39c0 [ 60.779744] ? vmacache_find+0x61/0x270 [ 60.783690] ? vmacache_update+0xfe/0x130 [ 60.787813] ? up_read+0x1a/0x40 [ 60.791152] ? __do_page_fault+0x35b/0xb60 [ 60.795356] ? do_vfs_ioctl+0x492/0x1530 [ 60.799395] ? do_page_fault+0xee/0x720 [ 60.803343] ? __do_page_fault+0xb60/0xb60 [ 60.807551] ? putname+0xf3/0x130 [ 60.810983] do_group_exit+0x149/0x400 [ 60.814843] ? lockdep_sys_exit+0x47/0xf0 [ 60.818960] ? SyS_exit+0x30/0x30 [ 60.822384] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 60.827376] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 60.832105] SyS_exit_group+0x1d/0x20 [ 60.835878] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.840603] RIP: 0033:0x445139 [ 60.843762] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 60.851445] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445139 [ 60.858684] RDX: 0000000000445139 RSI: 0000000020906fd8 RDI: 0000000000000001 [ 60.865927] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 60.873164] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402790 [ 60.880402] R13: 0000000000402820 R14: 0000000000000000 R15: 0000000000000000 [ 60.887662] [ 60.889263] Allocated by task 2983: [ 60.892864] save_stack_trace+0x16/0x20 [ 60.896810] save_stack+0x43/0xd0 [ 60.900234] kasan_kmalloc+0xad/0xe0 [ 60.903921] __kmalloc_node+0x47/0x70 [ 60.907698] kvmalloc_node+0x64/0xd0 [ 60.911384] alloc_netdev_mqs+0x16e/0xed0 [ 60.915502] __tun_chr_ioctl+0x12be/0x3d20 [ 60.919705] tun_chr_ioctl+0x2a/0x40 [ 60.923389] do_vfs_ioctl+0x1b1/0x1530 [ 60.927243] SyS_ioctl+0x8f/0xc0 [ 60.930583] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.935307] [ 60.936903] Freed by task 2983: [ 60.940152] save_stack_trace+0x16/0x20 [ 60.944093] save_stack+0x43/0xd0 [ 60.947516] kasan_slab_free+0x71/0xc0 [ 60.951370] kfree+0xca/0x250 [ 60.954443] kvfree+0x36/0x60 [ 60.957516] free_netdev+0x2cf/0x360 [ 60.961196] __tun_chr_ioctl+0x2cf6/0x3d20 [ 60.965399] tun_chr_ioctl+0x2a/0x40 [ 60.969080] do_vfs_ioctl+0x1b1/0x1530 [ 60.972935] SyS_ioctl+0x8f/0xc0 [ 60.976270] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 60.980990] [ 60.982588] The buggy address belongs to the object at ffff8801ce158380 [ 60.982588] which belongs to the cache kmalloc-16384 of size 16384 [ 60.995574] The buggy address is located 13312 bytes inside of [ 60.995574] 16384-byte region [ffff8801ce158380, ffff8801ce15c380) [ 61.007775] The buggy address belongs to the page: [ 61.012676] page:ffffea0007385600 count:1 mapcount:0 mapping:ffff8801ce158380 index:0x0 compound_mapcount: 0 [ 61.022621] flags: 0x200000000008100(slab|head) [ 61.027261] raw: 0200000000008100 ffff8801ce158380 0000000000000000 0000000100000001 [ 61.035112] raw: ffffea000738ca20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 61.042958] page dumped because: kasan: bad access detected [ 61.048634] [ 61.050230] Memory state around the buggy address: [ 61.055150] ffff8801ce15b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.062478] ffff8801ce15b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.069806] >ffff8801ce15b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.077131] ^ [ 61.080464] ffff8801ce15b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.087792] ffff8801ce15b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 61.095116] ================================================================== [ 61.102440] Disabling lock debugging due to kernel taint [ 61.107854] Kernel panic - not syncing: panic_on_warn set ... [ 61.107854] [ 61.115180] CPU: 0 PID: 2983 Comm: syzkaller619948 Tainted: G B 4.13.0+ #78 [ 61.123367] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 61.132684] Call Trace: [ 61.135242] dump_stack+0x194/0x257 [ 61.138838] ? arch_local_irq_restore+0x53/0x53 [ 61.143473] ? vprintk_default+0x28/0x30 [ 61.147501] ? detach_if_pending+0x470/0x610 [ 61.151877] panic+0x1e4/0x417 [ 61.155035] ? __warn+0x1d9/0x1d9 [ 61.158458] ? detach_if_pending+0x557/0x610 [ 61.162832] kasan_end_report+0x50/0x50 [ 61.166768] kasan_report+0x137/0x340 [ 61.170535] __asan_report_store8_noabort+0x17/0x20 [ 61.175514] detach_if_pending+0x557/0x610 [ 61.179716] ? trace_raw_output_tick_stop+0x130/0x130 [ 61.184879] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 61.189510] ? lock_timer_base+0x1a3/0x2b0 [ 61.193713] ? lock_timer_base+0x1eb/0x2b0 [ 61.197913] ? __internal_add_timer+0x2d0/0x2d0 [ 61.202551] ? trace_hardirqs_on+0xd/0x10 [ 61.206673] try_to_del_timer_sync+0xa2/0x120 [ 61.211134] ? del_timer+0x130/0x130 [ 61.214812] ? del_timer_sync+0xeb/0x240 [ 61.218840] del_timer_sync+0x18a/0x240 [ 61.222786] tun_free_netdev+0x105/0x1b0 [ 61.226815] ? tun_xdp+0x410/0x410 [ 61.230321] ? cpumask_next+0x24/0x30 [ 61.234088] ? netdev_refcnt_read+0xed/0x150 [ 61.238463] ? tun_xdp+0x410/0x410 [ 61.241968] netdev_run_todo+0x870/0xca0 [ 61.245992] ? do_group_exit+0x149/0x400 [ 61.250018] ? register_netdev+0x30/0x30 [ 61.254044] ? lock_downgrade+0x990/0x990 [ 61.258154] ? trace_hardirqs_on+0xd/0x10 [ 61.262275] ? refcount_sub_and_test+0x115/0x1b0 [ 61.266994] ? refcount_inc+0x50/0x50 [ 61.270761] ? refcount_inc+0x50/0x50 [ 61.274532] ? sk_destruct+0x4c/0x80 [ 61.278207] ? __sk_free+0x5c/0x230 [ 61.281797] ? sk_free+0x2f/0x40 [ 61.285126] ? __tun_detach+0x176/0x1390 [ 61.289156] ? tun_attach+0xf90/0xf90 [ 61.292927] ? locks_remove_file+0x3fa/0x5a0 [ 61.297298] ? fcntl_setlk+0x10d0/0x10d0 [ 61.301324] ? __fsnotify_parent+0xb4/0x3a0 [ 61.305609] ? fsnotify+0x1af0/0x1af0 [ 61.309373] ? __tun_detach+0x1390/0x1390 [ 61.313483] ? __tun_detach+0x1390/0x1390 [ 61.317595] rtnl_unlock+0xe/0x10 [ 61.321009] tun_chr_close+0x49/0x60 [ 61.324689] __fput+0x333/0x7f0 [ 61.327933] ? fput+0x140/0x140 [ 61.331176] ? check_same_owner+0x320/0x320 [ 61.335463] ____fput+0x15/0x20 [ 61.338708] task_work_run+0x199/0x270 [ 61.342562] ? task_work_cancel+0x210/0x210 [ 61.346848] ? free_nsproxy+0x185/0x1f0 [ 61.350785] ? switch_task_namespaces+0xa2/0xc0 [ 61.355420] do_exit+0xa52/0x1b40 [ 61.358839] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 61.363821] ? check_noncircular+0x20/0x20 [ 61.368021] ? mm_update_next_owner+0x930/0x930 [ 61.372653] ? __pmd_alloc+0x4e0/0x4e0 [ 61.376510] ? find_held_lock+0x39/0x1d0 [ 61.380541] ? lock_downgrade+0x990/0x990 [ 61.384662] ? handle_mm_fault+0x410/0x8d0 [ 61.388858] ? down_read_trylock+0xdb/0x170 [ 61.393143] ? __handle_mm_fault+0x39c0/0x39c0 [ 61.397687] ? vmacache_find+0x61/0x270 [ 61.401624] ? vmacache_update+0xfe/0x130 [ 61.405740] ? up_read+0x1a/0x40 [ 61.409071] ? __do_page_fault+0x35b/0xb60 [ 61.413270] ? do_vfs_ioctl+0x492/0x1530 [ 61.417315] ? do_page_fault+0xee/0x720 [ 61.421252] ? __do_page_fault+0xb60/0xb60 [ 61.425450] ? putname+0xf3/0x130 [ 61.428873] do_group_exit+0x149/0x400 [ 61.432723] ? lockdep_sys_exit+0x47/0xf0 [ 61.436835] ? SyS_exit+0x30/0x30 [ 61.440252] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 61.445234] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 61.449954] SyS_exit_group+0x1d/0x20 [ 61.453719] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 61.458439] RIP: 0033:0x445139 [ 61.461594] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 61.469265] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445139