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.202' (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: [ 52.445277] ================================================================== [ 52.452719] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 52.459446] Write of size 8 at addr ffff8801ce2db740 by task syzkaller390187/2985 [ 52.467036] [ 52.468645] CPU: 1 PID: 2985 Comm: syzkaller390187 Not tainted 4.14.0-rc3+ #28 [ 52.475974] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.485300] Call Trace: [ 52.487868] dump_stack+0x194/0x257 [ 52.491476] ? arch_local_irq_restore+0x53/0x53 [ 52.496121] ? show_regs_print_info+0x65/0x65 [ 52.500596] ? lock_timer_base+0x1a3/0x2b0 [ 52.504807] ? detach_if_pending+0x557/0x610 [ 52.509194] print_address_description+0x73/0x250 [ 52.514013] ? detach_if_pending+0x557/0x610 [ 52.518398] kasan_report+0x25b/0x340 [ 52.522177] __asan_report_store8_noabort+0x17/0x20 [ 52.527175] detach_if_pending+0x557/0x610 [ 52.531386] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.536556] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.541198] ? lock_timer_base+0x1a3/0x2b0 [ 52.545408] ? lock_timer_base+0x1eb/0x2b0 [ 52.549621] ? __internal_add_timer+0x2d0/0x2d0 [ 52.554266] ? trace_hardirqs_on+0xd/0x10 [ 52.558398] try_to_del_timer_sync+0xa2/0x120 [ 52.562867] ? del_timer+0x130/0x130 [ 52.566555] ? del_timer_sync+0xeb/0x240 [ 52.570596] del_timer_sync+0x18a/0x240 [ 52.574548] tun_free_netdev+0x105/0x1b0 [ 52.578585] ? tun_xdp+0x410/0x410 [ 52.582100] ? cpumask_next+0x24/0x30 [ 52.585879] ? netdev_refcnt_read+0xed/0x150 [ 52.590263] ? tun_xdp+0x410/0x410 [ 52.593778] netdev_run_todo+0x870/0xca0 [ 52.597811] ? do_group_exit+0x149/0x400 [ 52.601852] ? register_netdev+0x30/0x30 [ 52.605893] ? lock_downgrade+0x990/0x990 [ 52.610014] ? trace_hardirqs_on+0xd/0x10 [ 52.614162] ? refcount_sub_and_test+0x115/0x1b0 [ 52.618896] ? refcount_inc+0x50/0x50 [ 52.622667] ? refcount_inc+0x50/0x50 [ 52.626444] ? sk_destruct+0x4c/0x80 [ 52.630132] ? __sk_free+0x5c/0x230 [ 52.633730] ? sk_free+0x2f/0x40 [ 52.637069] ? __tun_detach+0x176/0x1390 [ 52.641119] ? tun_attach+0xf90/0xf90 [ 52.644909] ? locks_remove_file+0x3fa/0x5a0 [ 52.649301] ? fcntl_setlk+0x10d0/0x10d0 [ 52.653338] ? __fsnotify_parent+0xb4/0x3a0 [ 52.657635] ? fsnotify+0x1af0/0x1af0 [ 52.661412] ? __tun_detach+0x1390/0x1390 [ 52.665531] ? __tun_detach+0x1390/0x1390 [ 52.669653] rtnl_unlock+0xe/0x10 [ 52.673078] tun_chr_close+0x49/0x60 [ 52.676765] __fput+0x333/0x7f0 [ 52.680022] ? fput+0x140/0x140 [ 52.683276] ? check_same_owner+0x320/0x320 [ 52.687584] ____fput+0x15/0x20 [ 52.690837] task_work_run+0x199/0x270 [ 52.694704] ? task_work_cancel+0x210/0x210 [ 52.698998] ? free_nsproxy+0x185/0x1f0 [ 52.702945] ? switch_task_namespaces+0xa2/0xc0 [ 52.707589] do_exit+0x9d2/0x1af0 [ 52.711013] ? trace_hardirqs_on+0xd/0x10 [ 52.715139] ? mm_update_next_owner+0x930/0x930 [ 52.719779] ? mark_held_locks+0xb2/0x100 [ 52.723899] ? kfree+0xe4/0x250 [ 52.727150] ? kvfree+0x36/0x60 [ 52.730401] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.735390] ? trace_hardirqs_on+0xd/0x10 [ 52.739514] ? kvfree+0x3b/0x60 [ 52.742772] ? rtnl_unlock+0xe/0x10 [ 52.746371] ? __tun_chr_ioctl+0x27a/0x3d20 [ 52.750678] ? find_held_lock+0x39/0x1d0 [ 52.754717] ? __might_sleep+0x95/0x190 [ 52.758673] ? selinux_file_ioctl+0x444/0x690 [ 52.763146] ? __fget_light+0x29d/0x390 [ 52.767109] ? handle_mm_fault+0x410/0x8d0 [ 52.771321] ? tun_chr_compat_ioctl+0x29/0x30 [ 52.775787] ? tun_chr_compat_ioctl+0x29/0x30 [ 52.780266] do_group_exit+0x149/0x400 [ 52.784127] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 52.788507] ? SyS_exit+0x30/0x30 [ 52.791933] ? do_ioctl+0x60/0x60 [ 52.795362] ? do_fast_syscall_32+0x158/0xf05 [ 52.799829] ? do_group_exit+0x400/0x400 [ 52.803861] SyS_exit_group+0x1d/0x20 [ 52.807632] do_fast_syscall_32+0x3f2/0xf05 [ 52.811931] ? do_int80_syscall_32+0x940/0x940 [ 52.816486] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.821216] ? lockdep_sys_exit+0x47/0xf0 [ 52.825337] ? syscall_return_slowpath+0x2b3/0x510 [ 52.830246] ? sysret32_from_system_call+0x5/0x3b [ 52.835064] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 52.839884] entry_SYSENTER_compat+0x51/0x60 [ 52.844262] RIP: 0023:0xf7f08c79 [ 52.847598] RSP: 002b:00000000ffa011cc EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 52.855283] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ffa013b8 [ 52.862522] RDX: 0000000008048cb5 RSI: 0000000000000036 RDI: 0000000000000005 [ 52.869762] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 52.877003] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 52.884246] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 52.891505] [ 52.893106] Allocated by task 2985: [ 52.896705] save_stack_trace+0x16/0x20 [ 52.900653] save_stack+0x43/0xd0 [ 52.904076] kasan_kmalloc+0xad/0xe0 [ 52.907760] __kmalloc_node+0x47/0x70 [ 52.911534] kvmalloc_node+0x64/0xd0 [ 52.915222] alloc_netdev_mqs+0x16e/0xed0 [ 52.919349] __tun_chr_ioctl+0x12be/0x3d20 [ 52.923552] tun_chr_compat_ioctl+0x29/0x30 [ 52.927844] compat_SyS_ioctl+0x1d7/0x3290 [ 52.932050] do_fast_syscall_32+0x3f2/0xf05 [ 52.936341] entry_SYSENTER_compat+0x51/0x60 [ 52.940719] [ 52.942319] Freed by task 2985: [ 52.945571] save_stack_trace+0x16/0x20 [ 52.949520] save_stack+0x43/0xd0 [ 52.952944] kasan_slab_free+0x71/0xc0 [ 52.956802] kfree+0xca/0x250 [ 52.959880] kvfree+0x36/0x60 [ 52.962959] free_netdev+0x2cf/0x360 [ 52.966642] __tun_chr_ioctl+0x2cf6/0x3d20 [ 52.970848] tun_chr_compat_ioctl+0x29/0x30 [ 52.975140] compat_SyS_ioctl+0x1d7/0x3290 [ 52.979344] do_fast_syscall_32+0x3f2/0xf05 [ 52.983639] entry_SYSENTER_compat+0x51/0x60 [ 52.988016] [ 52.989615] The buggy address belongs to the object at ffff8801ce2d8340 [ 52.989615] which belongs to the cache kmalloc-16384 of size 16384 [ 53.002588] The buggy address is located 13312 bytes inside of [ 53.002588] 16384-byte region [ffff8801ce2d8340, ffff8801ce2dc340) [ 53.014778] The buggy address belongs to the page: [ 53.019679] page:ffffea000738b600 count:1 mapcount:0 mapping:ffff8801ce2d8340 index:0x0 compound_mapcount: 0 [ 53.029625] flags: 0x200000000008100(slab|head) [ 53.034269] raw: 0200000000008100 ffff8801ce2d8340 0000000000000000 0000000100000001 [ 53.042121] raw: ffffea0007337220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 53.049969] page dumped because: kasan: bad access detected [ 53.055647] [ 53.057244] Memory state around the buggy address: [ 53.062144] ffff8801ce2db600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.069474] ffff8801ce2db680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.076800] >ffff8801ce2db700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.084127] ^ [ 53.089978] ffff8801ce2db780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.097312] ffff8801ce2db800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 53.104639] ================================================================== [ 53.111965] Disabling lock debugging due to kernel taint [ 53.117376] Kernel panic - not syncing: panic_on_warn set ... [ 53.117376] [ 53.124702] CPU: 1 PID: 2985 Comm: syzkaller390187 Tainted: G B 4.14.0-rc3+ #28 [ 53.133238] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 53.142559] Call Trace: [ 53.145123] dump_stack+0x194/0x257 [ 53.148720] ? arch_local_irq_restore+0x53/0x53 [ 53.153363] ? vprintk_default+0x28/0x30 [ 53.157391] ? detach_if_pending+0x460/0x610 [ 53.161765] panic+0x1e4/0x417 [ 53.164921] ? __warn+0x1d9/0x1d9 [ 53.168344] ? detach_if_pending+0x557/0x610 [ 53.172719] kasan_end_report+0x50/0x50 [ 53.176658] kasan_report+0x144/0x340 [ 53.180424] __asan_report_store8_noabort+0x17/0x20 [ 53.185403] detach_if_pending+0x557/0x610 [ 53.189605] ? trace_raw_output_tick_stop+0x130/0x130 [ 53.194762] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 53.199396] ? lock_timer_base+0x1a3/0x2b0 [ 53.203595] ? lock_timer_base+0x1eb/0x2b0 [ 53.207794] ? __internal_add_timer+0x2d0/0x2d0 [ 53.212431] ? trace_hardirqs_on+0xd/0x10 [ 53.216548] try_to_del_timer_sync+0xa2/0x120 [ 53.221006] ? del_timer+0x130/0x130 [ 53.224684] ? del_timer_sync+0xeb/0x240 [ 53.228714] del_timer_sync+0x18a/0x240 [ 53.232658] tun_free_netdev+0x105/0x1b0 [ 53.236684] ? tun_xdp+0x410/0x410 [ 53.240188] ? cpumask_next+0x24/0x30 [ 53.243957] ? netdev_refcnt_read+0xed/0x150 [ 53.248330] ? tun_xdp+0x410/0x410 [ 53.251835] netdev_run_todo+0x870/0xca0 [ 53.255860] ? do_group_exit+0x149/0x400 [ 53.259894] ? register_netdev+0x30/0x30 [ 53.263924] ? lock_downgrade+0x990/0x990 [ 53.268036] ? trace_hardirqs_on+0xd/0x10 [ 53.272161] ? refcount_sub_and_test+0x115/0x1b0 [ 53.276882] ? refcount_inc+0x50/0x50 [ 53.280648] ? refcount_inc+0x50/0x50 [ 53.284417] ? sk_destruct+0x4c/0x80 [ 53.288095] ? __sk_free+0x5c/0x230 [ 53.291687] ? sk_free+0x2f/0x40 [ 53.295023] ? __tun_detach+0x176/0x1390 [ 53.299054] ? tun_attach+0xf90/0xf90 [ 53.302826] ? locks_remove_file+0x3fa/0x5a0 [ 53.307202] ? fcntl_setlk+0x10d0/0x10d0 [ 53.311236] ? __fsnotify_parent+0xb4/0x3a0 [ 53.315524] ? fsnotify+0x1af0/0x1af0 [ 53.319294] ? __tun_detach+0x1390/0x1390 [ 53.323406] ? __tun_detach+0x1390/0x1390 [ 53.327521] rtnl_unlock+0xe/0x10 [ 53.330937] tun_chr_close+0x49/0x60 [ 53.334621] __fput+0x333/0x7f0 [ 53.337867] ? fput+0x140/0x140 [ 53.341113] ? check_same_owner+0x320/0x320 [ 53.345418] ____fput+0x15/0x20 [ 53.348665] task_work_run+0x199/0x270 [ 53.352519] ? task_work_cancel+0x210/0x210 [ 53.356806] ? free_nsproxy+0x185/0x1f0 [ 53.360747] ? switch_task_namespaces+0xa2/0xc0 [ 53.365383] do_exit+0x9d2/0x1af0 [ 53.368801] ? trace_hardirqs_on+0xd/0x10 [ 53.372918] ? mm_update_next_owner+0x930/0x930 [ 53.377550] ? mark_held_locks+0xb2/0x100 [ 53.381663] ? kfree+0xe4/0x250 [ 53.384908] ? kvfree+0x36/0x60 [ 53.388152] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.393132] ? trace_hardirqs_on+0xd/0x10 [ 53.397245] ? kvfree+0x3b/0x60 [ 53.400494] ? rtnl_unlock+0xe/0x10 [ 53.404085] ? __tun_chr_ioctl+0x27a/0x3d20 [ 53.408380] ? find_held_lock+0x39/0x1d0 [ 53.412409] ? __might_sleep+0x95/0x190 [ 53.416367] ? selinux_file_ioctl+0x444/0x690 [ 53.420827] ? __fget_light+0x29d/0x390 [ 53.424773] ? handle_mm_fault+0x410/0x8d0 [ 53.428974] ? tun_chr_compat_ioctl+0x29/0x30 [ 53.433431] ? tun_chr_compat_ioctl+0x29/0x30 [ 53.437894] do_group_exit+0x149/0x400 [ 53.441748] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 53.446122] ? SyS_exit+0x30/0x30