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-386-4,10.128.15.229' (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: [ 33.323523] ================================================================== [ 33.324641] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 33.325540] Write of size 8 at addr ffff8801d1f036f8 by task syzkaller426053/2982 [ 33.326587] [ 33.326827] CPU: 0 PID: 2982 Comm: syzkaller426053 Not tainted 4.14.0-rc5+ #44 [ 33.327818] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.329050] Call Trace: [ 33.329422] dump_stack+0x194/0x257 [ 33.329918] ? arch_local_irq_restore+0x53/0x53 [ 33.330544] ? show_regs_print_info+0x65/0x65 [ 33.331158] ? lock_acquire+0x1d5/0x580 [ 33.331699] ? lock_timer_base+0x1a3/0x2b0 [ 33.332321] ? detach_if_pending+0x557/0x610 [ 33.332945] print_address_description+0x73/0x250 [ 33.333611] ? detach_if_pending+0x557/0x610 [ 33.334225] kasan_report+0x25b/0x340 [ 33.334757] __asan_report_store8_noabort+0x17/0x20 [ 33.335421] detach_if_pending+0x557/0x610 [ 33.335999] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.336723] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.337351] ? lock_timer_base+0x1a3/0x2b0 [ 33.337944] ? lock_timer_base+0x1eb/0x2b0 [ 33.338523] ? __internal_add_timer+0x2d0/0x2d0 [ 33.339181] ? lock_downgrade+0x990/0x990 [ 33.339760] ? trace_hardirqs_on+0xd/0x10 [ 33.340331] try_to_del_timer_sync+0xa2/0x120 [ 33.340962] ? del_timer+0x130/0x130 [ 33.341462] ? del_timer_sync+0xeb/0x240 [ 33.342018] del_timer_sync+0x18a/0x240 [ 33.342573] tun_free_netdev+0x105/0x1b0 [ 33.343123] ? tun_xdp+0x410/0x410 [ 33.343606] ? cpumask_next+0x24/0x30 [ 33.344127] ? netdev_refcnt_read+0xed/0x150 [ 33.348514] ? tun_xdp+0x410/0x410 [ 33.352025] netdev_run_todo+0x870/0xca0 [ 33.356064] ? do_group_exit+0x149/0x400 [ 33.360099] ? mark_held_locks+0xaf/0x100 [ 33.364218] ? register_netdev+0x30/0x30 [ 33.368249] ? find_held_lock+0x35/0x1d0 [ 33.372288] ? lock_downgrade+0x990/0x990 [ 33.376411] ? refcount_sub_and_test+0x115/0x1b0 [ 33.381136] ? refcount_inc+0x50/0x50 [ 33.384904] ? refcount_inc+0x50/0x50 [ 33.388674] ? sk_destruct+0x4c/0x80 [ 33.392356] ? __sk_free+0x5c/0x230 [ 33.395949] ? sk_free+0x2f/0x40 [ 33.399286] ? __tun_detach+0x176/0x1390 [ 33.403324] ? tun_attach+0xfa0/0xfa0 [ 33.407102] ? locks_remove_file+0x3fa/0x5a0 [ 33.411478] ? fcntl_setlk+0x10c0/0x10c0 [ 33.415507] ? __fsnotify_parent+0xb4/0x3a0 [ 33.419797] ? fsnotify+0x1af0/0x1af0 [ 33.423567] ? __tun_detach+0x1390/0x1390 [ 33.427681] ? __tun_detach+0x1390/0x1390 [ 33.431796] rtnl_unlock+0xe/0x10 [ 33.435300] tun_chr_close+0x49/0x60 [ 33.438985] __fput+0x327/0x7e0 [ 33.442252] ? fput+0x140/0x140 [ 33.445503] ? check_same_owner+0x320/0x320 [ 33.449807] ____fput+0x15/0x20 [ 33.453070] task_work_run+0x199/0x270 [ 33.456933] ? task_work_cancel+0x210/0x210 [ 33.461222] ? free_nsproxy+0x185/0x1f0 [ 33.465165] ? switch_task_namespaces+0xa2/0xc0 [ 33.469804] do_exit+0x9b5/0x1ad0 [ 33.473226] ? __handle_mm_fault+0xf07/0x39c0 [ 33.477691] ? mm_update_next_owner+0x930/0x930 [ 33.482324] ? lock_release+0xa40/0xa40 [ 33.486262] ? mark_held_locks+0xaf/0x100 [ 33.490376] ? kfree+0xe4/0x250 [ 33.493626] ? kvfree+0x36/0x60 [ 33.496876] ? trace_hardirqs_on+0xd/0x10 [ 33.500998] ? __handle_mm_fault+0x587/0x39c0 [ 33.505465] ? check_noncircular+0x20/0x20 [ 33.509663] ? __pmd_alloc+0x4e0/0x4e0 [ 33.513522] ? find_held_lock+0x35/0x1d0 [ 33.517556] ? handle_mm_fault+0x248/0x8d0 [ 33.521765] ? find_held_lock+0x35/0x1d0 [ 33.525800] ? __do_page_fault+0x64c/0xd60 [ 33.530005] ? lock_downgrade+0x990/0x990 [ 33.534137] ? handle_mm_fault+0x410/0x8d0 [ 33.538337] ? down_read_trylock+0xdb/0x170 [ 33.542628] ? __do_page_fault+0x31e/0xd60 [ 33.546841] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.551392] ? vmacache_find+0x5f/0x280 [ 33.555332] ? vmacache_update+0xfe/0x130 [ 33.559453] do_group_exit+0x149/0x400 [ 33.563307] ? __do_page_fault+0x3d6/0xd60 [ 33.567506] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 33.571884] ? SyS_exit+0x30/0x30 [ 33.575315] ? do_fast_syscall_32+0x158/0xf05 [ 33.579785] ? do_group_exit+0x400/0x400 [ 33.583813] SyS_exit_group+0x1d/0x20 [ 33.587579] do_fast_syscall_32+0x3f2/0xf05 [ 33.591873] ? do_int80_syscall_32+0x940/0x940 [ 33.596432] ? syscall_return_slowpath+0x2b3/0x510 [ 33.601327] ? finish_task_switch+0x1aa/0x740 [ 33.605791] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 33.610778] ? retint_user+0x18/0x20 [ 33.614464] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 33.619281] entry_SYSENTER_compat+0x51/0x60 [ 33.623653] RIP: 0023:0xf7fd1c79 [ 33.626983] RSP: 002b:000000000820fe3c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 33.634655] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 000000000820ff6c [ 33.641897] RDX: 000000000804925a RSI: 0000000000000036 RDI: 0000000000000005 [ 33.649139] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 33.656379] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 33.663617] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 33.670870] [ 33.672464] Allocated by task 2982: [ 33.676060] save_stack_trace+0x16/0x20 [ 33.680006] save_stack+0x43/0xd0 [ 33.683431] kasan_kmalloc+0xad/0xe0 [ 33.687112] __kmalloc_node+0x47/0x70 [ 33.690882] kvmalloc_node+0x64/0xd0 [ 33.694571] alloc_netdev_mqs+0x16e/0xed0 [ 33.698690] __tun_chr_ioctl+0x12b2/0x3d20 [ 33.702897] tun_chr_compat_ioctl+0x29/0x30 [ 33.707185] compat_SyS_ioctl+0x1d7/0x3290 [ 33.711383] do_fast_syscall_32+0x3f2/0xf05 [ 33.715670] entry_SYSENTER_compat+0x51/0x60 [ 33.720039] [ 33.721633] Freed by task 2982: [ 33.724879] save_stack_trace+0x16/0x20 [ 33.728820] save_stack+0x43/0xd0 [ 33.732237] kasan_slab_free+0x71/0xc0 [ 33.736087] kfree+0xca/0x250 [ 33.739157] kvfree+0x36/0x60 [ 33.742229] free_netdev+0x2cf/0x360 [ 33.745907] __tun_chr_ioctl+0x2cea/0x3d20 [ 33.750104] tun_chr_compat_ioctl+0x29/0x30 [ 33.754390] compat_SyS_ioctl+0x1d7/0x3290 [ 33.758589] do_fast_syscall_32+0x3f2/0xf05 [ 33.762876] entry_SYSENTER_compat+0x51/0x60 [ 33.767244] [ 33.768840] The buggy address belongs to the object at ffff8801d1f003c0 [ 33.768840] which belongs to the cache kmalloc-16384 of size 16384 [ 33.781808] The buggy address is located 13112 bytes inside of [ 33.781808] 16384-byte region [ffff8801d1f003c0, ffff8801d1f043c0) [ 33.793995] The buggy address belongs to the page: [ 33.798897] page:ffffea000747c000 count:1 mapcount:0 mapping:ffff8801d1f003c0 index:0x0 compound_mapcount: 0 [ 33.808827] flags: 0x200000000008100(slab|head) [ 33.813467] raw: 0200000000008100 ffff8801d1f003c0 0000000000000000 0000000100000001 [ 33.821318] raw: ffffea000747b020 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 33.829161] page dumped because: kasan: bad access detected [ 33.834833] [ 33.836430] Memory state around the buggy address: [ 33.841324] ffff8801d1f03580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.848650] ffff8801d1f03600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.855972] >ffff8801d1f03680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.863294] ^ [ 33.870531] ffff8801d1f03700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.877852] ffff8801d1f03780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.885172] ================================================================== [ 33.892500] Disabling lock debugging due to kernel taint [ 33.897929] Kernel panic - not syncing: panic_on_warn set ... [ 33.897929] [ 33.905262] CPU: 0 PID: 2982 Comm: syzkaller426053 Tainted: G B 4.14.0-rc5+ #44 [ 33.913799] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.923120] Call Trace: [ 33.925680] dump_stack+0x194/0x257 [ 33.929272] ? arch_local_irq_restore+0x53/0x53 [ 33.933906] ? kasan_end_report+0x32/0x50 [ 33.938025] ? lock_downgrade+0x990/0x990 [ 33.942145] ? detach_if_pending+0x510/0x610 [ 33.946522] panic+0x1e4/0x417 [ 33.949678] ? __warn+0x1d9/0x1d9 [ 33.953107] ? detach_if_pending+0x557/0x610 [ 33.957504] kasan_end_report+0x50/0x50 [ 33.961446] kasan_report+0x144/0x340 [ 33.965213] __asan_report_store8_noabort+0x17/0x20 [ 33.970193] detach_if_pending+0x557/0x610 [ 33.974395] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.979549] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.984181] ? lock_timer_base+0x1a3/0x2b0 [ 33.988379] ? lock_timer_base+0x1eb/0x2b0 [ 33.992578] ? __internal_add_timer+0x2d0/0x2d0 [ 33.997213] ? lock_downgrade+0x990/0x990 [ 34.001330] ? trace_hardirqs_on+0xd/0x10 [ 34.005448] try_to_del_timer_sync+0xa2/0x120 [ 34.009915] ? del_timer+0x130/0x130 [ 34.013592] ? del_timer_sync+0xeb/0x240 [ 34.017619] del_timer_sync+0x18a/0x240 [ 34.021564] tun_free_netdev+0x105/0x1b0 [ 34.025590] ? tun_xdp+0x410/0x410 [ 34.029099] ? cpumask_next+0x24/0x30 [ 34.032867] ? netdev_refcnt_read+0xed/0x150 [ 34.037243] ? tun_xdp+0x410/0x410 [ 34.040754] netdev_run_todo+0x870/0xca0 [ 34.044779] ? do_group_exit+0x149/0x400 [ 34.048808] ? mark_held_locks+0xaf/0x100 [ 34.052921] ? register_netdev+0x30/0x30 [ 34.056946] ? find_held_lock+0x35/0x1d0 [ 34.060984] ? lock_downgrade+0x990/0x990 [ 34.065105] ? refcount_sub_and_test+0x115/0x1b0 [ 34.069825] ? refcount_inc+0x50/0x50 [ 34.073608] ? refcount_inc+0x50/0x50 [ 34.077378] ? sk_destruct+0x4c/0x80 [ 34.081054] ? __sk_free+0x5c/0x230 [ 34.084645] ? sk_free+0x2f/0x40 [ 34.087989] ? __tun_detach+0x176/0x1390 [ 34.092020] ? tun_attach+0xfa0/0xfa0 [ 34.095793] ? locks_remove_file+0x3fa/0x5a0 [ 34.100175] ? fcntl_setlk+0x10c0/0x10c0 [ 34.104206] ? __fsnotify_parent+0xb4/0x3a0 [ 34.108501] ? fsnotify+0x1af0/0x1af0 [ 34.112281] ? __tun_detach+0x1390/0x1390 [ 34.116394] ? __tun_detach+0x1390/0x1390 [ 34.120509] rtnl_unlock+0xe/0x10 [ 34.123928] tun_chr_close+0x49/0x60 [ 34.127606] __fput+0x327/0x7e0 [ 34.130854] ? fput+0x140/0x140 [ 34.134099] ? check_same_owner+0x320/0x320 [ 34.138388] ____fput+0x15/0x20 [ 34.141630] task_work_run+0x199/0x270 [ 34.145484] ? task_work_cancel+0x210/0x210 [ 34.149769] ? free_nsproxy+0x185/0x1f0 [ 34.153719] ? switch_task_namespaces+0xa2/0xc0 [ 34.158354] do_exit+0x9b5/0x1ad0 [ 34.161772] ? __handle_mm_fault+0xf07/0x39c0 [ 34.166232] ? mm_update_next_owner+0x930/0x930 [ 34.170866] ? lock_release+0xa40/0xa40 [ 34.174808] ? mark_held_locks+0xaf/0x100 [ 34.178928] ? kfree+0xe4/0x250 [ 34.182178] ? kvfree+0x36/0x60 [ 34.185432] ? trace_hardirqs_on+0xd/0x10 [ 34.189561] ? __handle_mm_fault+0x587/0x39c0 [ 34.194039] ? check_noncircular+0x20/0x20 [ 34.198251] ? __pmd_alloc+0x4e0/0x4e0 [ 34.202118] ? find_held_lock+0x35/0x1d0 [ 34.206157] ? handle_mm_fault+0x248/0x8d0 [ 34.210366] ? find_held_lock+0x35/0x1d0 [ 34.214403] ? __do_page_fault+0x64c/0xd60 [ 34.218609] ? lock_downgrade+0x990/0x990 [ 34.222726] ? handle_mm_fault+0x410/0x8d0 [ 34.226925] ? down_read_trylock+0xdb/0x170 [ 34.231210] ? __do_page_fault+0x31e/0xd60 [ 34.235412] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.239958] ? vmacache_find+0x5f/0x280 [ 34.243907] ? vmacache_update+0xfe/0x130 [ 34.248029] do_group_exit+0x149/0x400 [ 34.251884] ? __do_page_fault+0x3d6/0xd60 [ 34.256082] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 34.260453] ? SyS_exit+0x30/0x30 [ 34.263872] ? do_fast_syscall_32+0x158/0xf05 [ 34.268329] ? do_group_exit+0x400/0x400 [ 34.272355] SyS_exit_group+0x1d/0x20 [ 34.276126] do_fast_syscall_32+0x3f2/0xf05 [ 34.280417] ? do_int80_syscall_32+0x940/0x940 [ 34.284973] ? syscall_return_slowpath+0x2b3/0x510 [ 34.289866] ? finish_task_switch+0x1aa/0x740 [ 34.294331] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 34.299317] ? retint_user+0x18/0x20 [ 34.303005] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 34.307816] entry_SYSENTER_compat+0x51/0x60 [ 34.312189] RIP: 0023:0xf7fd1c79 [ 34.315517] RSP: 002b:000000000820fe3c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc