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.202' (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: [ 40.281455] ================================================================== [ 40.288898] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 40.295629] Write of size 8 at addr ffff8801cdd33780 by task syzkaller159889/2981 [ 40.303223] [ 40.304829] CPU: 1 PID: 2981 Comm: syzkaller159889 Not tainted 4.14.0-rc4-mm1+ #16 [ 40.312510] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.321839] Call Trace: [ 40.324405] dump_stack+0x194/0x257 [ 40.328015] ? arch_local_irq_restore+0x53/0x53 [ 40.332659] ? show_regs_print_info+0x65/0x65 [ 40.337134] ? lock_timer_base+0x1a3/0x2b0 [ 40.341346] ? detach_if_pending+0x557/0x610 [ 40.345732] print_address_description+0x73/0x250 [ 40.350551] ? detach_if_pending+0x557/0x610 [ 40.354935] kasan_report+0x25b/0x340 [ 40.358715] __asan_report_store8_noabort+0x17/0x20 [ 40.363706] detach_if_pending+0x557/0x610 [ 40.367916] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.373081] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.377722] ? lock_timer_base+0x1a3/0x2b0 [ 40.381931] ? lock_timer_base+0x1eb/0x2b0 [ 40.386143] ? __internal_add_timer+0x2d0/0x2d0 [ 40.390792] ? trace_hardirqs_on+0xd/0x10 [ 40.394922] try_to_del_timer_sync+0xa2/0x120 [ 40.399392] ? del_timer+0x130/0x130 [ 40.403081] ? del_timer_sync+0xeb/0x240 [ 40.407121] del_timer_sync+0x18a/0x240 [ 40.411071] tun_free_netdev+0x105/0x1b0 [ 40.415104] ? tun_xdp+0x410/0x410 [ 40.418613] ? cpumask_next+0x24/0x30 [ 40.422389] ? netdev_refcnt_read+0xed/0x150 [ 40.426778] netdev_run_todo+0x683/0xae0 [ 40.430814] ? tun_xdp+0x410/0x410 [ 40.434327] ? register_netdev+0x30/0x30 [ 40.438366] ? refcount_inc+0x50/0x50 [ 40.442138] ? refcount_inc+0x50/0x50 [ 40.445919] ? sk_destruct+0x4c/0x80 [ 40.449606] ? __sk_free+0x5c/0x230 [ 40.453208] ? sk_free+0x2f/0x40 [ 40.456550] ? __tun_detach+0x760/0x1570 [ 40.460609] ? locks_remove_file+0x3fa/0x5a0 [ 40.464993] ? fcntl_setlk+0x10d0/0x10d0 [ 40.469048] ? fsnotify+0x1af0/0x1af0 [ 40.472831] ? __tun_detach+0x1570/0x1570 [ 40.476953] rtnl_unlock+0xe/0x10 [ 40.480381] tun_chr_close+0x49/0x60 [ 40.484072] __fput+0x333/0x7f0 [ 40.487331] ? fput+0x140/0x140 [ 40.490587] ? check_same_owner+0x320/0x320 [ 40.494890] ____fput+0x15/0x20 [ 40.498145] task_work_run+0x199/0x270 [ 40.502018] ? task_work_cancel+0x210/0x210 [ 40.506314] ? free_nsproxy+0x185/0x1f0 [ 40.510263] ? switch_task_namespaces+0xa2/0xc0 [ 40.514911] do_exit+0x9c8/0x1b00 [ 40.518338] ? kvfree+0x3b/0x60 [ 40.521595] ? mm_update_next_owner+0x930/0x930 [ 40.526236] ? rtnl_unlock+0xe/0x10 [ 40.529834] ? __tun_chr_ioctl+0x27a/0x3e40 [ 40.534137] ? tun_chr_read_iter+0x1e0/0x1e0 [ 40.538515] ? lock_downgrade+0x990/0x990 [ 40.542659] ? handle_mm_fault+0x410/0x8d0 [ 40.546868] ? __do_page_fault+0x31e/0xd60 [ 40.551086] ? check_same_owner+0x320/0x320 [ 40.555379] ? up_read+0x1a/0x40 [ 40.558718] ? __do_page_fault+0x3d6/0xd60 [ 40.562929] ? tun_chr_compat_ioctl+0x30/0x30 [ 40.567395] ? tun_chr_ioctl+0x2a/0x40 [ 40.571254] ? tun_chr_ioctl+0x2a/0x40 [ 40.575118] ? do_vfs_ioctl+0x492/0x1530 [ 40.579158] ? ioctl_preallocate+0x2b0/0x2b0 [ 40.583545] ? selinux_capable+0x40/0x40 [ 40.587581] ? putname+0xf3/0x130 [ 40.591014] do_group_exit+0x149/0x400 [ 40.594876] ? SyS_exit+0x30/0x30 [ 40.598304] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 40.603299] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 40.608034] SyS_exit_group+0x1d/0x20 [ 40.611813] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.616541] RIP: 0033:0x445569 [ 40.619704] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 40.627390] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569 [ 40.634633] RDX: 0000000000445569 RSI: 00000000205bafd8 RDI: 0000000000000001 [ 40.641874] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 40.649118] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bc0 [ 40.656370] R13: 0000000000402c50 R14: 0000000000000000 R15: 0000000000000000 [ 40.663632] [ 40.665234] Allocated by task 2981: [ 40.668837] save_stack+0x43/0xd0 [ 40.672266] kasan_kmalloc+0xad/0xe0 [ 40.675952] __kmalloc_node+0x47/0x70 [ 40.679727] kvmalloc_node+0x64/0xd0 [ 40.683413] alloc_netdev_mqs+0x16d/0xed0 [ 40.687534] __tun_chr_ioctl+0x1386/0x3e40 [ 40.691739] tun_chr_ioctl+0x2a/0x40 [ 40.695424] do_vfs_ioctl+0x1b1/0x1530 [ 40.699280] SyS_ioctl+0x8f/0xc0 [ 40.702619] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.707341] [ 40.708941] Freed by task 2981: [ 40.712192] save_stack+0x43/0xd0 [ 40.715619] kasan_slab_free+0x71/0xc0 [ 40.719476] kfree+0xca/0x250 [ 40.722554] kvfree+0x36/0x60 [ 40.725631] free_netdev+0x2cf/0x360 [ 40.729316] __tun_chr_ioctl+0x2df6/0x3e40 [ 40.733526] tun_chr_ioctl+0x2a/0x40 [ 40.737216] do_vfs_ioctl+0x1b1/0x1530 [ 40.741074] SyS_ioctl+0x8f/0xc0 [ 40.744416] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 40.749140] [ 40.750742] The buggy address belongs to the object at ffff8801cdd30380 [ 40.750742] which belongs to the cache kmalloc-16384 of size 16384 [ 40.763716] The buggy address is located 13312 bytes inside of [ 40.763716] 16384-byte region [ffff8801cdd30380, ffff8801cdd34380) [ 40.775907] The buggy address belongs to the page: [ 40.780808] page:ffffea0007374c00 count:1 mapcount:0 mapping:ffff8801cdd30380 index:0x0 compound_mapcount: 0 [ 40.790755] flags: 0x200000000008100(slab|head) [ 40.795398] raw: 0200000000008100 ffff8801cdd30380 0000000000000000 0000000100000001 [ 40.803249] raw: ffffea000737e420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 40.811096] page dumped because: kasan: bad access detected [ 40.816774] [ 40.818372] Memory state around the buggy address: [ 40.823270] ffff8801cdd33680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.830600] ffff8801cdd33700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.837930] >ffff8801cdd33780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.845257] ^ [ 40.848592] ffff8801cdd33800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.855924] ffff8801cdd33880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 40.863252] ================================================================== [ 40.870582] Disabling lock debugging due to kernel taint [ 40.875999] Kernel panic - not syncing: panic_on_warn set ... [ 40.875999] [ 40.883415] CPU: 1 PID: 2981 Comm: syzkaller159889 Tainted: G B 4.14.0-rc4-mm1+ #16 [ 40.892387] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 40.901706] Call Trace: [ 40.904266] dump_stack+0x194/0x257 [ 40.907861] ? arch_local_irq_restore+0x53/0x53 [ 40.912498] ? vprintk_default+0x28/0x30 [ 40.916528] ? detach_if_pending+0x540/0x610 [ 40.920905] panic+0x1e4/0x41c [ 40.924061] ? refcount_error_report+0x214/0x214 [ 40.928787] ? detach_if_pending+0x557/0x610 [ 40.933164] kasan_end_report+0x50/0x50 [ 40.937101] kasan_report+0x144/0x340 [ 40.940870] __asan_report_store8_noabort+0x17/0x20 [ 40.945850] detach_if_pending+0x557/0x610 [ 40.950082] ? trace_raw_output_tick_stop+0x130/0x130 [ 40.955238] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 40.959870] ? lock_timer_base+0x1a3/0x2b0 [ 40.964072] ? lock_timer_base+0x1eb/0x2b0 [ 40.968272] ? __internal_add_timer+0x2d0/0x2d0 [ 40.972910] ? trace_hardirqs_on+0xd/0x10 [ 40.977027] try_to_del_timer_sync+0xa2/0x120 [ 40.981487] ? del_timer+0x130/0x130 [ 40.985169] ? del_timer_sync+0xeb/0x240 [ 40.989198] del_timer_sync+0x18a/0x240 [ 40.993144] tun_free_netdev+0x105/0x1b0 [ 40.997169] ? tun_xdp+0x410/0x410 [ 41.000672] ? cpumask_next+0x24/0x30 [ 41.004442] ? netdev_refcnt_read+0xed/0x150 [ 41.008821] netdev_run_todo+0x683/0xae0 [ 41.012850] ? tun_xdp+0x410/0x410 [ 41.016354] ? register_netdev+0x30/0x30 [ 41.020381] ? refcount_inc+0x50/0x50 [ 41.024146] ? refcount_inc+0x50/0x50 [ 41.027916] ? sk_destruct+0x4c/0x80 [ 41.031596] ? __sk_free+0x5c/0x230 [ 41.035187] ? sk_free+0x2f/0x40 [ 41.038521] ? __tun_detach+0x760/0x1570 [ 41.042560] ? locks_remove_file+0x3fa/0x5a0 [ 41.046936] ? fcntl_setlk+0x10d0/0x10d0 [ 41.050969] ? fsnotify+0x1af0/0x1af0 [ 41.054742] ? __tun_detach+0x1570/0x1570 [ 41.058855] rtnl_unlock+0xe/0x10 [ 41.062273] tun_chr_close+0x49/0x60 [ 41.065955] __fput+0x333/0x7f0 [ 41.069203] ? fput+0x140/0x140 [ 41.072452] ? check_same_owner+0x320/0x320 [ 41.076742] ____fput+0x15/0x20 [ 41.079990] task_work_run+0x199/0x270 [ 41.083844] ? task_work_cancel+0x210/0x210 [ 41.088130] ? free_nsproxy+0x185/0x1f0 [ 41.092071] ? switch_task_namespaces+0xa2/0xc0 [ 41.096710] do_exit+0x9c8/0x1b00 [ 41.100139] ? kvfree+0x3b/0x60 [ 41.103386] ? mm_update_next_owner+0x930/0x930 [ 41.108017] ? rtnl_unlock+0xe/0x10 [ 41.111611] ? __tun_chr_ioctl+0x27a/0x3e40 [ 41.115904] ? tun_chr_read_iter+0x1e0/0x1e0 [ 41.120278] ? lock_downgrade+0x990/0x990 [ 41.124403] ? handle_mm_fault+0x410/0x8d0 [ 41.128604] ? __do_page_fault+0x31e/0xd60 [ 41.132811] ? check_same_owner+0x320/0x320 [ 41.137100] ? up_read+0x1a/0x40 [ 41.140433] ? __do_page_fault+0x3d6/0xd60 [ 41.144634] ? tun_chr_compat_ioctl+0x30/0x30 [ 41.149092] ? tun_chr_ioctl+0x2a/0x40 [ 41.152947] ? tun_chr_ioctl+0x2a/0x40 [ 41.156801] ? do_vfs_ioctl+0x492/0x1530 [ 41.160829] ? ioctl_preallocate+0x2b0/0x2b0 [ 41.165208] ? selinux_capable+0x40/0x40 [ 41.169238] ? putname+0xf3/0x130 [ 41.172659] do_group_exit+0x149/0x400 [ 41.176511] ? SyS_exit+0x30/0x30 [ 41.179930] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 41.184912] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 41.189634] SyS_exit_group+0x1d/0x20 [ 41.193420] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 41.198141] RIP: 0033:0x445569 [ 41.201295] RSP: 002b:00000000007efe58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 41.208968] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445569 [ 41.216207] RDX: 0000000000445569 RSI: 00000000205bafd8 RDI: 0000000000000001 [ 41.223442] RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 [ 41.230679] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402bc0 [ 41.237914] R13: 0000000000402c50 R14: 0000000000000000 R15: 0000000000000000 [ 41.245215] Dumping ftrace buffer: [ 41.248723] (ftrace buffer empty) [ 41.252402] Kernel Offset: disabled [ 41.256000] Rebooting in 86400 seconds..