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-9,10.128.15.216' (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: [ 43.315351] ================================================================== [ 43.322823] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 43.329546] Write of size 8 at addr ffff8801ce55b740 by task syzkaller157346/2981 [ 43.337133] [ 43.338734] CPU: 0 PID: 2981 Comm: syzkaller157346 Not tainted 4.13.0-mm1+ #7 [ 43.345977] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.355301] Call Trace: [ 43.357867] dump_stack+0x194/0x257 [ 43.361474] ? arch_local_irq_restore+0x53/0x53 [ 43.366117] ? show_regs_print_info+0x65/0x65 [ 43.370586] ? lock_timer_base+0x1a3/0x2b0 [ 43.374794] ? detach_if_pending+0x557/0x610 [ 43.379178] print_address_description+0x73/0x250 [ 43.383991] ? detach_if_pending+0x557/0x610 [ 43.388373] kasan_report+0x24e/0x340 [ 43.392150] __asan_report_store8_noabort+0x17/0x20 [ 43.397136] detach_if_pending+0x557/0x610 [ 43.401345] ? trace_raw_output_tick_stop+0x130/0x130 [ 43.406513] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 43.411151] ? lock_timer_base+0x1a3/0x2b0 [ 43.415371] ? lock_timer_base+0x1eb/0x2b0 [ 43.419583] ? __internal_add_timer+0x2d0/0x2d0 [ 43.424229] ? trace_hardirqs_on+0xd/0x10 [ 43.428356] try_to_del_timer_sync+0xa2/0x120 [ 43.432825] ? del_timer+0x130/0x130 [ 43.436515] ? del_timer_sync+0xeb/0x240 [ 43.440553] del_timer_sync+0x18a/0x240 [ 43.444501] tun_free_netdev+0x105/0x1b0 [ 43.448535] ? tun_xdp+0x410/0x410 [ 43.452044] ? cpumask_next+0x24/0x30 [ 43.455819] ? netdev_refcnt_read+0xed/0x150 [ 43.460201] ? tun_xdp+0x410/0x410 [ 43.463713] netdev_run_todo+0x870/0xca0 [ 43.467744] ? do_group_exit+0x149/0x400 [ 43.471782] ? register_netdev+0x30/0x30 [ 43.475816] ? lock_downgrade+0x990/0x990 [ 43.479948] ? trace_hardirqs_on+0xd/0x10 [ 43.484098] ? refcount_sub_and_test+0x115/0x1b0 [ 43.488825] ? refcount_inc+0x50/0x50 [ 43.492595] ? refcount_inc+0x50/0x50 [ 43.496376] ? sk_destruct+0x4c/0x80 [ 43.500058] ? __sk_free+0x5c/0x230 [ 43.503658] ? sk_free+0x2f/0x40 [ 43.506996] ? __tun_detach+0x176/0x1390 [ 43.511041] ? tun_attach+0xf90/0xf90 [ 43.514821] ? locks_remove_file+0x3fa/0x5a0 [ 43.519203] ? fcntl_setlk+0x10d0/0x10d0 [ 43.523262] ? __fsnotify_parent+0xb4/0x3a0 [ 43.527562] ? fsnotify+0x1af0/0x1af0 [ 43.531338] ? __tun_detach+0x1390/0x1390 [ 43.535459] ? __tun_detach+0x1390/0x1390 [ 43.539581] rtnl_unlock+0xe/0x10 [ 43.543004] tun_chr_close+0x49/0x60 [ 43.546688] __fput+0x333/0x7f0 [ 43.549945] ? fput+0x140/0x140 [ 43.553196] ? check_same_owner+0x320/0x320 [ 43.557496] ____fput+0x15/0x20 [ 43.560746] task_work_run+0x199/0x270 [ 43.564618] ? task_work_cancel+0x210/0x210 [ 43.568913] ? free_nsproxy+0x185/0x1f0 [ 43.572861] ? switch_task_namespaces+0xa2/0xc0 [ 43.577508] do_exit+0xa52/0x1b40 [ 43.580935] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.585923] ? trace_hardirqs_on+0xd/0x10 [ 43.590046] ? kvfree+0x3b/0x60 [ 43.593304] ? mm_update_next_owner+0x930/0x930 [ 43.597944] ? rtnl_unlock+0xe/0x10 [ 43.601541] ? __tun_chr_ioctl+0x27a/0x3d20 [ 43.605843] ? tun_chr_read_iter+0x1e0/0x1e0 [ 43.610232] ? lock_downgrade+0x990/0x990 [ 43.614378] ? check_same_owner+0x320/0x320 [ 43.618671] ? __handle_mm_fault+0x39c0/0x39c0 [ 43.623223] ? vmacache_find+0x61/0x270 [ 43.627186] ? tun_chr_compat_ioctl+0x30/0x30 [ 43.631651] ? tun_chr_ioctl+0x2a/0x40 [ 43.635507] ? tun_chr_ioctl+0x2a/0x40 [ 43.639370] ? do_vfs_ioctl+0x492/0x1530 [ 43.643408] ? ioctl_preallocate+0x2b0/0x2b0 [ 43.647792] ? selinux_capable+0x40/0x40 [ 43.651826] ? putname+0xf3/0x130 [ 43.655257] do_group_exit+0x149/0x400 [ 43.659116] ? SyS_exit+0x30/0x30 [ 43.662541] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 43.667527] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 43.672259] SyS_exit_group+0x1d/0x20 [ 43.676033] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.680759] RIP: 0033:0x4453f9 [ 43.683919] RSP: 002b:00007ffe4d34d268 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 43.691605] RAX: ffffffffffffffda RBX: 00007ffe4d34d2a0 RCX: 00000000004453f9 [ 43.698848] RDX: 00000000004453f9 RSI: 0000000020f5efd8 RDI: 0000000000000001 [ 43.706089] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffe4d34d2a0 [ 43.713329] R10: 0000000000000000 R11: 0000000000000202 R12: 00000000004027a0 [ 43.720570] R13: 0000000000402830 R14: 0000000000000000 R15: 0000000000000000 [ 43.727830] [ 43.729430] Allocated by task 2981: [ 43.733032] save_stack_trace+0x16/0x20 [ 43.736978] save_stack+0x43/0xd0 [ 43.740401] kasan_kmalloc+0xad/0xe0 [ 43.744085] __kmalloc_node+0x47/0x70 [ 43.747855] kvmalloc_node+0x64/0xd0 [ 43.751540] alloc_netdev_mqs+0x16e/0xed0 [ 43.755658] __tun_chr_ioctl+0x12be/0x3d20 [ 43.759863] tun_chr_ioctl+0x2a/0x40 [ 43.763552] do_vfs_ioctl+0x1b1/0x1530 [ 43.767409] SyS_ioctl+0x8f/0xc0 [ 43.770748] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.775472] [ 43.777069] Freed by task 2981: [ 43.780319] save_stack_trace+0x16/0x20 [ 43.784267] save_stack+0x43/0xd0 [ 43.787691] kasan_slab_free+0x71/0xc0 [ 43.791545] kfree+0xca/0x250 [ 43.794621] kvfree+0x36/0x60 [ 43.797697] free_netdev+0x2cf/0x360 [ 43.801381] __tun_chr_ioctl+0x2cf6/0x3d20 [ 43.805583] tun_chr_ioctl+0x2a/0x40 [ 43.809265] do_vfs_ioctl+0x1b1/0x1530 [ 43.813123] SyS_ioctl+0x8f/0xc0 [ 43.816461] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 43.821183] [ 43.822782] The buggy address belongs to the object at ffff8801ce558340 [ 43.822782] which belongs to the cache kmalloc-16384 of size 16384 [ 43.835755] The buggy address is located 13312 bytes inside of [ 43.835755] 16384-byte region [ffff8801ce558340, ffff8801ce55c340) [ 43.847945] The buggy address belongs to the page: [ 43.852844] page:ffffea0007395600 count:1 mapcount:0 mapping:ffff8801ce558340 index:0x0 compound_mapcount: 0 [ 43.862788] flags: 0x200000000008100(slab|head) [ 43.867426] raw: 0200000000008100 ffff8801ce558340 0000000000000000 0000000100000001 [ 43.875276] raw: ffffea0007386220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 43.883126] page dumped because: kasan: bad access detected [ 43.888805] [ 43.890402] Memory state around the buggy address: [ 43.895300] ffff8801ce55b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.902631] ffff8801ce55b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.909958] >ffff8801ce55b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.917288] ^ [ 43.922708] ffff8801ce55b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.930047] ffff8801ce55b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 43.937379] ================================================================== [ 43.944705] Disabling lock debugging due to kernel taint [ 43.950120] Kernel panic - not syncing: panic_on_warn set ... [ 43.950120] [ 43.957450] CPU: 0 PID: 2981 Comm: syzkaller157346 Tainted: G B 4.13.0-mm1+ #7 [ 43.965904] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 43.975225] Call Trace: [ 43.977782] dump_stack+0x194/0x257 [ 43.981377] ? arch_local_irq_restore+0x53/0x53 [ 43.986011] ? vprintk_default+0x28/0x30 [ 43.990039] ? detach_if_pending+0x550/0x610 [ 43.994415] panic+0x1e4/0x417 [ 43.997585] ? __warn+0x1d9/0x1d9 [ 44.001009] ? detach_if_pending+0x557/0x610 [ 44.005381] kasan_end_report+0x50/0x50 [ 44.009323] kasan_report+0x137/0x340 [ 44.013091] __asan_report_store8_noabort+0x17/0x20 [ 44.018072] detach_if_pending+0x557/0x610 [ 44.022276] ? trace_raw_output_tick_stop+0x130/0x130 [ 44.027435] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 44.032069] ? lock_timer_base+0x1a3/0x2b0 [ 44.036267] ? lock_timer_base+0x1eb/0x2b0 [ 44.040468] ? __internal_add_timer+0x2d0/0x2d0 [ 44.045105] ? trace_hardirqs_on+0xd/0x10 [ 44.049222] try_to_del_timer_sync+0xa2/0x120 [ 44.053680] ? del_timer+0x130/0x130 [ 44.057360] ? del_timer_sync+0xeb/0x240 [ 44.061387] del_timer_sync+0x18a/0x240 [ 44.065329] tun_free_netdev+0x105/0x1b0 [ 44.069353] ? tun_xdp+0x410/0x410 [ 44.072857] ? cpumask_next+0x24/0x30 [ 44.076626] ? netdev_refcnt_read+0xed/0x150 [ 44.080998] ? tun_xdp+0x410/0x410 [ 44.084504] netdev_run_todo+0x870/0xca0 [ 44.088529] ? do_group_exit+0x149/0x400 [ 44.092557] ? register_netdev+0x30/0x30 [ 44.096585] ? lock_downgrade+0x990/0x990 [ 44.100697] ? trace_hardirqs_on+0xd/0x10 [ 44.104817] ? refcount_sub_and_test+0x115/0x1b0 [ 44.109536] ? refcount_inc+0x50/0x50 [ 44.113302] ? refcount_inc+0x50/0x50 [ 44.117075] ? sk_destruct+0x4c/0x80 [ 44.120752] ? __sk_free+0x5c/0x230 [ 44.124343] ? sk_free+0x2f/0x40 [ 44.127673] ? __tun_detach+0x176/0x1390 [ 44.131703] ? tun_attach+0xf90/0xf90 [ 44.135473] ? locks_remove_file+0x3fa/0x5a0 [ 44.139848] ? fcntl_setlk+0x10d0/0x10d0 [ 44.143878] ? __fsnotify_parent+0xb4/0x3a0 [ 44.148166] ? fsnotify+0x1af0/0x1af0 [ 44.151931] ? __tun_detach+0x1390/0x1390 [ 44.156050] ? __tun_detach+0x1390/0x1390 [ 44.160164] rtnl_unlock+0xe/0x10 [ 44.163586] tun_chr_close+0x49/0x60 [ 44.167264] __fput+0x333/0x7f0 [ 44.170511] ? fput+0x140/0x140 [ 44.173758] ? check_same_owner+0x320/0x320 [ 44.178047] ____fput+0x15/0x20 [ 44.181295] task_work_run+0x199/0x270 [ 44.185153] ? task_work_cancel+0x210/0x210 [ 44.189450] ? free_nsproxy+0x185/0x1f0 [ 44.193394] ? switch_task_namespaces+0xa2/0xc0 [ 44.198031] do_exit+0xa52/0x1b40 [ 44.201451] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.206439] ? trace_hardirqs_on+0xd/0x10 [ 44.210555] ? kvfree+0x3b/0x60 [ 44.213804] ? mm_update_next_owner+0x930/0x930 [ 44.218437] ? rtnl_unlock+0xe/0x10 [ 44.222028] ? __tun_chr_ioctl+0x27a/0x3d20 [ 44.226321] ? tun_chr_read_iter+0x1e0/0x1e0 [ 44.230700] ? lock_downgrade+0x990/0x990 [ 44.234824] ? check_same_owner+0x320/0x320 [ 44.239111] ? __handle_mm_fault+0x39c0/0x39c0 [ 44.243659] ? vmacache_find+0x61/0x270 [ 44.247600] ? tun_chr_compat_ioctl+0x30/0x30 [ 44.252061] ? tun_chr_ioctl+0x2a/0x40 [ 44.255912] ? tun_chr_ioctl+0x2a/0x40 [ 44.259765] ? do_vfs_ioctl+0x492/0x1530 [ 44.263793] ? ioctl_preallocate+0x2b0/0x2b0 [ 44.268167] ? selinux_capable+0x40/0x40 [ 44.272194] ? putname+0xf3/0x130 [ 44.275615] do_group_exit+0x149/0x400 [ 44.279469] ? SyS_exit+0x30/0x30 [ 44.282888] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 44.287871] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 44.292593] SyS_exit_group+0x1d/0x20 [ 44.296360] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 44.301079] RIP: 0033:0x4453f9 [ 44.304237] RSP: 002b:00007ffe4d34d268 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 44.311908] RAX: ffffffffffffffda RBX: 00007ffe4d34d2a0 RCX: 00000000004453f9