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-6,10.128.0.37' (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: [ 36.263517] ================================================================== [ 36.270929] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 36.277653] Write of size 8 at addr ffff8801ce123780 by task syzkaller807652/2993 [ 36.285240] [ 36.286851] CPU: 1 PID: 2993 Comm: syzkaller807652 Not tainted 4.14.0-rc2+ #102 [ 36.294267] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.303595] Call Trace: [ 36.306158] dump_stack+0x194/0x257 [ 36.309761] ? arch_local_irq_restore+0x53/0x53 [ 36.314402] ? show_regs_print_info+0x65/0x65 [ 36.318872] ? lock_timer_base+0x1a3/0x2b0 [ 36.323082] ? detach_if_pending+0x557/0x610 [ 36.328062] print_address_description+0x73/0x250 [ 36.332875] ? detach_if_pending+0x557/0x610 [ 36.337254] kasan_report+0x25b/0x340 [ 36.341029] __asan_report_store8_noabort+0x17/0x20 [ 36.346014] detach_if_pending+0x557/0x610 [ 36.350222] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.355383] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.360021] ? lock_timer_base+0x1a3/0x2b0 [ 36.364228] ? lock_timer_base+0x1eb/0x2b0 [ 36.368435] ? __internal_add_timer+0x2d0/0x2d0 [ 36.373077] ? trace_hardirqs_on+0xd/0x10 [ 36.377202] try_to_del_timer_sync+0xa2/0x120 [ 36.381666] ? del_timer+0x130/0x130 [ 36.385351] ? del_timer_sync+0xeb/0x240 [ 36.389387] del_timer_sync+0x18a/0x240 [ 36.393334] tun_free_netdev+0x105/0x1b0 [ 36.397364] ? tun_xdp+0x410/0x410 [ 36.400874] ? cpumask_next+0x24/0x30 [ 36.404663] ? netdev_refcnt_read+0xed/0x150 [ 36.409047] ? tun_xdp+0x410/0x410 [ 36.412561] netdev_run_todo+0x870/0xca0 [ 36.416594] ? do_group_exit+0x149/0x400 [ 36.420632] ? register_netdev+0x30/0x30 [ 36.424665] ? lock_downgrade+0x990/0x990 [ 36.428782] ? trace_hardirqs_on+0xd/0x10 [ 36.432919] ? refcount_sub_and_test+0x115/0x1b0 [ 36.437647] ? refcount_inc+0x50/0x50 [ 36.441418] ? refcount_inc+0x50/0x50 [ 36.445192] ? sk_destruct+0x4c/0x80 [ 36.448873] ? __sk_free+0x5c/0x230 [ 36.452471] ? sk_free+0x2f/0x40 [ 36.455809] ? __tun_detach+0x176/0x1390 [ 36.459852] ? tun_attach+0xf90/0xf90 [ 36.463633] ? locks_remove_file+0x3fa/0x5a0 [ 36.468013] ? fcntl_setlk+0x10d0/0x10d0 [ 36.472048] ? __fsnotify_parent+0xb4/0x3a0 [ 36.476341] ? fsnotify+0x1af0/0x1af0 [ 36.480118] ? __tun_detach+0x1390/0x1390 [ 36.484235] rtnl_unlock+0xe/0x10 [ 36.487658] tun_chr_close+0x49/0x60 [ 36.491341] __fput+0x333/0x7f0 [ 36.494597] ? fput+0x140/0x140 [ 36.497847] ? check_same_owner+0x320/0x320 [ 36.502147] ____fput+0x15/0x20 [ 36.505398] task_work_run+0x199/0x270 [ 36.509259] ? task_work_cancel+0x210/0x210 [ 36.513550] ? free_nsproxy+0x185/0x1f0 [ 36.517503] ? switch_task_namespaces+0xa2/0xc0 [ 36.522152] do_exit+0x9d2/0x1af0 [ 36.525584] ? mm_update_next_owner+0x930/0x930 [ 36.530223] ? __pmd_alloc+0x4e0/0x4e0 [ 36.534107] ? find_held_lock+0x39/0x1d0 [ 36.538151] ? lock_downgrade+0x990/0x990 [ 36.542297] ? handle_mm_fault+0x410/0x8d0 [ 36.546498] ? down_read_trylock+0xdb/0x170 [ 36.550793] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.555351] ? vmacache_find+0x5f/0x280 [ 36.559295] ? vmacache_update+0xfe/0x130 [ 36.563418] ? up_read+0x1a/0x40 [ 36.566755] ? __do_page_fault+0x35b/0xb60 [ 36.570961] ? do_vfs_ioctl+0x492/0x1530 [ 36.575001] ? do_page_fault+0xee/0x720 [ 36.578946] ? __do_page_fault+0xb60/0xb60 [ 36.583156] ? putname+0xf3/0x130 [ 36.586595] do_group_exit+0x149/0x400 [ 36.590457] ? lockdep_sys_exit+0x47/0xf0 [ 36.594575] ? SyS_exit+0x30/0x30 [ 36.598000] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 36.602993] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 36.607729] SyS_exit_group+0x1d/0x20 [ 36.611503] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 36.616226] RIP: 0033:0x445139 [ 36.619385] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 36.627063] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445139 [ 36.634301] RDX: 0000000000445139 RSI: 0000000020533000 RDI: 0000000000000001 [ 36.641541] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 36.648780] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402790 [ 36.656025] R13: 0000000000402820 R14: 0000000000000000 R15: 0000000000000000 [ 36.663283] [ 36.664882] Allocated by task 2993: [ 36.668477] save_stack_trace+0x16/0x20 [ 36.672422] save_stack+0x43/0xd0 [ 36.675843] kasan_kmalloc+0xad/0xe0 [ 36.679525] __kmalloc_node+0x47/0x70 [ 36.683292] kvmalloc_node+0x64/0xd0 [ 36.686974] alloc_netdev_mqs+0x16e/0xed0 [ 36.691091] __tun_chr_ioctl+0x12be/0x3d20 [ 36.695293] tun_chr_ioctl+0x2a/0x40 [ 36.698976] do_vfs_ioctl+0x1b1/0x1530 [ 36.702829] SyS_ioctl+0x8f/0xc0 [ 36.706164] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 36.710885] [ 36.712481] Freed by task 2993: [ 36.715729] save_stack_trace+0x16/0x20 [ 36.719672] save_stack+0x43/0xd0 [ 36.723092] kasan_slab_free+0x71/0xc0 [ 36.726946] kfree+0xca/0x250 [ 36.730022] kvfree+0x36/0x60 [ 36.733104] free_netdev+0x2cf/0x360 [ 36.736787] __tun_chr_ioctl+0x2cf6/0x3d20 [ 36.740987] tun_chr_ioctl+0x2a/0x40 [ 36.744669] do_vfs_ioctl+0x1b1/0x1530 [ 36.748523] SyS_ioctl+0x8f/0xc0 [ 36.751857] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 36.756577] [ 36.758173] The buggy address belongs to the object at ffff8801ce120380 [ 36.758173] which belongs to the cache kmalloc-16384 of size 16384 [ 36.771145] The buggy address is located 13312 bytes inside of [ 36.771145] 16384-byte region [ffff8801ce120380, ffff8801ce124380) [ 36.783341] The buggy address belongs to the page: [ 36.788238] page:ffffea0007384800 count:1 mapcount:0 mapping:ffff8801ce120380 index:0x0 compound_mapcount: 0 [ 36.798181] flags: 0x200000000008100(slab|head) [ 36.802821] raw: 0200000000008100 ffff8801ce120380 0000000000000000 0000000100000001 [ 36.810671] raw: ffffea000736ae20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 36.818604] page dumped because: kasan: bad access detected [ 36.824280] [ 36.825876] Memory state around the buggy address: [ 36.830774] ffff8801ce123680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.838101] ffff8801ce123700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.845425] >ffff8801ce123780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.852749] ^ [ 36.856083] ffff8801ce123800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.863411] ffff8801ce123880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.870735] ================================================================== [ 36.878061] Disabling lock debugging due to kernel taint [ 36.883479] Kernel panic - not syncing: panic_on_warn set ... [ 36.883479] [ 36.890804] CPU: 1 PID: 2993 Comm: syzkaller807652 Tainted: G B 4.14.0-rc2+ #102 [ 36.899427] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.908749] Call Trace: [ 36.911302] dump_stack+0x194/0x257 [ 36.914895] ? arch_local_irq_restore+0x53/0x53 [ 36.919531] ? vprintk_default+0x28/0x30 [ 36.923559] ? detach_if_pending+0x540/0x610 [ 36.927934] panic+0x1e4/0x417 [ 36.931091] ? __warn+0x1d9/0x1d9 [ 36.934513] ? detach_if_pending+0x557/0x610 [ 36.938891] kasan_end_report+0x50/0x50 [ 36.942827] kasan_report+0x144/0x340 [ 36.946600] __asan_report_store8_noabort+0x17/0x20 [ 36.951580] detach_if_pending+0x557/0x610 [ 36.955778] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.960933] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.965564] ? lock_timer_base+0x1a3/0x2b0 [ 36.970023] ? lock_timer_base+0x1eb/0x2b0 [ 36.974221] ? __internal_add_timer+0x2d0/0x2d0 [ 36.978854] ? trace_hardirqs_on+0xd/0x10 [ 36.982971] try_to_del_timer_sync+0xa2/0x120 [ 36.987429] ? del_timer+0x130/0x130 [ 36.991106] ? del_timer_sync+0xeb/0x240 [ 36.995134] del_timer_sync+0x18a/0x240 [ 36.999072] tun_free_netdev+0x105/0x1b0 [ 37.003095] ? tun_xdp+0x410/0x410 [ 37.006596] ? cpumask_next+0x24/0x30 [ 37.010363] ? netdev_refcnt_read+0xed/0x150 [ 37.014737] ? tun_xdp+0x410/0x410 [ 37.018240] netdev_run_todo+0x870/0xca0 [ 37.022271] ? do_group_exit+0x149/0x400 [ 37.026298] ? register_netdev+0x30/0x30 [ 37.030324] ? lock_downgrade+0x990/0x990 [ 37.034436] ? trace_hardirqs_on+0xd/0x10 [ 37.038556] ? refcount_sub_and_test+0x115/0x1b0 [ 37.043276] ? refcount_inc+0x50/0x50 [ 37.047038] ? refcount_inc+0x50/0x50 [ 37.050805] ? sk_destruct+0x4c/0x80 [ 37.054481] ? __sk_free+0x5c/0x230 [ 37.058071] ? sk_free+0x2f/0x40 [ 37.061401] ? __tun_detach+0x176/0x1390 [ 37.065432] ? tun_attach+0xf90/0xf90 [ 37.069203] ? locks_remove_file+0x3fa/0x5a0 [ 37.073576] ? fcntl_setlk+0x10d0/0x10d0 [ 37.077602] ? __fsnotify_parent+0xb4/0x3a0 [ 37.081886] ? fsnotify+0x1af0/0x1af0 [ 37.085654] ? __tun_detach+0x1390/0x1390 [ 37.089767] rtnl_unlock+0xe/0x10 [ 37.093185] tun_chr_close+0x49/0x60 [ 37.096861] __fput+0x333/0x7f0 [ 37.100109] ? fput+0x140/0x140 [ 37.103357] ? check_same_owner+0x320/0x320 [ 37.107645] ____fput+0x15/0x20 [ 37.110887] task_work_run+0x199/0x270 [ 37.114737] ? task_work_cancel+0x210/0x210 [ 37.119023] ? free_nsproxy+0x185/0x1f0 [ 37.122963] ? switch_task_namespaces+0xa2/0xc0 [ 37.127597] do_exit+0x9d2/0x1af0 [ 37.131019] ? mm_update_next_owner+0x930/0x930 [ 37.135650] ? __pmd_alloc+0x4e0/0x4e0 [ 37.139506] ? find_held_lock+0x39/0x1d0 [ 37.143536] ? lock_downgrade+0x990/0x990 [ 37.147657] ? handle_mm_fault+0x410/0x8d0 [ 37.151853] ? down_read_trylock+0xdb/0x170 [ 37.156139] ? __handle_mm_fault+0x39c0/0x39c0 [ 37.160697] ? vmacache_find+0x5f/0x280 [ 37.164635] ? vmacache_update+0xfe/0x130 [ 37.168748] ? up_read+0x1a/0x40 [ 37.172080] ? __do_page_fault+0x35b/0xb60 [ 37.176283] ? do_vfs_ioctl+0x492/0x1530 [ 37.180320] ? do_page_fault+0xee/0x720 [ 37.184267] ? __do_page_fault+0xb60/0xb60 [ 37.188465] ? putname+0xf3/0x130 [ 37.191884] do_group_exit+0x149/0x400 [ 37.195735] ? lockdep_sys_exit+0x47/0xf0 [ 37.199850] ? SyS_exit+0x30/0x30 [ 37.203271] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 37.208256] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 37.212984] SyS_exit_group+0x1d/0x20 [ 37.216750] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 37.221478] RIP: 0033:0x445139 [ 37.224633] RSP: 002b:00000000007efe48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 [ 37.232303] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000445139 [ 37.239538] RDX: 0000000000445139 RSI: 0000000020533000 RDI: 0000000000000001 [ 37.246777] RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 [ 37.254010] R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402790 [ 37.261244] R13: 0000000000402820 R14: 0000000000000000 R15: 0000000000000000