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-8,10.128.15.204' (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: [ 33.960493] ================================================================== [ 33.961643] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 33.962565] Write of size 8 at addr ffff8801cddcb7c0 by task syzkaller987350/2981 [ 33.963586] [ 33.963900] CPU: 1 PID: 2981 Comm: syzkaller987350 Not tainted 4.13.0+ #77 [ 33.964825] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.966048] Call Trace: [ 33.966413] dump_stack+0x194/0x257 [ 33.966912] ? arch_local_irq_restore+0x53/0x53 [ 33.967549] ? show_regs_print_info+0x65/0x65 [ 33.968155] ? lock_timer_base+0x1a3/0x2b0 [ 33.968733] ? detach_if_pending+0x557/0x610 [ 33.969402] print_address_description+0x73/0x250 [ 33.970071] ? detach_if_pending+0x557/0x610 [ 33.970708] kasan_report+0x24e/0x340 [ 33.971288] __asan_report_store8_noabort+0x17/0x20 [ 33.972037] detach_if_pending+0x557/0x610 [ 33.972626] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.973332] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.973974] ? lock_timer_base+0x1a3/0x2b0 [ 33.974547] ? lock_timer_base+0x1eb/0x2b0 [ 33.975122] ? __internal_add_timer+0x2d0/0x2d0 [ 33.975748] ? trace_hardirqs_on+0xd/0x10 [ 33.976314] try_to_del_timer_sync+0xa2/0x120 [ 33.976918] ? del_timer+0x130/0x130 [ 33.977422] ? del_timer_sync+0xeb/0x240 [ 33.977995] del_timer_sync+0x18a/0x240 [ 33.978567] tun_free_netdev+0x105/0x1b0 [ 33.979115] ? tun_xdp+0x410/0x410 [ 33.979595] ? cpumask_next+0x24/0x30 [ 33.980133] ? netdev_refcnt_read+0xed/0x150 [ 33.980978] ? tun_xdp+0x410/0x410 [ 33.984488] netdev_run_todo+0x870/0xca0 [ 33.988522] ? do_group_exit+0x149/0x400 [ 33.992560] ? register_netdev+0x30/0x30 [ 33.996598] ? lock_downgrade+0x990/0x990 [ 34.000722] ? trace_hardirqs_on+0xd/0x10 [ 34.004857] ? refcount_sub_and_test+0x115/0x1b0 [ 34.009584] ? refcount_inc+0x50/0x50 [ 34.013355] ? refcount_inc+0x50/0x50 [ 34.017130] ? sk_destruct+0x4c/0x80 [ 34.020815] ? __sk_free+0x5c/0x230 [ 34.024415] ? sk_free+0x2f/0x40 [ 34.027751] ? __tun_detach+0x176/0x1390 [ 34.031807] ? tun_attach+0xf90/0xf90 [ 34.035588] ? locks_remove_file+0x3fa/0x5a0 [ 34.039970] ? fcntl_setlk+0x10d0/0x10d0 [ 34.044004] ? __fsnotify_parent+0xb4/0x3a0 [ 34.048300] ? fsnotify+0x1af0/0x1af0 [ 34.052073] ? __tun_detach+0x1390/0x1390 [ 34.056192] ? __tun_detach+0x1390/0x1390 [ 34.060325] rtnl_unlock+0xe/0x10 [ 34.063749] tun_chr_close+0x49/0x60 [ 34.067435] __fput+0x333/0x7f0 [ 34.070696] ? fput+0x140/0x140 [ 34.073948] ? check_same_owner+0x320/0x320 [ 34.079116] ____fput+0x15/0x20 [ 34.082367] task_work_run+0x199/0x270 [ 34.086226] ? task_work_cancel+0x210/0x210 [ 34.090517] ? free_nsproxy+0x185/0x1f0 [ 34.094463] ? switch_task_namespaces+0xa2/0xc0 [ 34.099107] do_exit+0xa52/0x1b40 [ 34.102531] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.107522] ? check_noncircular+0x20/0x20 [ 34.111735] ? mm_update_next_owner+0x930/0x930 [ 34.116376] ? __pmd_alloc+0x4e0/0x4e0 [ 34.120256] ? find_held_lock+0x39/0x1d0 [ 34.124316] ? lock_downgrade+0x990/0x990 [ 34.128460] ? handle_mm_fault+0x410/0x8d0 [ 34.132666] ? down_read_trylock+0xdb/0x170 [ 34.136960] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.141513] ? vmacache_find+0x61/0x270 [ 34.145464] ? up_read+0x1a/0x40 [ 34.148804] ? __do_page_fault+0x35b/0xb60 [ 34.153008] ? do_vfs_ioctl+0x492/0x1530 [ 34.157065] ? do_page_fault+0xee/0x720 [ 34.161021] ? __do_page_fault+0xb60/0xb60 [ 34.165313] ? putname+0xf3/0x130 [ 34.168744] do_group_exit+0x149/0x400 [ 34.172601] ? lockdep_sys_exit+0x47/0xf0 [ 34.176717] ? SyS_exit+0x30/0x30 [ 34.180141] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.185139] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.189954] SyS_exit_group+0x1d/0x20 [ 34.193727] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.198449] RIP: 0033:0x445109 [ 34.201612] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 34.209303] RAX: ffffffffffffffda RBX: 0000000020001000 RCX: 0000000000445109 [ 34.216542] RDX: 0000000000445109 RSI: 0000000020001000 RDI: 0000000000000001 [ 34.223781] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000020001000 [ 34.231022] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402760 [ 34.238267] R13: 00000000004027f0 R14: 0000000000000000 R15: 0000000000000000 [ 34.245528] [ 34.247127] Allocated by task 2981: [ 34.250725] save_stack_trace+0x16/0x20 [ 34.254668] save_stack+0x43/0xd0 [ 34.258089] kasan_kmalloc+0xad/0xe0 [ 34.261771] __kmalloc_node+0x47/0x70 [ 34.265540] kvmalloc_node+0x64/0xd0 [ 34.269224] alloc_netdev_mqs+0x16e/0xed0 [ 34.273342] __tun_chr_ioctl+0x12be/0x3d20 [ 34.277545] tun_chr_ioctl+0x2a/0x40 [ 34.281227] do_vfs_ioctl+0x1b1/0x1530 [ 34.285092] SyS_ioctl+0x8f/0xc0 [ 34.288427] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.293148] [ 34.294745] Freed by task 2981: [ 34.297992] save_stack_trace+0x16/0x20 [ 34.301937] save_stack+0x43/0xd0 [ 34.305358] kasan_slab_free+0x71/0xc0 [ 34.309225] kfree+0xca/0x250 [ 34.312298] kvfree+0x36/0x60 [ 34.315372] free_netdev+0x2cf/0x360 [ 34.319055] __tun_chr_ioctl+0x2cf6/0x3d20 [ 34.323257] tun_chr_ioctl+0x2a/0x40 [ 34.326938] do_vfs_ioctl+0x1b1/0x1530 [ 34.330793] SyS_ioctl+0x8f/0xc0 [ 34.334127] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.338849] [ 34.340448] The buggy address belongs to the object at ffff8801cddc83c0 [ 34.340448] which belongs to the cache kmalloc-16384 of size 16384 [ 34.353428] The buggy address is located 13312 bytes inside of [ 34.353428] 16384-byte region [ffff8801cddc83c0, ffff8801cddcc3c0) [ 34.365617] The buggy address belongs to the page: [ 34.370515] page:ffffea0007377200 count:1 mapcount:0 mapping:ffff8801cddc83c0 index:0x0 compound_mapcount: 0 [ 34.380459] flags: 0x200000000008100(slab|head) [ 34.385099] raw: 0200000000008100 ffff8801cddc83c0 0000000000000000 0000000100000001 [ 34.392952] raw: ffffea000739ba20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 34.400799] page dumped because: kasan: bad access detected [ 34.406474] [ 34.408070] Memory state around the buggy address: [ 34.412969] ffff8801cddcb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.420313] ffff8801cddcb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.427640] >ffff8801cddcb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.434966] ^ [ 34.440383] ffff8801cddcb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.447711] ffff8801cddcb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.455041] ================================================================== [ 34.462380] Disabling lock debugging due to kernel taint [ 34.467793] Kernel panic - not syncing: panic_on_warn set ... [ 34.467793] [ 34.475118] CPU: 1 PID: 2981 Comm: syzkaller987350 Tainted: G B 4.13.0+ #77 [ 34.483310] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.492627] Call Trace: [ 34.495180] dump_stack+0x194/0x257 [ 34.498774] ? arch_local_irq_restore+0x53/0x53 [ 34.503407] ? vprintk_default+0x28/0x30 [ 34.507435] ? detach_if_pending+0x470/0x610 [ 34.511809] panic+0x1e4/0x417 [ 34.514967] ? __warn+0x1d9/0x1d9 [ 34.518390] ? detach_if_pending+0x557/0x610 [ 34.522761] kasan_end_report+0x50/0x50 [ 34.526699] kasan_report+0x137/0x340 [ 34.530465] __asan_report_store8_noabort+0x17/0x20 [ 34.535443] detach_if_pending+0x557/0x610 [ 34.539642] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.544808] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.549452] ? lock_timer_base+0x1a3/0x2b0 [ 34.553662] ? lock_timer_base+0x1eb/0x2b0 [ 34.557866] ? __internal_add_timer+0x2d0/0x2d0 [ 34.562503] ? trace_hardirqs_on+0xd/0x10 [ 34.566619] try_to_del_timer_sync+0xa2/0x120 [ 34.571078] ? del_timer+0x130/0x130 [ 34.574768] ? del_timer_sync+0xeb/0x240 [ 34.578797] del_timer_sync+0x18a/0x240 [ 34.582738] tun_free_netdev+0x105/0x1b0 [ 34.586775] ? tun_xdp+0x410/0x410 [ 34.590280] ? cpumask_next+0x24/0x30 [ 34.594048] ? netdev_refcnt_read+0xed/0x150 [ 34.598422] ? tun_xdp+0x410/0x410 [ 34.601925] netdev_run_todo+0x870/0xca0 [ 34.605952] ? do_group_exit+0x149/0x400 [ 34.609982] ? register_netdev+0x30/0x30 [ 34.614011] ? lock_downgrade+0x990/0x990 [ 34.618122] ? trace_hardirqs_on+0xd/0x10 [ 34.622244] ? refcount_sub_and_test+0x115/0x1b0 [ 34.626965] ? refcount_inc+0x50/0x50 [ 34.630732] ? refcount_inc+0x50/0x50 [ 34.634497] ? sk_destruct+0x4c/0x80 [ 34.638175] ? __sk_free+0x5c/0x230 [ 34.641766] ? sk_free+0x2f/0x40 [ 34.645096] ? __tun_detach+0x176/0x1390 [ 34.649128] ? tun_attach+0xf90/0xf90 [ 34.652900] ? locks_remove_file+0x3fa/0x5a0 [ 34.657274] ? fcntl_setlk+0x10d0/0x10d0 [ 34.661300] ? __fsnotify_parent+0xb4/0x3a0 [ 34.665586] ? fsnotify+0x1af0/0x1af0 [ 34.669353] ? __tun_detach+0x1390/0x1390 [ 34.673464] ? __tun_detach+0x1390/0x1390 [ 34.677576] rtnl_unlock+0xe/0x10 [ 34.680995] tun_chr_close+0x49/0x60 [ 34.684674] __fput+0x333/0x7f0 [ 34.687920] ? fput+0x140/0x140 [ 34.691167] ? check_same_owner+0x320/0x320 [ 34.695455] ____fput+0x15/0x20 [ 34.698699] task_work_run+0x199/0x270 [ 34.702551] ? task_work_cancel+0x210/0x210 [ 34.706836] ? free_nsproxy+0x185/0x1f0 [ 34.710785] ? switch_task_namespaces+0xa2/0xc0 [ 34.715418] do_exit+0xa52/0x1b40 [ 34.718837] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.723819] ? check_noncircular+0x20/0x20 [ 34.728020] ? mm_update_next_owner+0x930/0x930 [ 34.732653] ? __pmd_alloc+0x4e0/0x4e0 [ 34.736509] ? find_held_lock+0x39/0x1d0 [ 34.740539] ? lock_downgrade+0x990/0x990 [ 34.744660] ? handle_mm_fault+0x410/0x8d0 [ 34.748857] ? down_read_trylock+0xdb/0x170 [ 34.753145] ? __handle_mm_fault+0x39c0/0x39c0 [ 34.757690] ? vmacache_find+0x61/0x270 [ 34.761654] ? up_read+0x1a/0x40 [ 34.764987] ? __do_page_fault+0x35b/0xb60 [ 34.769183] ? do_vfs_ioctl+0x492/0x1530 [ 34.773220] ? do_page_fault+0xee/0x720 [ 34.777158] ? __do_page_fault+0xb60/0xb60 [ 34.781356] ? putname+0xf3/0x130 [ 34.784775] do_group_exit+0x149/0x400 [ 34.788626] ? lockdep_sys_exit+0x47/0xf0 [ 34.792758] ? SyS_exit+0x30/0x30 [ 34.796190] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.801173] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.805895] SyS_exit_group+0x1d/0x20 [ 34.809661] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.814379] RIP: 0033:0x445109 [ 34.817534] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 34.825207] RAX: ffffffffffffffda RBX: 0000000020001000 RCX: 0000000000445109 [ 34.832441] RDX: 0000000000445109 RSI: 0000000020001000 RDI: 0000000000000001 [ 34.840035] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000020001000 [ 34.847268] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402760 [ 34.854512] R13: 00000000004027f0 R14: 0000000000000000 R15: 0000000000000000