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-1,10.128.15.228' (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: [ 110.411393] ================================================================== [ 110.412578] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 110.413466] Write of size 8 at addr ffff8801d1ea36b8 by task syzkaller901306/2979 [ 110.414461] [ 110.414694] CPU: 1 PID: 2979 Comm: syzkaller901306 Not tainted 4.14.0-rc5+ #47 [ 110.415671] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 110.416888] Call Trace: [ 110.417246] dump_stack+0x194/0x257 [ 110.417738] ? arch_local_irq_restore+0x53/0x53 [ 110.418360] ? show_regs_print_info+0x65/0x65 [ 110.418963] ? lock_acquire+0x1d5/0x580 [ 110.419497] ? lock_timer_base+0x1a3/0x2b0 [ 110.420081] ? detach_if_pending+0x557/0x610 [ 110.420672] print_address_description+0x73/0x250 [ 110.421328] ? detach_if_pending+0x557/0x610 [ 110.421934] kasan_report+0x25b/0x340 [ 110.422449] __asan_report_store8_noabort+0x17/0x20 [ 110.423114] detach_if_pending+0x557/0x610 [ 110.423682] ? trace_raw_output_tick_stop+0x130/0x130 [ 110.424376] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 110.424997] ? lock_timer_base+0x1a3/0x2b0 [ 110.425610] ? lock_timer_base+0x1eb/0x2b0 [ 110.426184] ? __internal_add_timer+0x2d0/0x2d0 [ 110.426824] ? lock_downgrade+0x990/0x990 [ 110.427379] ? trace_hardirqs_on+0xd/0x10 [ 110.427983] try_to_del_timer_sync+0xa2/0x120 [ 110.428600] ? del_timer+0x130/0x130 [ 110.429101] ? del_timer_sync+0xeb/0x240 [ 110.429656] del_timer_sync+0x18a/0x240 [ 110.430195] tun_free_netdev+0x105/0x1b0 [ 110.430741] ? tun_xdp+0x410/0x410 [ 110.431216] ? cpumask_next+0x24/0x30 [ 110.432972] ? netdev_refcnt_read+0xed/0x150 [ 110.437353] ? tun_xdp+0x410/0x410 [ 110.440866] netdev_run_todo+0x870/0xca0 [ 110.444897] ? do_group_exit+0x149/0x400 [ 110.448928] ? mark_held_locks+0xaf/0x100 [ 110.453042] ? register_netdev+0x30/0x30 [ 110.457074] ? find_held_lock+0x35/0x1d0 [ 110.461113] ? lock_downgrade+0x990/0x990 [ 110.465235] ? refcount_sub_and_test+0x115/0x1b0 [ 110.469960] ? refcount_inc+0x50/0x50 [ 110.473726] ? refcount_inc+0x50/0x50 [ 110.477498] ? sk_destruct+0x4c/0x80 [ 110.481179] ? __sk_free+0x5c/0x230 [ 110.484774] ? sk_free+0x2f/0x40 [ 110.488106] ? __tun_detach+0x176/0x1390 [ 110.492143] ? tun_attach+0xfa0/0xfa0 [ 110.495913] ? lock_downgrade+0x990/0x990 [ 110.500029] ? locks_remove_file+0x3fa/0x5a0 [ 110.504404] ? fcntl_setlk+0x10c0/0x10c0 [ 110.508435] ? __fsnotify_parent+0xb4/0x3a0 [ 110.512724] ? fsnotify+0x1af0/0x1af0 [ 110.516496] ? __tun_detach+0x1390/0x1390 [ 110.520609] ? __tun_detach+0x1390/0x1390 [ 110.524727] rtnl_unlock+0xe/0x10 [ 110.528147] tun_chr_close+0x49/0x60 [ 110.531826] __fput+0x327/0x7e0 [ 110.535078] ? fput+0x140/0x140 [ 110.538326] ? check_same_owner+0x320/0x320 [ 110.542614] ? _raw_spin_unlock_irq+0x27/0x70 [ 110.547089] ____fput+0x15/0x20 [ 110.550337] task_work_run+0x199/0x270 [ 110.554196] ? task_work_cancel+0x210/0x210 [ 110.558483] ? _raw_spin_unlock+0x22/0x30 [ 110.562598] ? switch_task_namespaces+0x87/0xc0 [ 110.567237] do_exit+0x9b5/0x1ad0 [ 110.570656] ? __handle_mm_fault+0xf07/0x39c0 [ 110.575136] ? mm_update_next_owner+0x930/0x930 [ 110.579770] ? lock_release+0xa40/0xa40 [ 110.583708] ? do_raw_spin_trylock+0x190/0x190 [ 110.588259] ? kfree+0xe4/0x250 [ 110.591504] ? kvfree+0x36/0x60 [ 110.594762] ? __handle_mm_fault+0x587/0x39c0 [ 110.599228] ? check_noncircular+0x20/0x20 [ 110.603427] ? __pmd_alloc+0x4e0/0x4e0 [ 110.607287] ? find_held_lock+0x35/0x1d0 [ 110.611323] ? handle_mm_fault+0x248/0x8d0 [ 110.615527] ? find_held_lock+0x35/0x1d0 [ 110.619563] ? __do_page_fault+0x64c/0xd60 [ 110.623767] ? lock_downgrade+0x990/0x990 [ 110.627888] ? handle_mm_fault+0x410/0x8d0 [ 110.632087] ? down_read_trylock+0xdb/0x170 [ 110.636373] ? __do_page_fault+0x31e/0xd60 [ 110.640574] ? __handle_mm_fault+0x39c0/0x39c0 [ 110.645122] ? vmacache_find+0x5f/0x280 [ 110.649061] ? vmacache_update+0xfe/0x130 [ 110.653181] do_group_exit+0x149/0x400 [ 110.657034] ? __do_page_fault+0x3d6/0xd60 [ 110.661233] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 110.665609] ? SyS_exit+0x30/0x30 [ 110.669043] ? do_fast_syscall_32+0x158/0xf05 [ 110.673503] ? do_group_exit+0x400/0x400 [ 110.677533] SyS_exit_group+0x1d/0x20 [ 110.681304] do_fast_syscall_32+0x3f2/0xf05 [ 110.685601] ? do_int80_syscall_32+0x940/0x940 [ 110.690151] ? kasan_check_read+0x11/0x20 [ 110.694268] ? syscall_return_slowpath+0x510/0x510 [ 110.699165] ? SyS_rt_sigaction+0x94/0x1b0 [ 110.703368] ? SyS_sigprocmask+0x4b0/0x4b0 [ 110.707571] ? SyS_read+0x184/0x220 [ 110.711169] ? retint_user+0x18/0x20 [ 110.715858] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 110.720686] entry_SYSENTER_compat+0x51/0x60 [ 110.725061] RIP: 0023:0xf7fe7c79 [ 110.728392] RSP: 002b:00000000ffbde25c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 110.736071] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 110.743312] RDX: 0000000000000000 RSI: 00000000080db878 RDI: 00000000080f22a0 [ 110.750551] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 110.757787] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 110.765022] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 110.772278] [ 110.774394] Allocated by task 2979: [ 110.777990] save_stack_trace+0x16/0x20 [ 110.781932] save_stack+0x43/0xd0 [ 110.785763] kasan_kmalloc+0xad/0xe0 [ 110.789442] __kmalloc_node+0x47/0x70 [ 110.793209] kvmalloc_node+0x64/0xd0 [ 110.796889] alloc_netdev_mqs+0x16e/0xed0 [ 110.801010] __tun_chr_ioctl+0x12b2/0x3d20 [ 110.805209] tun_chr_compat_ioctl+0x29/0x30 [ 110.809496] compat_SyS_ioctl+0x1d7/0x3290 [ 110.813700] do_fast_syscall_32+0x3f2/0xf05 [ 110.817990] entry_SYSENTER_compat+0x51/0x60 [ 110.822359] [ 110.823953] Freed by task 2979: [ 110.827198] save_stack_trace+0x16/0x20 [ 110.831135] save_stack+0x43/0xd0 [ 110.834551] kasan_slab_free+0x71/0xc0 [ 110.838401] kfree+0xca/0x250 [ 110.841470] kvfree+0x36/0x60 [ 110.844540] free_netdev+0x2cf/0x360 [ 110.848219] __tun_chr_ioctl+0x2cea/0x3d20 [ 110.852424] tun_chr_compat_ioctl+0x29/0x30 [ 110.856718] compat_SyS_ioctl+0x1d7/0x3290 [ 110.860920] do_fast_syscall_32+0x3f2/0xf05 [ 110.865209] entry_SYSENTER_compat+0x51/0x60 [ 110.869580] [ 110.871176] The buggy address belongs to the object at ffff8801d1ea0380 [ 110.871176] which belongs to the cache kmalloc-16384 of size 16384 [ 110.884144] The buggy address is located 13112 bytes inside of [ 110.884144] 16384-byte region [ffff8801d1ea0380, ffff8801d1ea4380) [ 110.896329] The buggy address belongs to the page: [ 110.901224] page:ffffea000747a800 count:1 mapcount:0 mapping:ffff8801d1ea0380 index:0x0 compound_mapcount: 0 [ 110.911160] flags: 0x200000000008100(slab|head) [ 110.915800] raw: 0200000000008100 ffff8801d1ea0380 0000000000000000 0000000100000001 [ 110.923648] raw: ffffea0007447a20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 110.931492] page dumped because: kasan: bad access detected [ 110.937164] [ 110.938757] Memory state around the buggy address: [ 110.943659] ffff8801d1ea3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 110.950982] ffff8801d1ea3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 110.958305] >ffff8801d1ea3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 110.965636] ^ [ 110.970787] ffff8801d1ea3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 110.978113] ffff8801d1ea3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 110.985437] ================================================================== [ 110.992757] Disabling lock debugging due to kernel taint [ 110.998169] Kernel panic - not syncing: panic_on_warn set ... [ 110.998169] [ 111.005497] CPU: 1 PID: 2979 Comm: syzkaller901306 Tainted: G B 4.14.0-rc5+ #47 [ 111.014035] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 111.023355] Call Trace: [ 111.025911] dump_stack+0x194/0x257 [ 111.029503] ? arch_local_irq_restore+0x53/0x53 [ 111.034138] ? kasan_end_report+0x32/0x50 [ 111.038250] ? lock_downgrade+0x990/0x990 [ 111.042367] ? detach_if_pending+0x510/0x610 [ 111.046740] panic+0x1e4/0x417 [ 111.049904] ? __warn+0x1d9/0x1d9 [ 111.053326] ? detach_if_pending+0x557/0x610 [ 111.057698] kasan_end_report+0x50/0x50 [ 111.061636] kasan_report+0x144/0x340 [ 111.065406] __asan_report_store8_noabort+0x17/0x20 [ 111.070386] detach_if_pending+0x557/0x610 [ 111.074592] ? trace_raw_output_tick_stop+0x130/0x130 [ 111.079749] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 111.084380] ? lock_timer_base+0x1a3/0x2b0 [ 111.088580] ? lock_timer_base+0x1eb/0x2b0 [ 111.092782] ? __internal_add_timer+0x2d0/0x2d0 [ 111.097417] ? lock_downgrade+0x990/0x990 [ 111.101531] ? trace_hardirqs_on+0xd/0x10 [ 111.105651] try_to_del_timer_sync+0xa2/0x120 [ 111.110124] ? del_timer+0x130/0x130 [ 111.113810] ? del_timer_sync+0xeb/0x240 [ 111.117839] del_timer_sync+0x18a/0x240 [ 111.121780] tun_free_netdev+0x105/0x1b0 [ 111.125803] ? tun_xdp+0x410/0x410 [ 111.129306] ? cpumask_next+0x24/0x30 [ 111.133073] ? netdev_refcnt_read+0xed/0x150 [ 111.137445] ? tun_xdp+0x410/0x410 [ 111.140949] netdev_run_todo+0x870/0xca0 [ 111.144976] ? do_group_exit+0x149/0x400 [ 111.149003] ? mark_held_locks+0xaf/0x100 [ 111.153114] ? register_netdev+0x30/0x30 [ 111.157140] ? find_held_lock+0x35/0x1d0 [ 111.161170] ? lock_downgrade+0x990/0x990 [ 111.165285] ? refcount_sub_and_test+0x115/0x1b0 [ 111.170003] ? refcount_inc+0x50/0x50 [ 111.173766] ? refcount_inc+0x50/0x50 [ 111.177534] ? sk_destruct+0x4c/0x80 [ 111.181211] ? __sk_free+0x5c/0x230 [ 111.184801] ? sk_free+0x2f/0x40 [ 111.188130] ? __tun_detach+0x176/0x1390 [ 111.192160] ? tun_attach+0xfa0/0xfa0 [ 111.195928] ? lock_downgrade+0x990/0x990 [ 111.200043] ? locks_remove_file+0x3fa/0x5a0 [ 111.204416] ? fcntl_setlk+0x10c0/0x10c0 [ 111.208442] ? __fsnotify_parent+0xb4/0x3a0 [ 111.212727] ? fsnotify+0x1af0/0x1af0 [ 111.216494] ? __tun_detach+0x1390/0x1390 [ 111.220608] ? __tun_detach+0x1390/0x1390 [ 111.224723] rtnl_unlock+0xe/0x10 [ 111.228147] tun_chr_close+0x49/0x60 [ 111.231827] __fput+0x327/0x7e0 [ 111.235074] ? fput+0x140/0x140 [ 111.238321] ? check_same_owner+0x320/0x320 [ 111.242607] ? _raw_spin_unlock_irq+0x27/0x70 [ 111.247070] ____fput+0x15/0x20 [ 111.250315] task_work_run+0x199/0x270 [ 111.254167] ? task_work_cancel+0x210/0x210 [ 111.258455] ? _raw_spin_unlock+0x22/0x30 [ 111.262567] ? switch_task_namespaces+0x87/0xc0 [ 111.267204] do_exit+0x9b5/0x1ad0 [ 111.270622] ? __handle_mm_fault+0xf07/0x39c0 [ 111.275088] ? mm_update_next_owner+0x930/0x930 [ 111.279720] ? lock_release+0xa40/0xa40 [ 111.283657] ? do_raw_spin_trylock+0x190/0x190 [ 111.288204] ? kfree+0xe4/0x250 [ 111.291452] ? kvfree+0x36/0x60 [ 111.294702] ? __handle_mm_fault+0x587/0x39c0 [ 111.299182] ? check_noncircular+0x20/0x20 [ 111.303380] ? __pmd_alloc+0x4e0/0x4e0 [ 111.307235] ? find_held_lock+0x35/0x1d0 [ 111.311262] ? handle_mm_fault+0x248/0x8d0 [ 111.315480] ? find_held_lock+0x35/0x1d0 [ 111.319510] ? __do_page_fault+0x64c/0xd60 [ 111.323728] ? lock_downgrade+0x990/0x990 [ 111.327844] ? handle_mm_fault+0x410/0x8d0 [ 111.332042] ? down_read_trylock+0xdb/0x170 [ 111.336327] ? __do_page_fault+0x31e/0xd60 [ 111.340525] ? __handle_mm_fault+0x39c0/0x39c0 [ 111.345091] ? vmacache_find+0x5f/0x280 [ 111.349029] ? vmacache_update+0xfe/0x130 [ 111.353145] do_group_exit+0x149/0x400 [ 111.356998] ? __do_page_fault+0x3d6/0xd60 [ 111.361200] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 111.365575] ? SyS_exit+0x30/0x30 [ 111.368997] ? do_fast_syscall_32+0x158/0xf05 [ 111.373456] ? do_group_exit+0x400/0x400 [ 111.377480] SyS_exit_group+0x1d/0x20 [ 111.381246] do_fast_syscall_32+0x3f2/0xf05 [ 111.385536] ? do_int80_syscall_32+0x940/0x940 [ 111.390087] ? kasan_check_read+0x11/0x20 [ 111.394216] ? syscall_return_slowpath+0x510/0x510 [ 111.399111] ? SyS_rt_sigaction+0x94/0x1b0 [ 111.403325] ? SyS_sigprocmask+0x4b0/0x4b0 [ 111.407524] ? SyS_read+0x184/0x220 [ 111.411116] ? retint_user+0x18/0x20