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.233' (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: [ 53.807335] ================================================================== [ 53.808439] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 53.809325] Write of size 8 at addr ffff8801cf3b3678 by task syzkaller419577/2975 [ 53.810320] [ 53.810563] CPU: 1 PID: 2975 Comm: syzkaller419577 Not tainted 4.14.0-rc5+ #134 [ 53.811548] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 53.812779] Call Trace: [ 53.813137] dump_stack+0x194/0x257 [ 53.813636] ? arch_local_irq_restore+0x53/0x53 [ 53.814269] ? show_regs_print_info+0x65/0x65 [ 53.814869] ? lock_timer_base+0x1a3/0x2b0 [ 53.815466] ? detach_if_pending+0x557/0x610 [ 53.816081] print_address_description+0x73/0x250 [ 53.816725] ? detach_if_pending+0x557/0x610 [ 53.817331] kasan_report+0x25b/0x340 [ 53.817845] __asan_report_store8_noabort+0x17/0x20 [ 53.818509] detach_if_pending+0x557/0x610 [ 53.819090] ? trace_raw_output_tick_stop+0x130/0x130 [ 53.819781] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 53.820399] ? lock_timer_base+0x1a3/0x2b0 [ 53.820981] ? lock_timer_base+0x1eb/0x2b0 [ 53.821550] ? __internal_add_timer+0x2d0/0x2d0 [ 53.822173] ? lock_downgrade+0x990/0x990 [ 53.822739] ? trace_hardirqs_on+0xd/0x10 [ 53.823302] try_to_del_timer_sync+0xa2/0x120 [ 53.823920] ? del_timer+0x130/0x130 [ 53.824424] ? del_timer_sync+0xeb/0x240 [ 53.824975] del_timer_sync+0x18a/0x240 [ 53.825513] tun_free_netdev+0x105/0x1b0 [ 53.826058] ? tun_xdp+0x410/0x410 [ 53.826534] ? cpumask_next+0x24/0x30 [ 53.827061] ? netdev_refcnt_read+0xed/0x150 [ 53.827824] ? tun_xdp+0x410/0x410 [ 53.831331] netdev_run_todo+0x870/0xca0 [ 53.835360] ? do_group_exit+0x149/0x400 [ 53.839391] ? mark_held_locks+0xaf/0x100 [ 53.843509] ? register_netdev+0x30/0x30 [ 53.847541] ? find_held_lock+0x35/0x1d0 [ 53.851580] ? lock_downgrade+0x990/0x990 [ 53.855701] ? refcount_sub_and_test+0x115/0x1b0 [ 53.860424] ? refcount_inc+0x50/0x50 [ 53.864191] ? refcount_inc+0x50/0x50 [ 53.867965] ? sk_destruct+0x4c/0x80 [ 53.871648] ? __sk_free+0x5c/0x230 [ 53.875242] ? sk_free+0x2f/0x40 [ 53.878573] ? __tun_detach+0x176/0x1390 [ 53.882613] ? tun_attach+0xfa0/0xfa0 [ 53.886394] ? locks_remove_file+0x3fa/0x5a0 [ 53.890772] ? fcntl_setlk+0x10c0/0x10c0 [ 53.894801] ? __fsnotify_parent+0xb4/0x3a0 [ 53.899089] ? fsnotify+0x1af0/0x1af0 [ 53.902860] ? __tun_detach+0x1390/0x1390 [ 53.906974] rtnl_unlock+0xe/0x10 [ 53.910503] tun_chr_close+0x49/0x60 [ 53.914182] __fput+0x327/0x7e0 [ 53.917431] ? fput+0x140/0x140 [ 53.920680] ? check_same_owner+0x320/0x320 [ 53.924975] ____fput+0x15/0x20 [ 53.928220] task_work_run+0x199/0x270 [ 53.932076] ? task_work_cancel+0x210/0x210 [ 53.936364] ? free_nsproxy+0x185/0x1f0 [ 53.940306] ? switch_task_namespaces+0xa2/0xc0 [ 53.944945] do_exit+0x9b5/0x1ad0 [ 53.948366] ? kvfree+0x3b/0x60 [ 53.951615] ? mm_update_next_owner+0x930/0x930 [ 53.956249] ? rtnl_unlock+0xe/0x10 [ 53.959840] ? __tun_chr_ioctl+0x27a/0x3d20 [ 53.964135] ? tun_chr_read_iter+0x1e0/0x1e0 [ 53.968507] ? find_held_lock+0x35/0x1d0 [ 53.972541] ? __do_page_fault+0x64c/0xd60 [ 53.976744] ? lock_downgrade+0x990/0x990 [ 53.980865] ? handle_mm_fault+0x410/0x8d0 [ 53.985078] ? check_same_owner+0x320/0x320 [ 53.989363] ? up_read+0x1a/0x40 [ 53.992694] ? __do_page_fault+0x3d6/0xd60 [ 53.996899] ? tun_chr_compat_ioctl+0x30/0x30 [ 54.001358] ? tun_chr_ioctl+0x2a/0x40 [ 54.005211] ? tun_chr_ioctl+0x2a/0x40 [ 54.009069] ? do_vfs_ioctl+0x486/0x1520 [ 54.013101] ? ioctl_preallocate+0x2b0/0x2b0 [ 54.017479] ? selinux_capable+0x40/0x40 [ 54.021508] ? putname+0xf3/0x130 [ 54.024933] do_group_exit+0x149/0x400 [ 54.028789] ? SyS_exit+0x30/0x30 [ 54.032210] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 54.037195] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 54.041917] SyS_exit_group+0x1d/0x20 [ 54.045687] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 54.051535] RIP: 0033:0x4454e9 [ 54.054689] RSP: 002b:00007ffca654d078 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 54.062362] RAX: ffffffffffffffda RBX: 00007ffca654d0b0 RCX: 00000000004454e9 [ 54.069596] RDX: 00000000004454e9 RSI: 000000002023f000 RDI: 0000000000000001 [ 54.076830] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffca654d0b0 [ 54.084064] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402830 [ 54.091300] R13: 00000000004028c0 R14: 0000000000000000 R15: 0000000000000000 [ 54.099143] [ 54.100740] Allocated by task 2975: [ 54.104336] save_stack_trace+0x16/0x20 [ 54.108275] save_stack+0x43/0xd0 [ 54.111692] kasan_kmalloc+0xad/0xe0 [ 54.115369] __kmalloc_node+0x47/0x70 [ 54.119132] kvmalloc_node+0x64/0xd0 [ 54.122813] alloc_netdev_mqs+0x16e/0xed0 [ 54.126924] __tun_chr_ioctl+0x12b2/0x3d20 [ 54.131124] tun_chr_ioctl+0x2a/0x40 [ 54.134801] do_vfs_ioctl+0x1b1/0x1520 [ 54.138652] SyS_ioctl+0x8f/0xc0 [ 54.141985] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 54.146704] [ 54.148294] Freed by task 2975: [ 54.151537] save_stack_trace+0x16/0x20 [ 54.155475] save_stack+0x43/0xd0 [ 54.158909] kasan_slab_free+0x71/0xc0 [ 54.162758] kfree+0xca/0x250 [ 54.165827] kvfree+0x36/0x60 [ 54.168896] free_netdev+0x2cf/0x360 [ 54.172572] __tun_chr_ioctl+0x2cea/0x3d20 [ 54.176771] tun_chr_ioctl+0x2a/0x40 [ 54.180449] do_vfs_ioctl+0x1b1/0x1520 [ 54.184299] SyS_ioctl+0x8f/0xc0 [ 54.187634] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 54.192351] [ 54.193944] The buggy address belongs to the object at ffff8801cf3b0340 [ 54.193944] which belongs to the cache kmalloc-16384 of size 16384 [ 54.206910] The buggy address is located 13112 bytes inside of [ 54.206910] 16384-byte region [ffff8801cf3b0340, ffff8801cf3b4340) [ 54.219092] The buggy address belongs to the page: [ 54.223984] page:ffffea00073cec00 count:1 mapcount:0 mapping:ffff8801cf3b0340 index:0x0 compound_mapcount: 0 [ 54.233926] flags: 0x200000000008100(slab|head) [ 54.238562] raw: 0200000000008100 ffff8801cf3b0340 0000000000000000 0000000100000001 [ 54.246404] raw: ffffea000744aa20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 54.254246] page dumped because: kasan: bad access detected [ 54.259919] [ 54.261514] Memory state around the buggy address: [ 54.266405] ffff8801cf3b3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 54.273727] ffff8801cf3b3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 54.281049] >ffff8801cf3b3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 54.288368] ^ [ 54.295615] ffff8801cf3b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 54.302936] ffff8801cf3b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 54.310256] ================================================================== [ 54.317575] Disabling lock debugging due to kernel taint [ 54.322984] Kernel panic - not syncing: panic_on_warn set ... [ 54.322984] [ 54.330308] CPU: 1 PID: 2975 Comm: syzkaller419577 Tainted: G B 4.14.0-rc5+ #134 [ 54.338929] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 54.348244] Call Trace: [ 54.350798] dump_stack+0x194/0x257 [ 54.354390] ? arch_local_irq_restore+0x53/0x53 [ 54.359020] ? kasan_end_report+0x32/0x50 [ 54.363131] ? lock_downgrade+0x990/0x990 [ 54.367243] ? detach_if_pending+0x510/0x610 [ 54.371620] panic+0x1e4/0x417 [ 54.374776] ? __warn+0x1d9/0x1d9 [ 54.378200] ? detach_if_pending+0x557/0x610 [ 54.382572] kasan_end_report+0x50/0x50 [ 54.386513] kasan_report+0x144/0x340 [ 54.390279] __asan_report_store8_noabort+0x17/0x20 [ 54.395256] detach_if_pending+0x557/0x610 [ 54.399458] ? trace_raw_output_tick_stop+0x130/0x130 [ 54.404613] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 54.409242] ? lock_timer_base+0x1a3/0x2b0 [ 54.413440] ? lock_timer_base+0x1eb/0x2b0 [ 54.417641] ? __internal_add_timer+0x2d0/0x2d0 [ 54.422271] ? lock_downgrade+0x990/0x990 [ 54.426381] ? trace_hardirqs_on+0xd/0x10 [ 54.430494] try_to_del_timer_sync+0xa2/0x120 [ 54.434951] ? del_timer+0x130/0x130 [ 54.438628] ? del_timer_sync+0xeb/0x240 [ 54.442653] del_timer_sync+0x18a/0x240 [ 54.446595] tun_free_netdev+0x105/0x1b0 [ 54.450625] ? tun_xdp+0x410/0x410 [ 54.454128] ? cpumask_next+0x24/0x30 [ 54.457892] ? netdev_refcnt_read+0xed/0x150 [ 54.462264] ? tun_xdp+0x410/0x410 [ 54.465770] netdev_run_todo+0x870/0xca0 [ 54.469796] ? do_group_exit+0x149/0x400 [ 54.473822] ? mark_held_locks+0xaf/0x100 [ 54.477932] ? register_netdev+0x30/0x30 [ 54.481958] ? find_held_lock+0x35/0x1d0 [ 54.485989] ? lock_downgrade+0x990/0x990 [ 54.490102] ? refcount_sub_and_test+0x115/0x1b0 [ 54.494821] ? refcount_inc+0x50/0x50 [ 54.498584] ? refcount_inc+0x50/0x50 [ 54.502353] ? sk_destruct+0x4c/0x80 [ 54.506028] ? __sk_free+0x5c/0x230 [ 54.509622] ? sk_free+0x2f/0x40 [ 54.512953] ? __tun_detach+0x176/0x1390 [ 54.516983] ? tun_attach+0xfa0/0xfa0 [ 54.520750] ? locks_remove_file+0x3fa/0x5a0 [ 54.525121] ? fcntl_setlk+0x10c0/0x10c0 [ 54.529145] ? __fsnotify_parent+0xb4/0x3a0 [ 54.533430] ? fsnotify+0x1af0/0x1af0 [ 54.537198] ? __tun_detach+0x1390/0x1390 [ 54.541309] rtnl_unlock+0xe/0x10 [ 54.544723] tun_chr_close+0x49/0x60 [ 54.548402] __fput+0x327/0x7e0 [ 54.551646] ? fput+0x140/0x140 [ 54.554890] ? check_same_owner+0x320/0x320 [ 54.559179] ____fput+0x15/0x20 [ 54.562424] task_work_run+0x199/0x270 [ 54.566275] ? task_work_cancel+0x210/0x210 [ 54.570562] ? free_nsproxy+0x185/0x1f0 [ 54.574503] ? switch_task_namespaces+0xa2/0xc0 [ 54.579137] do_exit+0x9b5/0x1ad0 [ 54.582557] ? kvfree+0x3b/0x60 [ 54.585803] ? mm_update_next_owner+0x930/0x930 [ 54.590439] ? rtnl_unlock+0xe/0x10 [ 54.594030] ? __tun_chr_ioctl+0x27a/0x3d20 [ 54.598321] ? tun_chr_read_iter+0x1e0/0x1e0 [ 54.602693] ? find_held_lock+0x35/0x1d0 [ 54.606720] ? __do_page_fault+0x64c/0xd60 [ 54.610922] ? lock_downgrade+0x990/0x990 [ 54.615041] ? handle_mm_fault+0x410/0x8d0 [ 54.619247] ? check_same_owner+0x320/0x320 [ 54.623532] ? up_read+0x1a/0x40 [ 54.626862] ? __do_page_fault+0x3d6/0xd60 [ 54.631062] ? tun_chr_compat_ioctl+0x30/0x30 [ 54.635526] ? tun_chr_ioctl+0x2a/0x40 [ 54.639377] ? tun_chr_ioctl+0x2a/0x40 [ 54.643237] ? do_vfs_ioctl+0x486/0x1520 [ 54.647267] ? ioctl_preallocate+0x2b0/0x2b0 [ 54.651644] ? selinux_capable+0x40/0x40 [ 54.655668] ? putname+0xf3/0x130 [ 54.659091] do_group_exit+0x149/0x400 [ 54.662942] ? SyS_exit+0x30/0x30 [ 54.666360] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 54.671341] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 54.676063] SyS_exit_group+0x1d/0x20 [ 54.679842] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 54.684563] RIP: 0033:0x4454e9 [ 54.687719] RSP: 002b:00007ffca654d078 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 54.695400] RAX: ffffffffffffffda RBX: 00007ffca654d0b0 RCX: 00000000004454e9 [ 54.702652] RDX: 00000000004454e9 RSI: 000000002023f000 RDI: 0000000000000001 [ 54.709886] RBP: 0000000000000082 R08: 0000000000000000 R09: 00007ffca654d0b0 [ 54.717119] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402830 [ 54.724363] R13: 00000000004028c0 R14: 0000000000000000 R15: 0000000000000000