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-7,10.128.15.222' (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: [ 56.696407] ================================================================== [ 56.703818] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 56.710561] Write of size 8 at addr ffff8801cd483780 by task syzkaller055361/2978 [ 56.718150] [ 56.719751] CPU: 1 PID: 2978 Comm: syzkaller055361 Not tainted 4.14.0-rc4-mm1+ #16 [ 56.727432] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 56.736758] Call Trace: [ 56.739327] dump_stack+0x194/0x257 [ 56.742931] ? arch_local_irq_restore+0x53/0x53 [ 56.747578] ? show_regs_print_info+0x65/0x65 [ 56.752052] ? lock_timer_base+0x1a3/0x2b0 [ 56.756261] ? detach_if_pending+0x557/0x610 [ 56.760645] print_address_description+0x73/0x250 [ 56.765463] ? detach_if_pending+0x557/0x610 [ 56.769846] kasan_report+0x25b/0x340 [ 56.773622] __asan_report_store8_noabort+0x17/0x20 [ 56.778610] detach_if_pending+0x557/0x610 [ 56.782819] ? trace_raw_output_tick_stop+0x130/0x130 [ 56.787988] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 56.792626] ? lock_timer_base+0x1a3/0x2b0 [ 56.796831] ? lock_timer_base+0x1eb/0x2b0 [ 56.801040] ? __internal_add_timer+0x2d0/0x2d0 [ 56.805681] ? trace_hardirqs_on+0xd/0x10 [ 56.809807] try_to_del_timer_sync+0xa2/0x120 [ 56.814271] ? del_timer+0x130/0x130 [ 56.817957] ? del_timer_sync+0xeb/0x240 [ 56.821996] del_timer_sync+0x18a/0x240 [ 56.825947] tun_free_netdev+0x105/0x1b0 [ 56.829980] ? tun_xdp+0x410/0x410 [ 56.833489] ? cpumask_next+0x24/0x30 [ 56.837264] ? netdev_refcnt_read+0xed/0x150 [ 56.841652] netdev_run_todo+0x683/0xae0 [ 56.845687] ? tun_xdp+0x410/0x410 [ 56.849197] ? register_netdev+0x30/0x30 [ 56.853232] ? refcount_inc+0x50/0x50 [ 56.857003] ? refcount_inc+0x50/0x50 [ 56.860780] ? sk_destruct+0x4c/0x80 [ 56.864478] ? __sk_free+0x5c/0x230 [ 56.868077] ? sk_free+0x2f/0x40 [ 56.871414] ? __tun_detach+0x760/0x1570 [ 56.875470] ? locks_remove_file+0x3fa/0x5a0 [ 56.879851] ? fcntl_setlk+0x10d0/0x10d0 [ 56.883890] ? fsnotify+0x1af0/0x1af0 [ 56.887668] ? __tun_detach+0x1570/0x1570 [ 56.891786] rtnl_unlock+0xe/0x10 [ 56.895219] tun_chr_close+0x49/0x60 [ 56.898908] __fput+0x333/0x7f0 [ 56.902164] ? fput+0x140/0x140 [ 56.905415] ? check_same_owner+0x320/0x320 [ 56.909706] ? _raw_spin_unlock_irq+0x27/0x70 [ 56.914175] ____fput+0x15/0x20 [ 56.917423] task_work_run+0x199/0x270 [ 56.921282] ? task_work_cancel+0x210/0x210 [ 56.925572] ? _raw_spin_unlock+0x22/0x30 [ 56.929695] ? switch_task_namespaces+0x87/0xc0 [ 56.934341] do_exit+0x9c8/0x1b00 [ 56.937773] ? mm_update_next_owner+0x930/0x930 [ 56.942417] ? find_held_lock+0x39/0x1d0 [ 56.946470] ? lock_downgrade+0x990/0x990 [ 56.950619] ? handle_mm_fault+0x410/0x8d0 [ 56.954848] ? __do_page_fault+0x31e/0xd60 [ 56.959068] ? __handle_mm_fault+0x39c0/0x39c0 [ 56.963619] ? vmacache_find+0x5f/0x280 [ 56.967574] ? up_read+0x1a/0x40 [ 56.970913] ? __do_page_fault+0x3d6/0xd60 [ 56.975144] ? mm_fault_error+0x2c0/0x2c0 [ 56.979268] ? do_vfs_ioctl+0x492/0x1530 [ 56.983315] ? do_page_fault+0xee/0x720 [ 56.987264] ? __do_page_fault+0xd60/0xd60 [ 56.991471] ? putname+0xf3/0x130 [ 56.994904] do_group_exit+0x149/0x400 [ 56.998762] ? lockdep_sys_exit+0x47/0xf0 [ 57.002879] ? SyS_exit+0x30/0x30 [ 57.006311] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.011302] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 57.016033] SyS_exit_group+0x1d/0x20 [ 57.019815] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.024549] RIP: 0033:0x4435d8 [ 57.027725] RSP: 002b:00007ffd51553ac8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 57.035407] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435d8 [ 57.042646] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 57.049884] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 57.057126] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 57.064368] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 57.071626] [ 57.073225] Allocated by task 2978: [ 57.076836] save_stack+0x43/0xd0 [ 57.080259] kasan_kmalloc+0xad/0xe0 [ 57.083940] __kmalloc_node+0x47/0x70 [ 57.087713] kvmalloc_node+0x64/0xd0 [ 57.091401] alloc_netdev_mqs+0x16d/0xed0 [ 57.095520] __tun_chr_ioctl+0x1386/0x3e40 [ 57.099721] tun_chr_ioctl+0x2a/0x40 [ 57.103403] do_vfs_ioctl+0x1b1/0x1530 [ 57.107259] SyS_ioctl+0x8f/0xc0 [ 57.110594] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.115322] [ 57.116922] Freed by task 2978: [ 57.120174] save_stack+0x43/0xd0 [ 57.123598] kasan_slab_free+0x71/0xc0 [ 57.127453] kfree+0xca/0x250 [ 57.130529] kvfree+0x36/0x60 [ 57.133601] free_netdev+0x2cf/0x360 [ 57.137288] __tun_chr_ioctl+0x2df6/0x3e40 [ 57.141509] tun_chr_ioctl+0x2a/0x40 [ 57.145193] do_vfs_ioctl+0x1b1/0x1530 [ 57.149049] SyS_ioctl+0x8f/0xc0 [ 57.152384] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.157103] [ 57.158701] The buggy address belongs to the object at ffff8801cd480380 [ 57.158701] which belongs to the cache kmalloc-16384 of size 16384 [ 57.171676] The buggy address is located 13312 bytes inside of [ 57.171676] 16384-byte region [ffff8801cd480380, ffff8801cd484380) [ 57.183867] The buggy address belongs to the page: [ 57.188771] page:ffffea0007352000 count:1 mapcount:0 mapping:ffff8801cd480380 index:0x0 compound_mapcount: 0 [ 57.198715] flags: 0x200000000008100(slab|head) [ 57.203353] raw: 0200000000008100 ffff8801cd480380 0000000000000000 0000000100000001 [ 57.211202] raw: ffffea0006ffa820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 57.219050] page dumped because: kasan: bad access detected [ 57.224727] [ 57.226326] Memory state around the buggy address: [ 57.231223] ffff8801cd483680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.238552] ffff8801cd483700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.245881] >ffff8801cd483780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.253209] ^ [ 57.256543] ffff8801cd483800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.263871] ffff8801cd483880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 57.271196] ================================================================== [ 57.278519] Disabling lock debugging due to kernel taint [ 57.283931] Kernel panic - not syncing: panic_on_warn set ... [ 57.283931] [ 57.291255] CPU: 1 PID: 2978 Comm: syzkaller055361 Tainted: G B 4.14.0-rc4-mm1+ #16 [ 57.300223] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 57.309538] Call Trace: [ 57.312094] dump_stack+0x194/0x257 [ 57.315688] ? arch_local_irq_restore+0x53/0x53 [ 57.320322] ? vprintk_default+0x28/0x30 [ 57.324352] ? detach_if_pending+0x540/0x610 [ 57.328727] panic+0x1e4/0x41c [ 57.331883] ? refcount_error_report+0x214/0x214 [ 57.336607] ? detach_if_pending+0x557/0x610 [ 57.340977] kasan_end_report+0x50/0x50 [ 57.344917] kasan_report+0x144/0x340 [ 57.348682] __asan_report_store8_noabort+0x17/0x20 [ 57.353662] detach_if_pending+0x557/0x610 [ 57.357864] ? trace_raw_output_tick_stop+0x130/0x130 [ 57.363016] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 57.367645] ? lock_timer_base+0x1a3/0x2b0 [ 57.371842] ? lock_timer_base+0x1eb/0x2b0 [ 57.376044] ? __internal_add_timer+0x2d0/0x2d0 [ 57.380678] ? trace_hardirqs_on+0xd/0x10 [ 57.384808] try_to_del_timer_sync+0xa2/0x120 [ 57.389274] ? del_timer+0x130/0x130 [ 57.392951] ? del_timer_sync+0xeb/0x240 [ 57.396979] del_timer_sync+0x18a/0x240 [ 57.400917] tun_free_netdev+0x105/0x1b0 [ 57.404940] ? tun_xdp+0x410/0x410 [ 57.408444] ? cpumask_next+0x24/0x30 [ 57.412212] ? netdev_refcnt_read+0xed/0x150 [ 57.416586] netdev_run_todo+0x683/0xae0 [ 57.420611] ? tun_xdp+0x410/0x410 [ 57.424115] ? register_netdev+0x30/0x30 [ 57.428140] ? refcount_inc+0x50/0x50 [ 57.431902] ? refcount_inc+0x50/0x50 [ 57.435670] ? sk_destruct+0x4c/0x80 [ 57.439351] ? __sk_free+0x5c/0x230 [ 57.442942] ? sk_free+0x2f/0x40 [ 57.446276] ? __tun_detach+0x760/0x1570 [ 57.450313] ? locks_remove_file+0x3fa/0x5a0 [ 57.454683] ? fcntl_setlk+0x10d0/0x10d0 [ 57.458712] ? fsnotify+0x1af0/0x1af0 [ 57.462479] ? __tun_detach+0x1570/0x1570 [ 57.466592] rtnl_unlock+0xe/0x10 [ 57.470007] tun_chr_close+0x49/0x60 [ 57.473686] __fput+0x333/0x7f0 [ 57.476931] ? fput+0x140/0x140 [ 57.480175] ? check_same_owner+0x320/0x320 [ 57.484463] ? _raw_spin_unlock_irq+0x27/0x70 [ 57.488924] ____fput+0x15/0x20 [ 57.492167] task_work_run+0x199/0x270 [ 57.496018] ? task_work_cancel+0x210/0x210 [ 57.500301] ? _raw_spin_unlock+0x22/0x30 [ 57.504413] ? switch_task_namespaces+0x87/0xc0 [ 57.509048] do_exit+0x9c8/0x1b00 [ 57.512467] ? mm_update_next_owner+0x930/0x930 [ 57.517101] ? find_held_lock+0x39/0x1d0 [ 57.521128] ? lock_downgrade+0x990/0x990 [ 57.525258] ? handle_mm_fault+0x410/0x8d0 [ 57.529457] ? __do_page_fault+0x31e/0xd60 [ 57.533656] ? __handle_mm_fault+0x39c0/0x39c0 [ 57.538228] ? vmacache_find+0x5f/0x280 [ 57.542172] ? up_read+0x1a/0x40 [ 57.545503] ? __do_page_fault+0x3d6/0xd60 [ 57.549709] ? mm_fault_error+0x2c0/0x2c0 [ 57.553824] ? do_vfs_ioctl+0x492/0x1530 [ 57.557853] ? do_page_fault+0xee/0x720 [ 57.561793] ? __do_page_fault+0xd60/0xd60 [ 57.565991] ? putname+0xf3/0x130 [ 57.569414] do_group_exit+0x149/0x400 [ 57.573265] ? lockdep_sys_exit+0x47/0xf0 [ 57.577377] ? SyS_exit+0x30/0x30 [ 57.580798] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 57.585781] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 57.590506] SyS_exit_group+0x1d/0x20 [ 57.594275] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 57.598993] RIP: 0033:0x4435d8 [ 57.602148] RSP: 002b:00007ffd51553ac8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 57.609826] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004435d8 [ 57.617059] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 57.624294] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 57.631527] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 57.638761] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000