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.38' (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: [ 41.347291] ================================================================== [ 41.348439] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.349331] Write of size 8 at addr ffff8801ce21b780 by task syzkaller903149/2984 [ 41.350345] [ 41.350581] CPU: 0 PID: 2984 Comm: syzkaller903149 Not tainted 4.14.0-rc2+ #21 [ 41.351594] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.352818] Call Trace: [ 41.353181] dump_stack+0x194/0x257 [ 41.353678] ? arch_local_irq_restore+0x53/0x53 [ 41.354306] ? show_regs_print_info+0x65/0x65 [ 41.354912] ? lock_timer_base+0x1a3/0x2b0 [ 41.355486] ? detach_if_pending+0x557/0x610 [ 41.356093] print_address_description+0x73/0x250 [ 41.356787] ? detach_if_pending+0x557/0x610 [ 41.357382] kasan_report+0x25b/0x340 [ 41.357931] __asan_report_store8_noabort+0x17/0x20 [ 41.358602] detach_if_pending+0x557/0x610 [ 41.359175] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.359870] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.360495] ? lock_timer_base+0x1a3/0x2b0 [ 41.361068] ? lock_timer_base+0x1eb/0x2b0 [ 41.361661] ? __internal_add_timer+0x2d0/0x2d0 [ 41.362291] ? trace_hardirqs_on+0xd/0x10 [ 41.362877] try_to_del_timer_sync+0xa2/0x120 [ 41.363483] ? del_timer+0x130/0x130 [ 41.363991] ? del_timer_sync+0xeb/0x240 [ 41.364587] del_timer_sync+0x18a/0x240 [ 41.365151] tun_free_netdev+0x105/0x1b0 [ 41.365700] ? tun_xdp+0x410/0x410 [ 41.366198] ? cpumask_next+0x24/0x30 [ 41.366717] ? netdev_refcnt_read+0xed/0x150 [ 41.367315] ? tun_xdp+0x410/0x410 [ 41.370094] netdev_run_todo+0x870/0xca0 [ 41.374127] ? do_group_exit+0x149/0x400 [ 41.378167] ? register_netdev+0x30/0x30 [ 41.382207] ? lock_downgrade+0x990/0x990 [ 41.386330] ? trace_hardirqs_on+0xd/0x10 [ 41.390472] ? refcount_sub_and_test+0x115/0x1b0 [ 41.395200] ? refcount_inc+0x50/0x50 [ 41.398971] ? refcount_inc+0x50/0x50 [ 41.402749] ? sk_destruct+0x4c/0x80 [ 41.406433] ? __sk_free+0x5c/0x230 [ 41.410031] ? sk_free+0x2f/0x40 [ 41.413368] ? __tun_detach+0x176/0x1390 [ 41.417411] ? tun_attach+0xf90/0xf90 [ 41.421187] ? do_raw_spin_trylock+0x190/0x190 [ 41.425741] ? locks_remove_file+0x3fa/0x5a0 [ 41.430121] ? fcntl_setlk+0x10d0/0x10d0 [ 41.434155] ? __fsnotify_parent+0xb4/0x3a0 [ 41.438447] ? fsnotify+0x1af0/0x1af0 [ 41.442223] ? __tun_detach+0x1390/0x1390 [ 41.446342] ? __tun_detach+0x1390/0x1390 [ 41.450461] rtnl_unlock+0xe/0x10 [ 41.453883] tun_chr_close+0x49/0x60 [ 41.457566] __fput+0x333/0x7f0 [ 41.460822] ? fput+0x140/0x140 [ 41.464075] ? check_same_owner+0x320/0x320 [ 41.468365] ? _raw_spin_unlock_irq+0x27/0x70 [ 41.472934] ____fput+0x15/0x20 [ 41.476206] task_work_run+0x199/0x270 [ 41.480068] ? task_work_cancel+0x210/0x210 [ 41.484359] ? _raw_spin_unlock+0x22/0x30 [ 41.488479] ? switch_task_namespaces+0x87/0xc0 [ 41.493123] do_exit+0x9d2/0x1af0 [ 41.496549] ? __handle_mm_fault+0xf07/0x39c0 [ 41.501018] ? mm_update_next_owner+0x930/0x930 [ 41.505658] ? lock_release+0xd70/0xd70 [ 41.509602] ? check_noncircular+0x20/0x20 [ 41.513808] ? kfree+0xe4/0x250 [ 41.517057] ? kvfree+0x36/0x60 [ 41.520315] ? check_noncircular+0x20/0x20 [ 41.524523] ? __handle_mm_fault+0x587/0x39c0 [ 41.528994] ? __pmd_alloc+0x4e0/0x4e0 [ 41.532862] ? find_held_lock+0x39/0x1d0 [ 41.536907] ? lock_downgrade+0x990/0x990 [ 41.541047] ? handle_mm_fault+0x410/0x8d0 [ 41.545251] ? down_read_trylock+0xdb/0x170 [ 41.549543] ? __do_page_fault+0x31e/0xd60 [ 41.553748] ? __handle_mm_fault+0x39c0/0x39c0 [ 41.558301] ? vmacache_find+0x5f/0x280 [ 41.562244] ? vmacache_update+0xfe/0x130 [ 41.566368] do_group_exit+0x149/0x400 [ 41.570225] ? __do_page_fault+0x3d6/0xd60 [ 41.574429] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 41.578808] ? SyS_exit+0x30/0x30 [ 41.582241] ? do_fast_syscall_32+0x158/0xf05 [ 41.586708] ? do_group_exit+0x400/0x400 [ 41.590740] SyS_exit_group+0x1d/0x20 [ 41.594514] do_fast_syscall_32+0x3f2/0xf05 [ 41.598814] ? do_int80_syscall_32+0x940/0x940 [ 41.603368] ? kasan_check_read+0x11/0x20 [ 41.607488] ? syscall_return_slowpath+0x510/0x510 [ 41.612387] ? SyS_rt_sigaction+0x94/0x1b0 [ 41.616594] ? lockdep_sys_exit+0x47/0xf0 [ 41.620713] ? retint_user+0x18/0x20 [ 41.624403] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 41.629221] entry_SYSENTER_compat+0x51/0x60 [ 41.633599] RIP: 0023:0xf7f34c79 [ 41.636932] RSP: 002b:00000000ffbe1a6c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 41.644612] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 41.651852] RDX: 0000000000000000 RSI: 00000000080daa18 RDI: 00000000080f12a0 [ 41.659089] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 41.666328] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 41.673575] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 41.680832] [ 41.682430] Allocated by task 2984: [ 41.686030] save_stack_trace+0x16/0x20 [ 41.689972] save_stack+0x43/0xd0 [ 41.693395] kasan_kmalloc+0xad/0xe0 [ 41.697075] __kmalloc_node+0x47/0x70 [ 41.700846] kvmalloc_node+0x64/0xd0 [ 41.704531] alloc_netdev_mqs+0x16e/0xed0 [ 41.708646] __tun_chr_ioctl+0x12be/0x3d20 [ 41.712849] tun_chr_compat_ioctl+0x29/0x30 [ 41.717140] compat_SyS_ioctl+0x1d7/0x3290 [ 41.721354] do_fast_syscall_32+0x3f2/0xf05 [ 41.725653] entry_SYSENTER_compat+0x51/0x60 [ 41.730029] [ 41.731626] Freed by task 2984: [ 41.734876] save_stack_trace+0x16/0x20 [ 41.738818] save_stack+0x43/0xd0 [ 41.742240] kasan_slab_free+0x71/0xc0 [ 41.746099] kfree+0xca/0x250 [ 41.749177] kvfree+0x36/0x60 [ 41.752252] free_netdev+0x2cf/0x360 [ 41.755936] __tun_chr_ioctl+0x2cf6/0x3d20 [ 41.760138] tun_chr_compat_ioctl+0x29/0x30 [ 41.764430] compat_SyS_ioctl+0x1d7/0x3290 [ 41.768635] do_fast_syscall_32+0x3f2/0xf05 [ 41.772926] entry_SYSENTER_compat+0x51/0x60 [ 41.777300] [ 41.778903] The buggy address belongs to the object at ffff8801ce218380 [ 41.778903] which belongs to the cache kmalloc-16384 of size 16384 [ 41.791880] The buggy address is located 13312 bytes inside of [ 41.791880] 16384-byte region [ffff8801ce218380, ffff8801ce21c380) [ 41.804071] The buggy address belongs to the page: [ 41.808970] page:ffffea0007388600 count:1 mapcount:0 mapping:ffff8801ce218380 index:0x0 compound_mapcount: 0 [ 41.818913] flags: 0x200000000008100(slab|head) [ 41.823552] raw: 0200000000008100 ffff8801ce218380 0000000000000000 0000000100000001 [ 41.831400] raw: ffffea0007363020 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 41.839244] page dumped because: kasan: bad access detected [ 41.844920] [ 41.846517] Memory state around the buggy address: [ 41.851415] ffff8801ce21b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.858744] ffff8801ce21b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.866070] >ffff8801ce21b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.873396] ^ [ 41.876733] ffff8801ce21b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.884060] ffff8801ce21b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 41.891386] ================================================================== [ 41.898726] Disabling lock debugging due to kernel taint [ 41.904140] Kernel panic - not syncing: panic_on_warn set ... [ 41.904140] [ 41.911466] CPU: 0 PID: 2984 Comm: syzkaller903149 Tainted: G B 4.14.0-rc2+ #21 [ 41.920004] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.929322] Call Trace: [ 41.931879] dump_stack+0x194/0x257 [ 41.935473] ? arch_local_irq_restore+0x53/0x53 [ 41.940107] ? vprintk_default+0x28/0x30 [ 41.944135] ? detach_if_pending+0x500/0x610 [ 41.948507] panic+0x1e4/0x417 [ 41.951667] ? __warn+0x1d9/0x1d9 [ 41.955090] ? detach_if_pending+0x557/0x610 [ 41.959460] kasan_end_report+0x50/0x50 [ 41.963398] kasan_report+0x144/0x340 [ 41.967165] __asan_report_store8_noabort+0x17/0x20 [ 41.972144] detach_if_pending+0x557/0x610 [ 41.976345] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.981501] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.986132] ? lock_timer_base+0x1a3/0x2b0 [ 41.990332] ? lock_timer_base+0x1eb/0x2b0 [ 41.994533] ? __internal_add_timer+0x2d0/0x2d0 [ 41.999169] ? trace_hardirqs_on+0xd/0x10 [ 42.003283] try_to_del_timer_sync+0xa2/0x120 [ 42.007744] ? del_timer+0x130/0x130 [ 42.011421] ? del_timer_sync+0xeb/0x240 [ 42.015450] del_timer_sync+0x18a/0x240 [ 42.019390] tun_free_netdev+0x105/0x1b0 [ 42.023416] ? tun_xdp+0x410/0x410 [ 42.026922] ? cpumask_next+0x24/0x30 [ 42.030691] ? netdev_refcnt_read+0xed/0x150 [ 42.035065] ? tun_xdp+0x410/0x410 [ 42.038569] netdev_run_todo+0x870/0xca0 [ 42.042596] ? do_group_exit+0x149/0x400 [ 42.046624] ? register_netdev+0x30/0x30 [ 42.050654] ? lock_downgrade+0x990/0x990 [ 42.054767] ? trace_hardirqs_on+0xd/0x10 [ 42.058887] ? refcount_sub_and_test+0x115/0x1b0 [ 42.063607] ? refcount_inc+0x50/0x50 [ 42.067371] ? refcount_inc+0x50/0x50 [ 42.071138] ? sk_destruct+0x4c/0x80 [ 42.074818] ? __sk_free+0x5c/0x230 [ 42.078411] ? sk_free+0x2f/0x40 [ 42.081741] ? __tun_detach+0x176/0x1390 [ 42.085773] ? tun_attach+0xf90/0xf90 [ 42.089540] ? do_raw_spin_trylock+0x190/0x190 [ 42.094088] ? locks_remove_file+0x3fa/0x5a0 [ 42.098462] ? fcntl_setlk+0x10d0/0x10d0 [ 42.102489] ? __fsnotify_parent+0xb4/0x3a0 [ 42.106776] ? fsnotify+0x1af0/0x1af0 [ 42.110541] ? __tun_detach+0x1390/0x1390 [ 42.114653] ? __tun_detach+0x1390/0x1390 [ 42.118767] rtnl_unlock+0xe/0x10 [ 42.122183] tun_chr_close+0x49/0x60 [ 42.125861] __fput+0x333/0x7f0 [ 42.129109] ? fput+0x140/0x140 [ 42.132352] ? check_same_owner+0x320/0x320 [ 42.136639] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.141100] ____fput+0x15/0x20 [ 42.144345] task_work_run+0x199/0x270 [ 42.148198] ? task_work_cancel+0x210/0x210 [ 42.152483] ? _raw_spin_unlock+0x22/0x30 [ 42.156608] ? switch_task_namespaces+0x87/0xc0 [ 42.161243] do_exit+0x9d2/0x1af0 [ 42.164660] ? __handle_mm_fault+0xf07/0x39c0 [ 42.169121] ? mm_update_next_owner+0x930/0x930 [ 42.173758] ? lock_release+0xd70/0xd70 [ 42.177698] ? check_noncircular+0x20/0x20 [ 42.181898] ? kfree+0xe4/0x250 [ 42.185150] ? kvfree+0x36/0x60 [ 42.188398] ? check_noncircular+0x20/0x20 [ 42.192599] ? __handle_mm_fault+0x587/0x39c0 [ 42.197060] ? __pmd_alloc+0x4e0/0x4e0 [ 42.200916] ? find_held_lock+0x39/0x1d0 [ 42.204949] ? lock_downgrade+0x990/0x990 [ 42.209073] ? handle_mm_fault+0x410/0x8d0 [ 42.213272] ? down_read_trylock+0xdb/0x170 [ 42.217557] ? __do_page_fault+0x31e/0xd60 [ 42.221757] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.226303] ? vmacache_find+0x5f/0x280 [ 42.230240] ? vmacache_update+0xfe/0x130 [ 42.234356] do_group_exit+0x149/0x400 [ 42.238219] ? __do_page_fault+0x3d6/0xd60 [ 42.242418] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 42.246791] ? SyS_exit+0x30/0x30 [ 42.250214] ? do_fast_syscall_32+0x158/0xf05 [ 42.254672] ? do_group_exit+0x400/0x400 [ 42.258702] SyS_exit_group+0x1d/0x20 [ 42.262479] do_fast_syscall_32+0x3f2/0xf05 [ 42.266777] ? do_int80_syscall_32+0x940/0x940 [ 42.271324] ? kasan_check_read+0x11/0x20 [ 42.275437] ? syscall_return_slowpath+0x510/0x510 [ 42.280331] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.284532] ? lockdep_sys_exit+0x47/0xf0 [ 42.288645] ? retint_user+0x18/0x20 [ 42.292327] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.297223] entry_SYSENTER_compat+0x51/0x60 [ 42.301595] RIP: 0023:0xf7f34c79 [ 42.304923] RSP: 002b:00000000ffbe1a6c EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 42.312596] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f1298 [ 42.319829] RDX: 0000000000000000 RSI: 00000000080daa18 RDI: 00000000080f12a0 [ 42.327064] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.334297] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.341534] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000