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-mmots-kasan-gce-8,10.128.0.60' (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: [ 324.247502] ================================================================== [ 324.254940] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 324.261668] Write of size 8 at addr ffff8801cda63780 by task syzkaller363846/2988 [ 324.269261] [ 324.270863] CPU: 0 PID: 2988 Comm: syzkaller363846 Not tainted 4.13.0-mm1+ #7 [ 324.278104] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 324.287433] Call Trace: [ 324.290003] dump_stack+0x194/0x257 [ 324.293606] ? arch_local_irq_restore+0x53/0x53 [ 324.298244] ? show_regs_print_info+0x65/0x65 [ 324.302713] ? lock_timer_base+0x1a3/0x2b0 [ 324.306930] ? detach_if_pending+0x557/0x610 [ 324.311310] print_address_description+0x73/0x250 [ 324.316123] ? detach_if_pending+0x557/0x610 [ 324.320505] kasan_report+0x24e/0x340 [ 324.324282] __asan_report_store8_noabort+0x17/0x20 [ 324.329267] detach_if_pending+0x557/0x610 [ 324.333492] ? trace_raw_output_tick_stop+0x130/0x130 [ 324.338655] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 324.343292] ? lock_timer_base+0x1a3/0x2b0 [ 324.347501] ? lock_timer_base+0x1eb/0x2b0 [ 324.351713] ? __internal_add_timer+0x2d0/0x2d0 [ 324.356362] ? trace_hardirqs_on+0xd/0x10 [ 324.360487] try_to_del_timer_sync+0xa2/0x120 [ 324.364959] ? del_timer+0x130/0x130 [ 324.368643] ? del_timer_sync+0xeb/0x240 [ 324.372696] del_timer_sync+0x18a/0x240 [ 324.376643] tun_free_netdev+0x105/0x1b0 [ 324.380676] ? tun_xdp+0x410/0x410 [ 324.384189] ? cpumask_next+0x24/0x30 [ 324.387968] ? netdev_refcnt_read+0xed/0x150 [ 324.392349] ? tun_xdp+0x410/0x410 [ 324.395860] netdev_run_todo+0x870/0xca0 [ 324.399896] ? do_group_exit+0x149/0x400 [ 324.403936] ? register_netdev+0x30/0x30 [ 324.407978] ? lock_downgrade+0x990/0x990 [ 324.412101] ? trace_hardirqs_on+0xd/0x10 [ 324.416241] ? refcount_sub_and_test+0x115/0x1b0 [ 324.420966] ? refcount_inc+0x50/0x50 [ 324.424737] ? refcount_inc+0x50/0x50 [ 324.428594] ? sk_destruct+0x4c/0x80 [ 324.432282] ? __sk_free+0x5c/0x230 [ 324.435882] ? sk_free+0x2f/0x40 [ 324.439223] ? __tun_detach+0x176/0x1390 [ 324.443266] ? tun_attach+0xf90/0xf90 [ 324.447060] ? locks_remove_file+0x3fa/0x5a0 [ 324.451441] ? fcntl_setlk+0x10d0/0x10d0 [ 324.455479] ? __fsnotify_parent+0xb4/0x3a0 [ 324.459776] ? fsnotify+0x1af0/0x1af0 [ 324.463552] ? __tun_detach+0x1390/0x1390 [ 324.467675] ? __tun_detach+0x1390/0x1390 [ 324.471796] rtnl_unlock+0xe/0x10 [ 324.475220] tun_chr_close+0x49/0x60 [ 324.478903] __fput+0x333/0x7f0 [ 324.482160] ? fput+0x140/0x140 [ 324.485411] ? check_same_owner+0x320/0x320 [ 324.489709] ____fput+0x15/0x20 [ 324.492978] task_work_run+0x199/0x270 [ 324.496848] ? task_work_cancel+0x210/0x210 [ 324.501140] ? free_nsproxy+0x185/0x1f0 [ 324.505085] ? switch_task_namespaces+0xa2/0xc0 [ 324.509728] do_exit+0xa52/0x1b40 [ 324.513153] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 324.518140] ? trace_hardirqs_on+0xd/0x10 [ 324.522264] ? kvfree+0x3b/0x60 [ 324.525523] ? mm_update_next_owner+0x930/0x930 [ 324.530163] ? rtnl_unlock+0xe/0x10 [ 324.533765] ? __tun_chr_ioctl+0x27a/0x3d20 [ 324.538065] ? tun_chr_read_iter+0x1e0/0x1e0 [ 324.542454] ? lock_downgrade+0x990/0x990 [ 324.546599] ? check_same_owner+0x320/0x320 [ 324.550893] ? __handle_mm_fault+0x39c0/0x39c0 [ 324.555461] ? vmacache_find+0x61/0x270 [ 324.559499] ? tun_chr_compat_ioctl+0x30/0x30 [ 324.563963] ? tun_chr_ioctl+0x2a/0x40 [ 324.567817] ? tun_chr_ioctl+0x2a/0x40 [ 324.571767] ? do_vfs_ioctl+0x492/0x1530 [ 324.575810] ? ioctl_preallocate+0x2b0/0x2b0 [ 324.580195] ? selinux_capable+0x40/0x40 [ 324.584246] ? putname+0xf3/0x130 [ 324.587696] do_group_exit+0x149/0x400 [ 324.591582] ? SyS_exit+0x30/0x30 [ 324.595030] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 324.600026] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 324.604762] SyS_exit_group+0x1d/0x20 [ 324.608545] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 324.613270] RIP: 0033:0x445339 [ 324.616434] RSP: 002b:00007fff737bda88 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 324.624118] RAX: ffffffffffffffda RBX: 00007fff737bdac0 RCX: 0000000000445339 [ 324.631612] RDX: 0000000000445339 RSI: 0000000020822000 RDI: 0000000000000001 [ 324.638856] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007fff737bdac0 [ 324.646107] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402680 [ 324.653348] R13: 0000000000402710 R14: 0000000000000000 R15: 0000000000000000 [ 324.660609] [ 324.662213] Allocated by task 2988: [ 324.665815] save_stack_trace+0x16/0x20 [ 324.669850] save_stack+0x43/0xd0 [ 324.673281] kasan_kmalloc+0xad/0xe0 [ 324.676972] __kmalloc_node+0x47/0x70 [ 324.680750] kvmalloc_node+0x64/0xd0 [ 324.684434] alloc_netdev_mqs+0x16e/0xed0 [ 324.688552] __tun_chr_ioctl+0x12be/0x3d20 [ 324.692755] tun_chr_ioctl+0x2a/0x40 [ 324.696440] do_vfs_ioctl+0x1b1/0x1530 [ 324.700309] SyS_ioctl+0x8f/0xc0 [ 324.703647] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 324.708384] [ 324.709981] Freed by task 2988: [ 324.713234] save_stack_trace+0x16/0x20 [ 324.717181] save_stack+0x43/0xd0 [ 324.720608] kasan_slab_free+0x71/0xc0 [ 324.724464] kfree+0xca/0x250 [ 324.727541] kvfree+0x36/0x60 [ 324.730625] free_netdev+0x2cf/0x360 [ 324.734309] __tun_chr_ioctl+0x2cf6/0x3d20 [ 324.738517] tun_chr_ioctl+0x2a/0x40 [ 324.742204] do_vfs_ioctl+0x1b1/0x1530 [ 324.746060] SyS_ioctl+0x8f/0xc0 [ 324.749398] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 324.754120] [ 324.755719] The buggy address belongs to the object at ffff8801cda60380 [ 324.755719] which belongs to the cache kmalloc-16384 of size 16384 [ 324.768692] The buggy address is located 13312 bytes inside of [ 324.768692] 16384-byte region [ffff8801cda60380, ffff8801cda64380) [ 324.780885] The buggy address belongs to the page: [ 324.785788] page:ffffea0007369800 count:1 mapcount:0 mapping:ffff8801cda60380 index:0x0 compound_mapcount: 0 [ 324.795762] flags: 0x200000000008100(slab|head) [ 324.800672] raw: 0200000000008100 ffff8801cda60380 0000000000000000 0000000100000001 [ 324.808540] raw: ffffea000739be20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 324.816390] page dumped because: kasan: bad access detected [ 324.822080] [ 324.823678] Memory state around the buggy address: [ 324.828578] ffff8801cda63680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 324.835999] ffff8801cda63700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 324.843334] >ffff8801cda63780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 324.850664] ^ [ 324.854013] ffff8801cda63800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 324.861356] ffff8801cda63880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 324.868695] ================================================================== [ 324.876025] Disabling lock debugging due to kernel taint [ 324.881452] Kernel panic - not syncing: panic_on_warn set ... [ 324.881452] [ 324.888835] CPU: 0 PID: 2988 Comm: syzkaller363846 Tainted: G B 4.13.0-mm1+ #7 [ 324.897304] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 324.906631] Call Trace: [ 324.909194] dump_stack+0x194/0x257 [ 324.912789] ? arch_local_irq_restore+0x53/0x53 [ 324.917428] ? vprintk_default+0x28/0x30 [ 324.921458] ? detach_if_pending+0x550/0x610 [ 324.925835] panic+0x1e4/0x417 [ 324.928994] ? __warn+0x1d9/0x1d9 [ 324.932418] ? detach_if_pending+0x557/0x610 [ 324.936795] kasan_end_report+0x50/0x50 [ 324.940734] kasan_report+0x137/0x340 [ 324.944504] __asan_report_store8_noabort+0x17/0x20 [ 324.949504] detach_if_pending+0x557/0x610 [ 324.953711] ? trace_raw_output_tick_stop+0x130/0x130 [ 324.958868] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 324.963502] ? lock_timer_base+0x1a3/0x2b0 [ 324.967702] ? lock_timer_base+0x1eb/0x2b0 [ 324.971915] ? __internal_add_timer+0x2d0/0x2d0 [ 324.976562] ? trace_hardirqs_on+0xd/0x10 [ 324.980683] try_to_del_timer_sync+0xa2/0x120 [ 324.985146] ? del_timer+0x130/0x130 [ 324.988824] ? del_timer_sync+0xeb/0x240 [ 324.992866] del_timer_sync+0x18a/0x240 [ 324.996809] tun_free_netdev+0x105/0x1b0 [ 325.000850] ? tun_xdp+0x410/0x410 [ 325.004357] ? cpumask_next+0x24/0x30 [ 325.008131] ? netdev_refcnt_read+0xed/0x150 [ 325.012511] ? tun_xdp+0x410/0x410 [ 325.016022] netdev_run_todo+0x870/0xca0 [ 325.020051] ? do_group_exit+0x149/0x400 [ 325.024082] ? register_netdev+0x30/0x30 [ 325.028109] ? lock_downgrade+0x990/0x990 [ 325.032228] ? trace_hardirqs_on+0xd/0x10 [ 325.036351] ? refcount_sub_and_test+0x115/0x1b0 [ 325.041346] ? refcount_inc+0x50/0x50 [ 325.045112] ? refcount_inc+0x50/0x50 [ 325.048897] ? sk_destruct+0x4c/0x80 [ 325.052575] ? __sk_free+0x5c/0x230 [ 325.056167] ? sk_free+0x2f/0x40 [ 325.059500] ? __tun_detach+0x176/0x1390 [ 325.063531] ? tun_attach+0xf90/0xf90 [ 325.067305] ? locks_remove_file+0x3fa/0x5a0 [ 325.071686] ? fcntl_setlk+0x10d0/0x10d0 [ 325.075717] ? __fsnotify_parent+0xb4/0x3a0 [ 325.080005] ? fsnotify+0x1af0/0x1af0 [ 325.083788] ? __tun_detach+0x1390/0x1390 [ 325.088163] ? __tun_detach+0x1390/0x1390 [ 325.092280] rtnl_unlock+0xe/0x10 [ 325.095699] tun_chr_close+0x49/0x60 [ 325.099380] __fput+0x333/0x7f0 [ 325.102630] ? fput+0x140/0x140 [ 325.105875] ? check_same_owner+0x320/0x320 [ 325.110513] ____fput+0x15/0x20 [ 325.113761] task_work_run+0x199/0x270 [ 325.117629] ? task_work_cancel+0x210/0x210 [ 325.121917] ? free_nsproxy+0x185/0x1f0 [ 325.125868] ? switch_task_namespaces+0xa2/0xc0 [ 325.130515] do_exit+0xa52/0x1b40 [ 325.133941] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 325.138936] ? trace_hardirqs_on+0xd/0x10 [ 325.143071] ? kvfree+0x3b/0x60 [ 325.146416] ? mm_update_next_owner+0x930/0x930 [ 325.151052] ? rtnl_unlock+0xe/0x10 [ 325.154655] ? __tun_chr_ioctl+0x27a/0x3d20 [ 325.158947] ? tun_chr_read_iter+0x1e0/0x1e0 [ 325.163338] ? lock_downgrade+0x990/0x990 [ 325.167466] ? check_same_owner+0x320/0x320 [ 325.171763] ? __handle_mm_fault+0x39c0/0x39c0 [ 325.176311] ? vmacache_find+0x61/0x270 [ 325.180253] ? tun_chr_compat_ioctl+0x30/0x30 [ 325.184714] ? tun_chr_ioctl+0x2a/0x40 [ 325.188576] ? tun_chr_ioctl+0x2a/0x40 [ 325.192434] ? do_vfs_ioctl+0x492/0x1530 [ 325.196471] ? ioctl_preallocate+0x2b0/0x2b0 [ 325.200847] ? selinux_capable+0x40/0x40 [ 325.204874] ? putname+0xf3/0x130 [ 325.208295] do_group_exit+0x149/0x400 [ 325.212148] ? SyS_exit+0x30/0x30 [ 325.215566] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 325.220548] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 325.225283] SyS_exit_group+0x1d/0x20 [ 325.229054] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 325.233775] RIP: 0033:0x445339 [ 325.236931] RSP: 002b:00007fff737bda88 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 325.244619] RAX: ffffffffffffffda RBX: 00007fff737bdac0 RCX: 0000000000445339