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-4,10.128.0.55' (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: [ 35.252359] ================================================================== [ 35.253468] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 35.254360] Write of size 8 at addr ffff8801cdaa3780 by task syzkaller775768/2980 [ 35.255359] [ 35.255595] CPU: 0 PID: 2980 Comm: syzkaller775768 Not tainted 4.14.0-rc4-mm1+ #16 [ 35.256607] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.257829] Call Trace: [ 35.258190] dump_stack+0x194/0x257 [ 35.258696] ? arch_local_irq_restore+0x53/0x53 [ 35.259321] ? show_regs_print_info+0x65/0x65 [ 35.259927] ? lock_timer_base+0x1a3/0x2b0 [ 35.260503] ? detach_if_pending+0x557/0x610 [ 35.261097] print_address_description+0x73/0x250 [ 35.261748] ? detach_if_pending+0x557/0x610 [ 35.262344] kasan_report+0x25b/0x340 [ 35.262864] __asan_report_store8_noabort+0x17/0x20 [ 35.263532] detach_if_pending+0x557/0x610 [ 35.264108] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.264806] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.265430] ? lock_timer_base+0x1a3/0x2b0 [ 35.266001] ? lock_timer_base+0x1eb/0x2b0 [ 35.266575] ? __internal_add_timer+0x2d0/0x2d0 [ 35.267201] ? trace_hardirqs_on+0xd/0x10 [ 35.267767] try_to_del_timer_sync+0xa2/0x120 [ 35.268370] ? del_timer+0x130/0x130 [ 35.268877] ? del_timer_sync+0xeb/0x240 [ 35.269431] del_timer_sync+0x18a/0x240 [ 35.269972] tun_free_netdev+0x105/0x1b0 [ 35.270520] ? tun_xdp+0x410/0x410 [ 35.270998] ? cpumask_next+0x24/0x30 [ 35.271514] ? netdev_refcnt_read+0xed/0x150 [ 35.272116] netdev_run_todo+0x683/0xae0 [ 35.272668] ? tun_xdp+0x410/0x410 [ 35.276179] ? register_netdev+0x30/0x30 [ 35.280213] ? refcount_inc+0x50/0x50 [ 35.283985] ? refcount_inc+0x50/0x50 [ 35.287762] ? sk_destruct+0x4c/0x80 [ 35.291447] ? __sk_free+0x5c/0x230 [ 35.295046] ? sk_free+0x2f/0x40 [ 35.298384] ? __tun_detach+0x760/0x1570 [ 35.302441] ? locks_remove_file+0x3fa/0x5a0 [ 35.306822] ? fcntl_setlk+0x10d0/0x10d0 [ 35.310862] ? fsnotify+0x1af0/0x1af0 [ 35.314640] ? __tun_detach+0x1570/0x1570 [ 35.318764] rtnl_unlock+0xe/0x10 [ 35.322189] tun_chr_close+0x49/0x60 [ 35.325872] __fput+0x333/0x7f0 [ 35.329127] ? fput+0x140/0x140 [ 35.332378] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.336850] ____fput+0x15/0x20 [ 35.340100] task_work_run+0x199/0x270 [ 35.343961] ? task_work_cancel+0x210/0x210 [ 35.348253] ? _raw_spin_unlock+0x22/0x30 [ 35.352370] ? switch_task_namespaces+0x87/0xc0 [ 35.357015] do_exit+0x9c8/0x1b00 [ 35.360444] ? mm_update_next_owner+0x930/0x930 [ 35.365085] ? find_held_lock+0x39/0x1d0 [ 35.369127] ? lock_downgrade+0x990/0x990 [ 35.373267] ? handle_mm_fault+0x410/0x8d0 [ 35.377470] ? __do_page_fault+0x31e/0xd60 [ 35.381678] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.386226] ? vmacache_find+0x5f/0x280 [ 35.390177] ? up_read+0x1a/0x40 [ 35.393513] ? __do_page_fault+0x3d6/0xd60 [ 35.397726] ? mm_fault_error+0x2c0/0x2c0 [ 35.401850] ? trace_hardirqs_off+0xd/0x10 [ 35.406058] ? do_page_fault+0xee/0x720 [ 35.410003] ? __do_page_fault+0xd60/0xd60 [ 35.414216] do_group_exit+0x149/0x400 [ 35.418072] ? lockdep_sys_exit+0x47/0xf0 [ 35.422189] ? SyS_exit+0x30/0x30 [ 35.425617] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.430604] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 35.435332] SyS_exit_group+0x1d/0x20 [ 35.439103] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.443827] RIP: 0033:0x443d18 [ 35.446984] RSP: 002b:00007ffd3f869c28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 35.454665] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443d18 [ 35.461902] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 35.469139] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 35.476377] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 35.483616] R13: 00000000007f45e0 R14: 0000000000000000 R15: 0000000000000000 [ 35.490870] [ 35.492469] Allocated by task 3004: [ 35.496066] save_stack+0x43/0xd0 [ 35.499485] kasan_kmalloc+0xad/0xe0 [ 35.503165] __kmalloc_node+0x47/0x70 [ 35.506932] kvmalloc_node+0x64/0xd0 [ 35.510614] alloc_netdev_mqs+0x16d/0xed0 [ 35.514730] __tun_chr_ioctl+0x1386/0x3e40 [ 35.518930] tun_chr_ioctl+0x2a/0x40 [ 35.522612] do_vfs_ioctl+0x1b1/0x1530 [ 35.526467] SyS_ioctl+0x8f/0xc0 [ 35.529804] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.534524] [ 35.536122] Freed by task 3004: [ 35.539371] save_stack+0x43/0xd0 [ 35.542791] kasan_slab_free+0x71/0xc0 [ 35.546644] kfree+0xca/0x250 [ 35.549717] kvfree+0x36/0x60 [ 35.552792] free_netdev+0x2cf/0x360 [ 35.556473] __tun_chr_ioctl+0x2df6/0x3e40 [ 35.560674] tun_chr_ioctl+0x2a/0x40 [ 35.564356] do_vfs_ioctl+0x1b1/0x1530 [ 35.568209] SyS_ioctl+0x8f/0xc0 [ 35.571541] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 35.576263] [ 35.577859] The buggy address belongs to the object at ffff8801cdaa0380 [ 35.577859] which belongs to the cache kmalloc-16384 of size 16384 [ 35.590830] The buggy address is located 13312 bytes inside of [ 35.590830] 16384-byte region [ffff8801cdaa0380, ffff8801cdaa4380) [ 35.603014] The buggy address belongs to the page: [ 35.607910] page:ffffea000736a800 count:1 mapcount:0 mapping:ffff8801cdaa0380 index:0x0 compound_mapcount: 0 [ 35.617854] flags: 0x200000000008100(slab|head) [ 35.622496] raw: 0200000000008100 ffff8801cdaa0380 0000000000000000 0000000100000001 [ 35.630343] raw: ffffea0007360620 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 35.638191] page dumped because: kasan: bad access detected [ 35.643865] [ 35.645460] Memory state around the buggy address: [ 35.650358] ffff8801cdaa3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.657682] ffff8801cdaa3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.665008] >ffff8801cdaa3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.672331] ^ [ 35.675664] ffff8801cdaa3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.682988] ffff8801cdaa3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 35.690311] ================================================================== [ 35.697634] Disabling lock debugging due to kernel taint [ 35.703044] Kernel panic - not syncing: panic_on_warn set ... [ 35.703044] [ 35.710369] CPU: 0 PID: 2980 Comm: syzkaller775768 Tainted: G B 4.14.0-rc4-mm1+ #16 [ 35.719336] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 35.728651] Call Trace: [ 35.731202] dump_stack+0x194/0x257 [ 35.734793] ? arch_local_irq_restore+0x53/0x53 [ 35.739426] ? vprintk_default+0x28/0x30 [ 35.743453] ? detach_if_pending+0x540/0x610 [ 35.747826] panic+0x1e4/0x41c [ 35.750982] ? refcount_error_report+0x214/0x214 [ 35.755707] ? detach_if_pending+0x557/0x610 [ 35.760077] kasan_end_report+0x50/0x50 [ 35.764013] kasan_report+0x144/0x340 [ 35.767777] __asan_report_store8_noabort+0x17/0x20 [ 35.772760] detach_if_pending+0x557/0x610 [ 35.777309] ? trace_raw_output_tick_stop+0x130/0x130 [ 35.782462] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 35.787092] ? lock_timer_base+0x1a3/0x2b0 [ 35.791292] ? lock_timer_base+0x1eb/0x2b0 [ 35.795490] ? __internal_add_timer+0x2d0/0x2d0 [ 35.800122] ? trace_hardirqs_on+0xd/0x10 [ 35.804235] try_to_del_timer_sync+0xa2/0x120 [ 35.808694] ? del_timer+0x130/0x130 [ 35.812371] ? del_timer_sync+0xeb/0x240 [ 35.816397] del_timer_sync+0x18a/0x240 [ 35.820335] tun_free_netdev+0x105/0x1b0 [ 35.824358] ? tun_xdp+0x410/0x410 [ 35.827859] ? cpumask_next+0x24/0x30 [ 35.831623] ? netdev_refcnt_read+0xed/0x150 [ 35.835998] netdev_run_todo+0x683/0xae0 [ 35.840022] ? tun_xdp+0x410/0x410 [ 35.843524] ? register_netdev+0x30/0x30 [ 35.847548] ? refcount_inc+0x50/0x50 [ 35.851310] ? refcount_inc+0x50/0x50 [ 35.855077] ? sk_destruct+0x4c/0x80 [ 35.858754] ? __sk_free+0x5c/0x230 [ 35.862345] ? sk_free+0x2f/0x40 [ 35.865675] ? __tun_detach+0x760/0x1570 [ 35.869711] ? locks_remove_file+0x3fa/0x5a0 [ 35.874414] ? fcntl_setlk+0x10d0/0x10d0 [ 35.878447] ? fsnotify+0x1af0/0x1af0 [ 35.882216] ? __tun_detach+0x1570/0x1570 [ 35.886329] rtnl_unlock+0xe/0x10 [ 35.889750] tun_chr_close+0x49/0x60 [ 35.893430] __fput+0x333/0x7f0 [ 35.896678] ? fput+0x140/0x140 [ 35.899922] ? _raw_spin_unlock_irq+0x27/0x70 [ 35.904383] ____fput+0x15/0x20 [ 35.907629] task_work_run+0x199/0x270 [ 35.911481] ? task_work_cancel+0x210/0x210 [ 35.915764] ? _raw_spin_unlock+0x22/0x30 [ 35.919874] ? switch_task_namespaces+0x87/0xc0 [ 35.924506] do_exit+0x9c8/0x1b00 [ 35.927928] ? mm_update_next_owner+0x930/0x930 [ 35.932561] ? find_held_lock+0x39/0x1d0 [ 35.936590] ? lock_downgrade+0x990/0x990 [ 35.940711] ? handle_mm_fault+0x410/0x8d0 [ 35.944908] ? __do_page_fault+0x31e/0xd60 [ 35.949105] ? __handle_mm_fault+0x39c0/0x39c0 [ 35.953647] ? vmacache_find+0x5f/0x280 [ 35.957590] ? up_read+0x1a/0x40 [ 35.960930] ? __do_page_fault+0x3d6/0xd60 [ 35.965141] ? mm_fault_error+0x2c0/0x2c0 [ 35.969257] ? trace_hardirqs_off+0xd/0x10 [ 35.973455] ? do_page_fault+0xee/0x720 [ 35.977393] ? __do_page_fault+0xd60/0xd60 [ 35.981597] do_group_exit+0x149/0x400 [ 35.985447] ? lockdep_sys_exit+0x47/0xf0 [ 35.989556] ? SyS_exit+0x30/0x30 [ 35.992972] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 35.997953] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 36.002672] SyS_exit_group+0x1d/0x20 [ 36.006549] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 36.011267] RIP: 0033:0x443d18 [ 36.014423] RSP: 002b:00007ffd3f869c28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 36.022093] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443d18 [ 36.029327] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 36.036560] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 36.043793] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 36.051028] R13: 00000000007f45e0 R14: 0000000000000000 R15: 0000000000000000