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-0,10.128.0.57' (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.872363] ================================================================== [ 33.879838] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 33.886569] Write of size 8 at addr ffff8801ce723780 by task syzkaller823088/2987 [ 33.894176] [ 33.895781] CPU: 1 PID: 2987 Comm: syzkaller823088 Not tainted 4.13.0+ #76 [ 33.902772] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.912795] Call Trace: [ 33.915370] dump_stack+0x194/0x257 [ 33.918976] ? arch_local_irq_restore+0x53/0x53 [ 33.923631] ? show_regs_print_info+0x65/0x65 [ 33.928107] ? lock_timer_base+0x1a3/0x2b0 [ 33.932323] ? detach_if_pending+0x557/0x610 [ 33.936728] print_address_description+0x73/0x250 [ 33.941559] ? detach_if_pending+0x557/0x610 [ 33.945945] kasan_report+0x24e/0x340 [ 33.949730] __asan_report_store8_noabort+0x17/0x20 [ 33.954724] detach_if_pending+0x557/0x610 [ 33.958954] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.964131] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.968775] ? lock_timer_base+0x1a3/0x2b0 [ 33.972986] ? lock_timer_base+0x1eb/0x2b0 [ 33.977201] ? __internal_add_timer+0x2d0/0x2d0 [ 33.981850] ? trace_hardirqs_on+0xd/0x10 [ 33.985989] try_to_del_timer_sync+0xa2/0x120 [ 33.990459] ? del_timer+0x130/0x130 [ 33.994150] ? del_timer_sync+0xeb/0x240 [ 33.998203] del_timer_sync+0x18a/0x240 [ 34.002166] tun_free_netdev+0x105/0x1b0 [ 34.006205] ? tun_xdp+0x410/0x410 [ 34.009720] ? cpumask_next+0x24/0x30 [ 34.013499] ? netdev_refcnt_read+0xed/0x150 [ 34.017886] ? tun_xdp+0x410/0x410 [ 34.021402] netdev_run_todo+0x870/0xca0 [ 34.025449] ? do_group_exit+0x149/0x400 [ 34.029490] ? register_netdev+0x30/0x30 [ 34.033541] ? lock_downgrade+0x990/0x990 [ 34.037667] ? trace_hardirqs_on+0xd/0x10 [ 34.041813] ? refcount_sub_and_test+0x115/0x1b0 [ 34.046554] ? refcount_inc+0x50/0x50 [ 34.050336] ? refcount_inc+0x50/0x50 [ 34.054116] ? sk_destruct+0x4c/0x80 [ 34.057804] ? __sk_free+0x5c/0x230 [ 34.061409] ? sk_free+0x2f/0x40 [ 34.064755] ? __tun_detach+0x176/0x1390 [ 34.068811] ? tun_attach+0xf90/0xf90 [ 34.072599] ? locks_remove_file+0x3fa/0x5a0 [ 34.076996] ? fcntl_setlk+0x10d0/0x10d0 [ 34.081035] ? __fsnotify_parent+0xb4/0x3a0 [ 34.085331] ? fsnotify+0x1af0/0x1af0 [ 34.089117] ? __tun_detach+0x1390/0x1390 [ 34.093281] ? __tun_detach+0x1390/0x1390 [ 34.097416] rtnl_unlock+0xe/0x10 [ 34.100847] tun_chr_close+0x49/0x60 [ 34.104552] __fput+0x333/0x7f0 [ 34.107825] ? fput+0x140/0x140 [ 34.111114] ? check_same_owner+0x320/0x320 [ 34.115428] ____fput+0x15/0x20 [ 34.118688] task_work_run+0x199/0x270 [ 34.122670] ? task_work_cancel+0x210/0x210 [ 34.126984] ? free_nsproxy+0x185/0x1f0 [ 34.130941] ? switch_task_namespaces+0xa2/0xc0 [ 34.135601] do_exit+0xa52/0x1b40 [ 34.139030] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.144032] ? trace_hardirqs_on+0xd/0x10 [ 34.148169] ? kvfree+0x3b/0x60 [ 34.151428] ? mm_update_next_owner+0x930/0x930 [ 34.156072] ? rtnl_unlock+0xe/0x10 [ 34.159709] ? __tun_chr_ioctl+0x27a/0x3d20 [ 34.164009] ? unwind_get_return_address+0x84/0xa0 [ 34.169011] ? tun_chr_read_iter+0x1e0/0x1e0 [ 34.173400] ? putname+0xee/0x130 [ 34.176831] ? save_stack+0xa3/0xd0 [ 34.180443] ? save_stack_trace+0x16/0x20 [ 34.185989] ? save_stack+0x43/0xd0 [ 34.189609] ? kasan_slab_free+0x71/0xc0 [ 34.193642] ? kmem_cache_free+0x77/0x280 [ 34.197763] ? putname+0xee/0x130 [ 34.201727] ? __lock_is_held+0xbc/0x140 [ 34.205780] ? check_same_owner+0x320/0x320 [ 34.210082] ? tun_chr_compat_ioctl+0x30/0x30 [ 34.214562] ? tun_chr_ioctl+0x2a/0x40 [ 34.218424] ? tun_chr_ioctl+0x2a/0x40 [ 34.222290] ? do_vfs_ioctl+0x492/0x1530 [ 34.226334] ? ioctl_preallocate+0x2b0/0x2b0 [ 34.230723] ? selinux_capable+0x40/0x40 [ 34.234760] ? putname+0xf3/0x130 [ 34.238192] do_group_exit+0x149/0x400 [ 34.242066] ? SyS_exit+0x30/0x30 [ 34.245509] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.250501] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 34.255234] SyS_exit_group+0x1d/0x20 [ 34.259014] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.263748] RIP: 0033:0x4452d9 [ 34.266911] RSP: 002b:00007ffca5478598 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 34.274594] RAX: ffffffffffffffda RBX: 00007ffca54785d0 RCX: 00000000004452d9 [ 34.281836] RDX: 00000000004452d9 RSI: 000000002049afd8 RDI: 0000000000000001 [ 34.289078] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffca54785d0 [ 34.296320] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402680 [ 34.303562] R13: 0000000000402710 R14: 0000000000000000 R15: 0000000000000000 [ 34.310833] [ 34.312434] Allocated by task 2987: [ 34.316036] save_stack_trace+0x16/0x20 [ 34.319983] save_stack+0x43/0xd0 [ 34.323412] kasan_kmalloc+0xad/0xe0 [ 34.327097] __kmalloc_node+0x47/0x70 [ 34.330871] kvmalloc_node+0x64/0xd0 [ 34.334557] alloc_netdev_mqs+0x16e/0xed0 [ 34.338700] __tun_chr_ioctl+0x12be/0x3d20 [ 34.342920] tun_chr_ioctl+0x2a/0x40 [ 34.346622] do_vfs_ioctl+0x1b1/0x1530 [ 34.350489] SyS_ioctl+0x8f/0xc0 [ 34.353837] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.358561] [ 34.360159] Freed by task 2987: [ 34.363410] save_stack_trace+0x16/0x20 [ 34.367364] save_stack+0x43/0xd0 [ 34.370790] kasan_slab_free+0x71/0xc0 [ 34.374659] kfree+0xca/0x250 [ 34.377743] kvfree+0x36/0x60 [ 34.380822] free_netdev+0x2cf/0x360 [ 34.384604] __tun_chr_ioctl+0x2cf6/0x3d20 [ 34.388811] tun_chr_ioctl+0x2a/0x40 [ 34.392496] do_vfs_ioctl+0x1b1/0x1530 [ 34.396353] SyS_ioctl+0x8f/0xc0 [ 34.399693] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 34.404420] [ 34.406023] The buggy address belongs to the object at ffff8801ce720380 [ 34.406023] which belongs to the cache kmalloc-16384 of size 16384 [ 34.419012] The buggy address is located 13312 bytes inside of [ 34.419012] 16384-byte region [ffff8801ce720380, ffff8801ce724380) [ 34.431395] The buggy address belongs to the page: [ 34.436308] page:ffffea000739c800 count:1 mapcount:0 mapping:ffff8801ce720380 index:0x0 compound_mapcount: 0 [ 34.446253] flags: 0x200000000008100(slab|head) [ 34.450896] raw: 0200000000008100 ffff8801ce720380 0000000000000000 0000000100000001 [ 34.458748] raw: ffffea0007383220 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 34.466595] page dumped because: kasan: bad access detected [ 34.472273] [ 34.473872] Memory state around the buggy address: [ 34.478774] ffff8801ce723680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.486116] ffff8801ce723700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.493448] >ffff8801ce723780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.500776] ^ [ 34.504113] ffff8801ce723800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.511443] ffff8801ce723880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 34.518772] ================================================================== [ 34.526100] Disabling lock debugging due to kernel taint [ 34.531524] Kernel panic - not syncing: panic_on_warn set ... [ 34.531524] [ 34.538852] CPU: 1 PID: 2987 Comm: syzkaller823088 Tainted: G B 4.13.0+ #76 [ 34.547043] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 34.556377] Call Trace: [ 34.558937] dump_stack+0x194/0x257 [ 34.562538] ? arch_local_irq_restore+0x53/0x53 [ 34.567176] ? vprintk_default+0x28/0x30 [ 34.571207] ? detach_if_pending+0x470/0x610 [ 34.575586] panic+0x1e4/0x417 [ 34.578755] ? __warn+0x1d9/0x1d9 [ 34.582181] ? detach_if_pending+0x557/0x610 [ 34.586554] kasan_end_report+0x50/0x50 [ 34.590494] kasan_report+0x137/0x340 [ 34.594260] __asan_report_store8_noabort+0x17/0x20 [ 34.599240] detach_if_pending+0x557/0x610 [ 34.603440] ? trace_raw_output_tick_stop+0x130/0x130 [ 34.608599] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 34.613231] ? lock_timer_base+0x1a3/0x2b0 [ 34.617440] ? lock_timer_base+0x1eb/0x2b0 [ 34.621643] ? __internal_add_timer+0x2d0/0x2d0 [ 34.626367] ? trace_hardirqs_on+0xd/0x10 [ 34.630494] try_to_del_timer_sync+0xa2/0x120 [ 34.634956] ? del_timer+0x130/0x130 [ 34.638637] ? del_timer_sync+0xeb/0x240 [ 34.642679] del_timer_sync+0x18a/0x240 [ 34.646624] tun_free_netdev+0x105/0x1b0 [ 34.650666] ? tun_xdp+0x410/0x410 [ 34.654173] ? cpumask_next+0x24/0x30 [ 34.657945] ? netdev_refcnt_read+0xed/0x150 [ 34.662322] ? tun_xdp+0x410/0x410 [ 34.665830] netdev_run_todo+0x870/0xca0 [ 34.669858] ? do_group_exit+0x149/0x400 [ 34.673888] ? register_netdev+0x30/0x30 [ 34.677919] ? lock_downgrade+0x990/0x990 [ 34.682043] ? trace_hardirqs_on+0xd/0x10 [ 34.686167] ? refcount_sub_and_test+0x115/0x1b0 [ 34.690889] ? refcount_inc+0x50/0x50 [ 34.694655] ? refcount_inc+0x50/0x50 [ 34.698429] ? sk_destruct+0x4c/0x80 [ 34.702109] ? __sk_free+0x5c/0x230 [ 34.705703] ? sk_free+0x2f/0x40 [ 34.709045] ? __tun_detach+0x176/0x1390 [ 34.713077] ? tun_attach+0xf90/0xf90 [ 34.716847] ? locks_remove_file+0x3fa/0x5a0 [ 34.721220] ? fcntl_setlk+0x10d0/0x10d0 [ 34.725249] ? __fsnotify_parent+0xb4/0x3a0 [ 34.729559] ? fsnotify+0x1af0/0x1af0 [ 34.733326] ? __tun_detach+0x1390/0x1390 [ 34.737440] ? __tun_detach+0x1390/0x1390 [ 34.741558] rtnl_unlock+0xe/0x10 [ 34.744987] tun_chr_close+0x49/0x60 [ 34.748672] __fput+0x333/0x7f0 [ 34.751933] ? fput+0x140/0x140 [ 34.755181] ? check_same_owner+0x320/0x320 [ 34.759471] ____fput+0x15/0x20 [ 34.762719] task_work_run+0x199/0x270 [ 34.766574] ? task_work_cancel+0x210/0x210 [ 34.770862] ? free_nsproxy+0x185/0x1f0 [ 34.774802] ? switch_task_namespaces+0xa2/0xc0 [ 34.779437] do_exit+0xa52/0x1b40 [ 34.782858] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 34.787849] ? trace_hardirqs_on+0xd/0x10 [ 34.791967] ? kvfree+0x3b/0x60 [ 34.795212] ? mm_update_next_owner+0x930/0x930 [ 34.799858] ? rtnl_unlock+0xe/0x10 [ 34.803449] ? __tun_chr_ioctl+0x27a/0x3d20 [ 34.807740] ? unwind_get_return_address+0x84/0xa0 [ 34.812639] ? tun_chr_read_iter+0x1e0/0x1e0 [ 34.817027] ? putname+0xee/0x130 [ 34.820448] ? save_stack+0xa3/0xd0 [ 34.824051] ? save_stack_trace+0x16/0x20 [ 34.828173] ? save_stack+0x43/0xd0 [ 34.831766] ? kasan_slab_free+0x71/0xc0 [ 34.835791] ? kmem_cache_free+0x77/0x280 [ 34.839903] ? putname+0xee/0x130 [ 34.843325] ? __lock_is_held+0xbc/0x140 [ 34.847361] ? check_same_owner+0x320/0x320 [ 34.851655] ? tun_chr_compat_ioctl+0x30/0x30 [ 34.856115] ? tun_chr_ioctl+0x2a/0x40 [ 34.859969] ? tun_chr_ioctl+0x2a/0x40 [ 34.863832] ? do_vfs_ioctl+0x492/0x1530 [ 34.867862] ? ioctl_preallocate+0x2b0/0x2b0 [ 34.872239] ? selinux_capable+0x40/0x40