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.0.62' (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: [ 78.114355] ================================================================== [ 78.115432] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 78.116335] Write of size 8 at addr ffff8801d1d636b8 by task syzkaller162800/2979 [ 78.117333] [ 78.117564] CPU: 1 PID: 2979 Comm: syzkaller162800 Not tainted 4.14.0-rc5+ #47 [ 78.118527] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 78.119745] Call Trace: [ 78.120121] dump_stack+0x194/0x257 [ 78.120631] ? arch_local_irq_restore+0x53/0x53 [ 78.121265] ? show_regs_print_info+0x65/0x65 [ 78.121864] ? lock_acquire+0x1d5/0x580 [ 78.122408] ? lock_timer_base+0x1a3/0x2b0 [ 78.122975] ? detach_if_pending+0x557/0x610 [ 78.123565] print_address_description+0x73/0x250 [ 78.124210] ? detach_if_pending+0x557/0x610 [ 78.124798] kasan_report+0x25b/0x340 [ 78.125313] __asan_report_store8_noabort+0x17/0x20 [ 78.125995] detach_if_pending+0x557/0x610 [ 78.126564] ? trace_raw_output_tick_stop+0x130/0x130 [ 78.127255] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 78.127873] ? lock_timer_base+0x1a3/0x2b0 [ 78.128440] ? lock_timer_base+0x1eb/0x2b0 [ 78.129010] ? __internal_add_timer+0x2d0/0x2d0 [ 78.129631] ? lock_downgrade+0x990/0x990 [ 78.130203] ? trace_hardirqs_on+0xd/0x10 [ 78.130766] try_to_del_timer_sync+0xa2/0x120 [ 78.131366] ? del_timer+0x130/0x130 [ 78.131905] ? del_timer_sync+0xeb/0x240 [ 78.132488] del_timer_sync+0x18a/0x240 [ 78.133025] tun_free_netdev+0x105/0x1b0 [ 78.133571] ? tun_xdp+0x410/0x410 [ 78.134047] ? cpumask_next+0x24/0x30 [ 78.134884] ? netdev_refcnt_read+0xed/0x150 [ 78.139264] ? tun_xdp+0x410/0x410 [ 78.142798] netdev_run_todo+0x870/0xca0 [ 78.146831] ? do_group_exit+0x149/0x400 [ 78.150863] ? mark_held_locks+0xaf/0x100 [ 78.154983] ? register_netdev+0x30/0x30 [ 78.159013] ? find_held_lock+0x35/0x1d0 [ 78.163052] ? lock_downgrade+0x990/0x990 [ 78.167176] ? refcount_sub_and_test+0x115/0x1b0 [ 78.171900] ? refcount_inc+0x50/0x50 [ 78.175667] ? refcount_inc+0x50/0x50 [ 78.179438] ? sk_destruct+0x4c/0x80 [ 78.183121] ? __sk_free+0x5c/0x230 [ 78.186715] ? sk_free+0x2f/0x40 [ 78.190048] ? __tun_detach+0x176/0x1390 [ 78.194086] ? tun_attach+0xfa0/0xfa0 [ 78.197867] ? locks_remove_file+0x3fa/0x5a0 [ 78.202246] ? fcntl_setlk+0x10c0/0x10c0 [ 78.206278] ? __fsnotify_parent+0xb4/0x3a0 [ 78.210570] ? fsnotify+0x1af0/0x1af0 [ 78.214343] ? __tun_detach+0x1390/0x1390 [ 78.218462] ? __tun_detach+0x1390/0x1390 [ 78.222580] rtnl_unlock+0xe/0x10 [ 78.226001] tun_chr_close+0x49/0x60 [ 78.229684] __fput+0x327/0x7e0 [ 78.232938] ? fput+0x140/0x140 [ 78.236187] ? check_same_owner+0x320/0x320 [ 78.240484] ____fput+0x15/0x20 [ 78.243735] task_work_run+0x199/0x270 [ 78.247592] ? task_work_cancel+0x210/0x210 [ 78.251882] ? free_nsproxy+0x185/0x1f0 [ 78.255826] ? switch_task_namespaces+0xa2/0xc0 [ 78.260467] do_exit+0x9b5/0x1ad0 [ 78.263888] ? trace_hardirqs_on+0xd/0x10 [ 78.268012] ? mm_update_next_owner+0x930/0x930 [ 78.272649] ? mark_held_locks+0xaf/0x100 [ 78.276767] ? kfree+0xe4/0x250 [ 78.280014] ? kvfree+0x36/0x60 [ 78.283262] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 78.288248] ? trace_hardirqs_on+0xd/0x10 [ 78.292369] ? kvfree+0x3b/0x60 [ 78.295623] ? rtnl_unlock+0xe/0x10 [ 78.299222] ? __tun_chr_ioctl+0x27a/0x3d20 [ 78.303523] ? find_held_lock+0x35/0x1d0 [ 78.307561] ? __might_sleep+0x95/0x190 [ 78.311504] ? handle_mm_fault+0x248/0x8d0 [ 78.315714] ? selinux_file_ioctl+0x444/0x690 [ 78.320177] ? __fget_light+0x297/0x380 [ 78.324132] ? handle_mm_fault+0x410/0x8d0 [ 78.328339] ? tun_chr_compat_ioctl+0x29/0x30 [ 78.332802] ? tun_chr_compat_ioctl+0x29/0x30 [ 78.337269] do_group_exit+0x149/0x400 [ 78.341123] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 78.345498] ? SyS_exit+0x30/0x30 [ 78.348920] ? do_ioctl+0x60/0x60 [ 78.352344] ? do_fast_syscall_32+0x158/0xf05 [ 78.356808] ? do_group_exit+0x400/0x400 [ 78.360838] SyS_exit_group+0x1d/0x20 [ 78.364609] do_fast_syscall_32+0x3f2/0xf05 [ 78.368905] ? do_int80_syscall_32+0x940/0x940 [ 78.373452] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 78.378179] ? syscall_return_slowpath+0x2b3/0x510 [ 78.383078] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 78.388068] ? sysret32_from_system_call+0x5/0x3b [ 78.392880] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 78.397699] entry_SYSENTER_compat+0x51/0x60 [ 78.402076] RIP: 0023:0xf7f6fc79 [ 78.405405] RSP: 002b:00000000ffb2804c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 78.413077] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffb28238 [ 78.420312] RDX: 0000000008048ca6 RSI: 0000000000000036 RDI: 0000000000000004 [ 78.427547] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 78.434783] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 78.442020] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 78.449276] [ 78.450870] Allocated by task 2979: [ 78.454465] save_stack_trace+0x16/0x20 [ 78.458405] save_stack+0x43/0xd0 [ 78.461831] kasan_kmalloc+0xad/0xe0 [ 78.465511] __kmalloc_node+0x47/0x70 [ 78.469278] kvmalloc_node+0x64/0xd0 [ 78.472956] alloc_netdev_mqs+0x16e/0xed0 [ 78.477069] __tun_chr_ioctl+0x12b2/0x3d20 [ 78.481266] tun_chr_compat_ioctl+0x29/0x30 [ 78.485555] compat_SyS_ioctl+0x1d7/0x3290 [ 78.489759] do_fast_syscall_32+0x3f2/0xf05 [ 78.494046] entry_SYSENTER_compat+0x51/0x60 [ 78.498414] [ 78.500009] Freed by task 2979: [ 78.503254] save_stack_trace+0x16/0x20 [ 78.507195] save_stack+0x43/0xd0 [ 78.510611] kasan_slab_free+0x71/0xc0 [ 78.514463] kfree+0xca/0x250 [ 78.517535] kvfree+0x36/0x60 [ 78.520606] free_netdev+0x2cf/0x360 [ 78.524286] __tun_chr_ioctl+0x2cea/0x3d20 [ 78.528497] tun_chr_compat_ioctl+0x29/0x30 [ 78.532789] compat_SyS_ioctl+0x1d7/0x3290 [ 78.536991] do_fast_syscall_32+0x3f2/0xf05 [ 78.541280] entry_SYSENTER_compat+0x51/0x60 [ 78.545652] [ 78.547248] The buggy address belongs to the object at ffff8801d1d60380 [ 78.547248] which belongs to the cache kmalloc-16384 of size 16384 [ 78.560224] The buggy address is located 13112 bytes inside of [ 78.560224] 16384-byte region [ffff8801d1d60380, ffff8801d1d64380) [ 78.572408] The buggy address belongs to the page: [ 78.577303] page:ffffea0007475800 count:1 mapcount:0 mapping:ffff8801d1d60380 index:0x0 compound_mapcount: 0 [ 78.587235] flags: 0x200000000008100(slab|head) [ 78.591872] raw: 0200000000008100 ffff8801d1d60380 0000000000000000 0000000100000001 [ 78.599721] raw: ffffea000744f820 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 78.607564] page dumped because: kasan: bad access detected [ 78.613251] [ 78.614844] Memory state around the buggy address: [ 78.619739] ffff8801d1d63580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 78.627064] ffff8801d1d63600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 78.634390] >ffff8801d1d63680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 78.641722] ^ [ 78.646880] ffff8801d1d63700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 78.654206] ffff8801d1d63780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 78.661530] ================================================================== [ 78.668854] Disabling lock debugging due to kernel taint [ 78.674268] Kernel panic - not syncing: panic_on_warn set ... [ 78.674268] [ 78.681601] CPU: 1 PID: 2979 Comm: syzkaller162800 Tainted: G B 4.14.0-rc5+ #47 [ 78.690140] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 78.699458] Call Trace: [ 78.702012] dump_stack+0x194/0x257 [ 78.705609] ? arch_local_irq_restore+0x53/0x53 [ 78.710242] ? kasan_end_report+0x32/0x50 [ 78.714356] ? lock_downgrade+0x990/0x990 [ 78.718469] ? detach_if_pending+0x510/0x610 [ 78.722845] panic+0x1e4/0x417 [ 78.726002] ? __warn+0x1d9/0x1d9 [ 78.729433] ? detach_if_pending+0x557/0x610 [ 78.733810] kasan_end_report+0x50/0x50 [ 78.737764] kasan_report+0x144/0x340 [ 78.741532] __asan_report_store8_noabort+0x17/0x20 [ 78.746513] detach_if_pending+0x557/0x610 [ 78.750713] ? trace_raw_output_tick_stop+0x130/0x130 [ 78.755868] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 78.760501] ? lock_timer_base+0x1a3/0x2b0 [ 78.764702] ? lock_timer_base+0x1eb/0x2b0 [ 78.768904] ? __internal_add_timer+0x2d0/0x2d0 [ 78.773541] ? lock_downgrade+0x990/0x990 [ 78.777654] ? trace_hardirqs_on+0xd/0x10 [ 78.781770] try_to_del_timer_sync+0xa2/0x120 [ 78.786231] ? del_timer+0x130/0x130 [ 78.789913] ? del_timer_sync+0xeb/0x240 [ 78.794811] del_timer_sync+0x18a/0x240 [ 78.798753] tun_free_netdev+0x105/0x1b0 [ 78.802779] ? tun_xdp+0x410/0x410 [ 78.806285] ? cpumask_next+0x24/0x30 [ 78.810053] ? netdev_refcnt_read+0xed/0x150 [ 78.814427] ? tun_xdp+0x410/0x410 [ 78.817930] netdev_run_todo+0x870/0xca0 [ 78.821957] ? do_group_exit+0x149/0x400 [ 78.825987] ? mark_held_locks+0xaf/0x100 [ 78.830098] ? register_netdev+0x30/0x30 [ 78.834129] ? find_held_lock+0x35/0x1d0 [ 78.838189] ? lock_downgrade+0x990/0x990 [ 78.842309] ? refcount_sub_and_test+0x115/0x1b0 [ 78.847029] ? refcount_inc+0x50/0x50 [ 78.850794] ? refcount_inc+0x50/0x50 [ 78.854564] ? sk_destruct+0x4c/0x80 [ 78.858244] ? __sk_free+0x5c/0x230 [ 78.861836] ? sk_free+0x2f/0x40 [ 78.865170] ? __tun_detach+0x176/0x1390 [ 78.869201] ? tun_attach+0xfa0/0xfa0 [ 78.872970] ? locks_remove_file+0x3fa/0x5a0 [ 78.877347] ? fcntl_setlk+0x10c0/0x10c0 [ 78.881376] ? __fsnotify_parent+0xb4/0x3a0 [ 78.885664] ? fsnotify+0x1af0/0x1af0 [ 78.889432] ? __tun_detach+0x1390/0x1390 [ 78.893545] ? __tun_detach+0x1390/0x1390 [ 78.897659] rtnl_unlock+0xe/0x10 [ 78.901075] tun_chr_close+0x49/0x60 [ 78.904755] __fput+0x327/0x7e0 [ 78.908004] ? fput+0x140/0x140 [ 78.911250] ? check_same_owner+0x320/0x320 [ 78.915539] ____fput+0x15/0x20 [ 78.918784] task_work_run+0x199/0x270 [ 78.922637] ? task_work_cancel+0x210/0x210 [ 78.926922] ? free_nsproxy+0x185/0x1f0 [ 78.930862] ? switch_task_namespaces+0xa2/0xc0 [ 78.935497] do_exit+0x9b5/0x1ad0 [ 78.938913] ? trace_hardirqs_on+0xd/0x10 [ 78.943027] ? mm_update_next_owner+0x930/0x930 [ 78.947659] ? mark_held_locks+0xaf/0x100 [ 78.951773] ? kfree+0xe4/0x250 [ 78.955019] ? kvfree+0x36/0x60 [ 78.958266] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 78.963249] ? trace_hardirqs_on+0xd/0x10 [ 78.967372] ? kvfree+0x3b/0x60 [ 78.970619] ? rtnl_unlock+0xe/0x10 [ 78.974210] ? __tun_chr_ioctl+0x27a/0x3d20 [ 78.978503] ? find_held_lock+0x35/0x1d0 [ 78.982534] ? __might_sleep+0x95/0x190 [ 78.986471] ? handle_mm_fault+0x248/0x8d0 [ 78.990674] ? selinux_file_ioctl+0x444/0x690 [ 78.995142] ? __fget_light+0x297/0x380 [ 78.999090] ? handle_mm_fault+0x410/0x8d0 [ 79.003301] ? tun_chr_compat_ioctl+0x29/0x30 [ 79.007763] ? tun_chr_compat_ioctl+0x29/0x30 [ 79.012226] do_group_exit+0x149/0x400 [ 79.016079] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 79.020450] ? SyS_exit+0x30/0x30 [ 79.023871] ? do_ioctl+0x60/0x60 [ 79.027289] ? do_fast_syscall_32+0x158/0xf05 [ 79.031749] ? do_group_exit+0x400/0x400 [ 79.035774] SyS_exit_group+0x1d/0x20 [ 79.039537] do_fast_syscall_32+0x3f2/0xf05 [ 79.043826] ? do_int80_syscall_32+0x940/0x940 [ 79.048372] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 79.053095] ? syscall_return_slowpath+0x2b3/0x510 [ 79.057998] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 79.062980] ? sysret32_from_system_call+0x5/0x3b [ 79.067788] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 79.072607] entry_SYSENTER_compat+0x51/0x60 [ 79.076980] RIP: 0023:0xf7f6fc79 [ 79.080310] RSP: 002b:00000000ffb2804c EFLAGS: 00000286 ORIG_RAX: 00000000000000fc [ 79.087982] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffb28238 [ 79.095215] RDX: 0000000008048ca6 RSI: 0000000000000036 RDI: 0000000000000004 [ 79.102458] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 79.109701] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000