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-3,10.128.15.211' (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: [ 31.814283] ================================================================== [ 31.815379] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.816266] Write of size 8 at addr ffff8801d1f53678 by task syzkaller598891/2988 [ 31.817261] [ 31.817493] CPU: 1 PID: 2988 Comm: syzkaller598891 Not tainted 4.14.0-rc5+ #49 [ 31.818456] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.819674] Call Trace: [ 31.820030] dump_stack+0x194/0x257 [ 31.820520] ? arch_local_irq_restore+0x53/0x53 [ 31.821141] ? show_regs_print_info+0x65/0x65 [ 31.821739] ? lock_acquire+0x1d5/0x580 [ 31.822271] ? lock_timer_base+0x1a3/0x2b0 [ 31.822837] ? detach_if_pending+0x557/0x610 [ 31.823443] print_address_description+0x73/0x250 [ 31.824085] ? detach_if_pending+0x557/0x610 [ 31.824674] kasan_report+0x25b/0x340 [ 31.825188] __asan_report_store8_noabort+0x17/0x20 [ 31.825853] detach_if_pending+0x557/0x610 [ 31.826438] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.827130] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.827750] ? lock_timer_base+0x1a3/0x2b0 [ 31.828316] ? lock_timer_base+0x1eb/0x2b0 [ 31.828888] ? __internal_add_timer+0x2d0/0x2d0 [ 31.829533] ? lock_downgrade+0x990/0x990 [ 31.830155] ? trace_hardirqs_on+0xd/0x10 [ 31.830716] try_to_del_timer_sync+0xa2/0x120 [ 31.831332] ? del_timer+0x130/0x130 [ 31.831832] ? del_timer_sync+0xeb/0x240 [ 31.832385] del_timer_sync+0x18a/0x240 [ 31.832922] tun_free_netdev+0x105/0x1b0 [ 31.833467] ? tun_xdp+0x410/0x410 [ 31.833944] ? cpumask_next+0x24/0x30 [ 31.834456] ? netdev_refcnt_read+0xed/0x150 [ 31.838838] ? tun_xdp+0x410/0x410 [ 31.842346] netdev_run_todo+0x870/0xca0 [ 31.846375] ? do_group_exit+0x149/0x400 [ 31.850405] ? mark_held_locks+0xaf/0x100 [ 31.854517] ? register_netdev+0x30/0x30 [ 31.858546] ? find_held_lock+0x35/0x1d0 [ 31.862581] ? lock_downgrade+0x990/0x990 [ 31.866700] ? refcount_sub_and_test+0x115/0x1b0 [ 31.871419] ? refcount_inc+0x50/0x50 [ 31.875185] ? refcount_inc+0x50/0x50 [ 31.878955] ? sk_destruct+0x4c/0x80 [ 31.882634] ? __sk_free+0x5c/0x230 [ 31.886229] ? sk_free+0x2f/0x40 [ 31.889562] ? __tun_detach+0x176/0x1390 [ 31.893600] ? tun_attach+0xfa0/0xfa0 [ 31.897376] ? locks_remove_file+0x3fa/0x5a0 [ 31.901752] ? fcntl_setlk+0x10c0/0x10c0 [ 31.905782] ? __fsnotify_parent+0xb4/0x3a0 [ 31.910071] ? fsnotify+0x1af0/0x1af0 [ 31.913840] ? __tun_detach+0x1390/0x1390 [ 31.917953] ? __tun_detach+0x1390/0x1390 [ 31.922066] rtnl_unlock+0xe/0x10 [ 31.925485] tun_chr_close+0x49/0x60 [ 31.929164] __fput+0x327/0x7e0 [ 31.932415] ? fput+0x140/0x140 [ 31.935660] ? check_same_owner+0x320/0x320 [ 31.939953] ____fput+0x15/0x20 [ 31.943198] task_work_run+0x199/0x270 [ 31.947054] ? task_work_cancel+0x210/0x210 [ 31.951339] ? free_nsproxy+0x185/0x1f0 [ 31.955364] ? switch_task_namespaces+0xa2/0xc0 [ 31.960002] do_exit+0x9b5/0x1ad0 [ 31.963420] ? trace_hardirqs_on+0xd/0x10 [ 31.967541] ? mm_update_next_owner+0x930/0x930 [ 31.972175] ? mark_held_locks+0xaf/0x100 [ 31.976291] ? kfree+0xe4/0x250 [ 31.979537] ? kvfree+0x36/0x60 [ 31.982782] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 31.987763] ? trace_hardirqs_on+0xd/0x10 [ 31.991879] ? kvfree+0x3b/0x60 [ 31.995127] ? rtnl_unlock+0xe/0x10 [ 31.998719] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.003017] ? find_held_lock+0x35/0x1d0 [ 32.007051] ? __might_sleep+0x95/0x190 [ 32.010991] ? handle_mm_fault+0x248/0x8d0 [ 32.015201] ? selinux_file_ioctl+0x444/0x690 [ 32.019661] ? __fget_light+0x297/0x380 [ 32.023615] ? handle_mm_fault+0x410/0x8d0 [ 32.027822] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.032282] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.036746] do_group_exit+0x149/0x400 [ 32.040601] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.044975] ? SyS_exit+0x30/0x30 [ 32.048393] ? do_ioctl+0x60/0x60 [ 32.051813] ? do_fast_syscall_32+0x158/0xf05 [ 32.056274] ? do_group_exit+0x400/0x400 [ 32.060301] SyS_exit_group+0x1d/0x20 [ 32.064070] do_fast_syscall_32+0x3f2/0xf05 [ 32.068363] ? do_int80_syscall_32+0x940/0x940 [ 32.072910] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.077636] ? syscall_return_slowpath+0x2b3/0x510 [ 32.082530] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 32.087514] ? sysret32_from_system_call+0x5/0x3b [ 32.092326] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.097140] entry_SYSENTER_compat+0x51/0x60 [ 32.101513] RIP: 0023:0xf7f9dc79 [ 32.104841] RSP: 002b:00000000ff8fa6cc EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 32.112515] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ff8fa8b8 [ 32.119750] RDX: 0000000008048d62 RSI: 0000000000000036 RDI: 0000000000000004 [ 32.126983] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 32.134218] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.141451] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 32.148701] [ 32.150295] Allocated by task 2988: [ 32.153891] save_stack_trace+0x16/0x20 [ 32.157830] save_stack+0x43/0xd0 [ 32.161247] kasan_kmalloc+0xad/0xe0 [ 32.164924] __kmalloc_node+0x47/0x70 [ 32.168689] kvmalloc_node+0x64/0xd0 [ 32.172365] alloc_netdev_mqs+0x16e/0xed0 [ 32.176475] __tun_chr_ioctl+0x12b2/0x3d20 [ 32.180673] tun_chr_compat_ioctl+0x29/0x30 [ 32.184959] compat_SyS_ioctl+0x1d7/0x3290 [ 32.189157] do_fast_syscall_32+0x3f2/0xf05 [ 32.193441] entry_SYSENTER_compat+0x51/0x60 [ 32.197813] [ 32.199412] Freed by task 2988: [ 32.202654] save_stack_trace+0x16/0x20 [ 32.206592] save_stack+0x43/0xd0 [ 32.210008] kasan_slab_free+0x71/0xc0 [ 32.213859] kfree+0xca/0x250 [ 32.216928] kvfree+0x36/0x60 [ 32.219998] free_netdev+0x2cf/0x360 [ 32.223674] __tun_chr_ioctl+0x2cea/0x3d20 [ 32.227872] tun_chr_compat_ioctl+0x29/0x30 [ 32.232156] compat_SyS_ioctl+0x1d7/0x3290 [ 32.236353] do_fast_syscall_32+0x3f2/0xf05 [ 32.240639] entry_SYSENTER_compat+0x51/0x60 [ 32.245009] [ 32.246602] The buggy address belongs to the object at ffff8801d1f50340 [ 32.246602] which belongs to the cache kmalloc-16384 of size 16384 [ 32.259567] The buggy address is located 13112 bytes inside of [ 32.259567] 16384-byte region [ffff8801d1f50340, ffff8801d1f54340) [ 32.271749] The buggy address belongs to the page: [ 32.276644] page:ffffea000747d400 count:1 mapcount:0 mapping:ffff8801d1f50340 index:0x0 compound_mapcount: 0 [ 32.286576] flags: 0x200000000008100(slab|head) [ 32.291210] raw: 0200000000008100 ffff8801d1f50340 0000000000000000 0000000100000001 [ 32.299054] raw: ffffea000746bc20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 32.306896] page dumped because: kasan: bad access detected [ 32.312567] [ 32.314159] Memory state around the buggy address: [ 32.319050] ffff8801d1f53500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.326374] ffff8801d1f53580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.333697] >ffff8801d1f53600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.341017] ^ [ 32.348252] ffff8801d1f53680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.355580] ffff8801d1f53700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.362901] ================================================================== [ 32.370221] Disabling lock debugging due to kernel taint [ 32.375633] Kernel panic - not syncing: panic_on_warn set ... [ 32.375633] [ 32.382957] CPU: 1 PID: 2988 Comm: syzkaller598891 Tainted: G B 4.14.0-rc5+ #49 [ 32.391490] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.400806] Call Trace: [ 32.403357] dump_stack+0x194/0x257 [ 32.406951] ? arch_local_irq_restore+0x53/0x53 [ 32.411581] ? kasan_end_report+0x32/0x50 [ 32.415695] ? lock_downgrade+0x990/0x990 [ 32.419808] ? detach_if_pending+0x510/0x610 [ 32.424182] panic+0x1e4/0x417 [ 32.427337] ? __warn+0x1d9/0x1d9 [ 32.430759] ? detach_if_pending+0x557/0x610 [ 32.435130] kasan_end_report+0x50/0x50 [ 32.439067] kasan_report+0x144/0x340 [ 32.442832] __asan_report_store8_noabort+0x17/0x20 [ 32.447812] detach_if_pending+0x557/0x610 [ 32.452011] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.457929] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.462564] ? lock_timer_base+0x1a3/0x2b0 [ 32.466760] ? lock_timer_base+0x1eb/0x2b0 [ 32.470960] ? __internal_add_timer+0x2d0/0x2d0 [ 32.475593] ? lock_downgrade+0x990/0x990 [ 32.479703] ? trace_hardirqs_on+0xd/0x10 [ 32.483818] try_to_del_timer_sync+0xa2/0x120 [ 32.488280] ? del_timer+0x130/0x130 [ 32.491958] ? del_timer_sync+0xeb/0x240 [ 32.495986] del_timer_sync+0x18a/0x240 [ 32.499925] tun_free_netdev+0x105/0x1b0 [ 32.503951] ? tun_xdp+0x410/0x410 [ 32.507454] ? cpumask_next+0x24/0x30 [ 32.511220] ? netdev_refcnt_read+0xed/0x150 [ 32.515595] ? tun_xdp+0x410/0x410 [ 32.519099] netdev_run_todo+0x870/0xca0 [ 32.523125] ? do_group_exit+0x149/0x400 [ 32.527151] ? mark_held_locks+0xaf/0x100 [ 32.531261] ? register_netdev+0x30/0x30 [ 32.535287] ? find_held_lock+0x35/0x1d0 [ 32.539314] ? lock_downgrade+0x990/0x990 [ 32.543427] ? refcount_sub_and_test+0x115/0x1b0 [ 32.548146] ? refcount_inc+0x50/0x50 [ 32.551909] ? refcount_inc+0x50/0x50 [ 32.555674] ? sk_destruct+0x4c/0x80 [ 32.559348] ? __sk_free+0x5c/0x230 [ 32.562938] ? sk_free+0x2f/0x40 [ 32.566270] ? __tun_detach+0x176/0x1390 [ 32.570298] ? tun_attach+0xfa0/0xfa0 [ 32.574067] ? locks_remove_file+0x3fa/0x5a0 [ 32.578439] ? fcntl_setlk+0x10c0/0x10c0 [ 32.582466] ? __fsnotify_parent+0xb4/0x3a0 [ 32.586751] ? fsnotify+0x1af0/0x1af0 [ 32.590518] ? __tun_detach+0x1390/0x1390 [ 32.594629] ? __tun_detach+0x1390/0x1390 [ 32.598740] rtnl_unlock+0xe/0x10 [ 32.602157] tun_chr_close+0x49/0x60 [ 32.605834] __fput+0x327/0x7e0 [ 32.609080] ? fput+0x140/0x140 [ 32.612322] ? check_same_owner+0x320/0x320 [ 32.616607] ____fput+0x15/0x20 [ 32.619852] task_work_run+0x199/0x270 [ 32.623705] ? task_work_cancel+0x210/0x210 [ 32.627991] ? free_nsproxy+0x185/0x1f0 [ 32.631929] ? switch_task_namespaces+0xa2/0xc0 [ 32.636564] do_exit+0x9b5/0x1ad0 [ 32.639980] ? trace_hardirqs_on+0xd/0x10 [ 32.644094] ? mm_update_next_owner+0x930/0x930 [ 32.648726] ? mark_held_locks+0xaf/0x100 [ 32.652839] ? kfree+0xe4/0x250 [ 32.656082] ? kvfree+0x36/0x60 [ 32.659323] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 32.664301] ? trace_hardirqs_on+0xd/0x10 [ 32.668415] ? kvfree+0x3b/0x60 [ 32.671662] ? rtnl_unlock+0xe/0x10 [ 32.675253] ? __tun_chr_ioctl+0x27a/0x3d20 [ 32.679545] ? find_held_lock+0x35/0x1d0 [ 32.683574] ? __might_sleep+0x95/0x190 [ 32.687510] ? handle_mm_fault+0x248/0x8d0 [ 32.691713] ? selinux_file_ioctl+0x444/0x690 [ 32.696172] ? __fget_light+0x297/0x380 [ 32.700117] ? handle_mm_fault+0x410/0x8d0 [ 32.704316] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.708772] ? tun_chr_compat_ioctl+0x29/0x30 [ 32.713232] do_group_exit+0x149/0x400 [ 32.717081] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.721452] ? SyS_exit+0x30/0x30 [ 32.724868] ? do_ioctl+0x60/0x60 [ 32.728285] ? do_fast_syscall_32+0x158/0xf05 [ 32.732741] ? do_group_exit+0x400/0x400 [ 32.736764] SyS_exit_group+0x1d/0x20 [ 32.740529] do_fast_syscall_32+0x3f2/0xf05 [ 32.744817] ? do_int80_syscall_32+0x940/0x940 [ 32.749363] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 32.754085] ? syscall_return_slowpath+0x2b3/0x510 [ 32.758977] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 32.763959] ? sysret32_from_system_call+0x5/0x3b [ 32.768768] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.773576] entry_SYSENTER_compat+0x51/0x60 [ 32.777947] RIP: 0023:0xf7f9dc79 [ 32.781279] RSP: 002b:00000000ff8fa6cc EFLAGS: 00000282 ORIG_RAX: 00000000000000fc [ 32.788951] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000ff8fa8b8 [ 32.796184] RDX: 0000000008048d62 RSI: 0000000000000036 RDI: 0000000000000004 [ 32.803417] RBP: 00000000400454ca R08: 0000000000000000 R09: 0000000000000000 [ 32.810651] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000