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-3,10.128.0.28' (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: [ 32.823459] ================================================================== [ 32.824587] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 32.825493] Write of size 8 at addr ffff8801ce0b3740 by task syzkaller020097/2981 [ 32.826498] [ 32.826749] CPU: 0 PID: 2981 Comm: syzkaller020097 Not tainted 4.14.0-rc2+ #109 [ 32.827729] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.828977] Call Trace: [ 32.829354] dump_stack+0x194/0x257 [ 32.829881] ? arch_local_irq_restore+0x53/0x53 [ 32.830543] ? show_regs_print_info+0x65/0x65 [ 32.831151] ? lock_timer_base+0x1a3/0x2b0 [ 32.831742] ? detach_if_pending+0x557/0x610 [ 32.832338] print_address_description+0x73/0x250 [ 32.832989] ? detach_if_pending+0x557/0x610 [ 32.833583] kasan_report+0x25b/0x340 [ 32.834119] __asan_report_store8_noabort+0x17/0x20 [ 32.834791] detach_if_pending+0x557/0x610 [ 32.835365] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.836061] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.836689] ? lock_timer_base+0x1a3/0x2b0 [ 32.837366] ? lock_timer_base+0x1eb/0x2b0 [ 32.837975] ? __internal_add_timer+0x2d0/0x2d0 [ 32.838644] ? trace_hardirqs_on+0xd/0x10 [ 32.839255] try_to_del_timer_sync+0xa2/0x120 [ 32.839913] ? del_timer+0x130/0x130 [ 32.840435] ? del_timer_sync+0xeb/0x240 [ 32.841022] del_timer_sync+0x18a/0x240 [ 32.841569] tun_free_netdev+0x105/0x1b0 [ 32.842121] ? tun_xdp+0x410/0x410 [ 32.842603] ? cpumask_next+0x24/0x30 [ 32.843126] ? netdev_refcnt_read+0xed/0x150 [ 32.843995] ? tun_xdp+0x410/0x410 [ 32.847530] netdev_run_todo+0x870/0xca0 [ 32.851584] ? do_group_exit+0x149/0x400 [ 32.855653] ? register_netdev+0x30/0x30 [ 32.859721] ? lock_downgrade+0x990/0x990 [ 32.863868] ? trace_hardirqs_on+0xd/0x10 [ 32.868029] ? refcount_sub_and_test+0x115/0x1b0 [ 32.872767] ? refcount_inc+0x50/0x50 [ 32.876543] ? refcount_inc+0x50/0x50 [ 32.880325] ? sk_destruct+0x4c/0x80 [ 32.884012] ? __sk_free+0x5c/0x230 [ 32.887615] ? sk_free+0x2f/0x40 [ 32.890955] ? __tun_detach+0x176/0x1390 [ 32.895001] ? tun_attach+0xf90/0xf90 [ 32.898781] ? do_raw_spin_trylock+0x190/0x190 [ 32.903341] ? locks_remove_file+0x3fa/0x5a0 [ 32.907747] ? fcntl_setlk+0x10d0/0x10d0 [ 32.911787] ? __fsnotify_parent+0xb4/0x3a0 [ 32.916091] ? fsnotify+0x1af0/0x1af0 [ 32.919873] ? __tun_detach+0x1390/0x1390 [ 32.923996] rtnl_unlock+0xe/0x10 [ 32.927418] tun_chr_close+0x49/0x60 [ 32.931278] __fput+0x333/0x7f0 [ 32.934536] ? fput+0x140/0x140 [ 32.937792] ? check_same_owner+0x320/0x320 [ 32.942084] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.946918] ____fput+0x15/0x20 [ 32.950168] task_work_run+0x199/0x270 [ 32.954029] ? task_work_cancel+0x210/0x210 [ 32.958324] ? _raw_spin_unlock+0x22/0x30 [ 32.962451] ? switch_task_namespaces+0x87/0xc0 [ 32.967103] do_exit+0x9d2/0x1af0 [ 32.970534] ? mm_update_next_owner+0x930/0x930 [ 32.975182] ? __pmd_alloc+0x4e0/0x4e0 [ 32.979058] ? find_held_lock+0x39/0x1d0 [ 32.983102] ? lock_downgrade+0x990/0x990 [ 32.987248] ? handle_mm_fault+0x410/0x8d0 [ 32.991454] ? down_read_trylock+0xdb/0x170 [ 32.995754] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.000308] ? vmacache_find+0x5f/0x280 [ 33.004262] ? up_read+0x1a/0x40 [ 33.007602] ? __do_page_fault+0x35b/0xb60 [ 33.011833] ? do_vfs_ioctl+0x492/0x1530 [ 33.015891] ? do_page_fault+0xee/0x720 [ 33.019837] ? __do_page_fault+0xb60/0xb60 [ 33.024041] ? putname+0xf3/0x130 [ 33.027472] do_group_exit+0x149/0x400 [ 33.031336] ? lockdep_sys_exit+0x47/0xf0 [ 33.035456] ? SyS_exit+0x30/0x30 [ 33.038910] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 33.043904] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 33.048644] SyS_exit_group+0x1d/0x20 [ 33.052506] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.057232] RIP: 0033:0x443658 [ 33.060392] RSP: 002b:00007ffdff1b4738 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 33.068075] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443658 [ 33.075315] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 33.082556] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 33.089796] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 33.097212] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 33.104471] [ 33.106070] Allocated by task 2981: [ 33.109672] save_stack_trace+0x16/0x20 [ 33.113634] save_stack+0x43/0xd0 [ 33.117060] kasan_kmalloc+0xad/0xe0 [ 33.120756] __kmalloc_node+0x47/0x70 [ 33.124529] kvmalloc_node+0x64/0xd0 [ 33.128213] alloc_netdev_mqs+0x16e/0xed0 [ 33.132347] __tun_chr_ioctl+0x12be/0x3d20 [ 33.136550] tun_chr_ioctl+0x2a/0x40 [ 33.140235] do_vfs_ioctl+0x1b1/0x1530 [ 33.144171] SyS_ioctl+0x8f/0xc0 [ 33.147519] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.152258] [ 33.153869] Freed by task 2981: [ 33.157121] save_stack_trace+0x16/0x20 [ 33.161069] save_stack+0x43/0xd0 [ 33.164492] kasan_slab_free+0x71/0xc0 [ 33.168436] kfree+0xca/0x250 [ 33.171513] kvfree+0x36/0x60 [ 33.174591] free_netdev+0x2cf/0x360 [ 33.178275] __tun_chr_ioctl+0x2cf6/0x3d20 [ 33.182491] tun_chr_ioctl+0x2a/0x40 [ 33.186177] do_vfs_ioctl+0x1b1/0x1530 [ 33.190032] SyS_ioctl+0x8f/0xc0 [ 33.193375] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.198097] [ 33.199695] The buggy address belongs to the object at ffff8801ce0b0340 [ 33.199695] which belongs to the cache kmalloc-16384 of size 16384 [ 33.212759] The buggy address is located 13312 bytes inside of [ 33.212759] 16384-byte region [ffff8801ce0b0340, ffff8801ce0b4340) [ 33.224949] The buggy address belongs to the page: [ 33.229855] page:ffffea0007382c00 count:1 mapcount:0 mapping:ffff8801ce0b0340 index:0x0 compound_mapcount: 0 [ 33.239805] flags: 0x200000000008100(slab|head) [ 33.244446] raw: 0200000000008100 ffff8801ce0b0340 0000000000000000 0000000100000001 [ 33.252382] raw: ffffea0007381a20 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 33.260231] page dumped because: kasan: bad access detected [ 33.265907] [ 33.267503] Memory state around the buggy address: [ 33.272401] ffff8801ce0b3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.279730] ffff8801ce0b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.287059] >ffff8801ce0b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.294388] ^ [ 33.299804] ffff8801ce0b3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.307140] ffff8801ce0b3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 33.314736] ================================================================== [ 33.322071] Disabling lock debugging due to kernel taint [ 33.327482] Kernel panic - not syncing: panic_on_warn set ... [ 33.327482] [ 33.334811] CPU: 0 PID: 2981 Comm: syzkaller020097 Tainted: G B 4.14.0-rc2+ #109 [ 33.343616] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 33.352937] Call Trace: [ 33.355501] dump_stack+0x194/0x257 [ 33.359098] ? arch_local_irq_restore+0x53/0x53 [ 33.363743] ? vprintk_default+0x28/0x30 [ 33.367775] ? detach_if_pending+0x4d0/0x610 [ 33.372151] panic+0x1e4/0x417 [ 33.375307] ? __warn+0x1d9/0x1d9 [ 33.378743] ? detach_if_pending+0x557/0x610 [ 33.383116] kasan_end_report+0x50/0x50 [ 33.387054] kasan_report+0x144/0x340 [ 33.390821] __asan_report_store8_noabort+0x17/0x20 [ 33.395810] detach_if_pending+0x557/0x610 [ 33.400019] ? trace_raw_output_tick_stop+0x130/0x130 [ 33.405176] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 33.409807] ? lock_timer_base+0x1a3/0x2b0 [ 33.414269] ? lock_timer_base+0x1eb/0x2b0 [ 33.418471] ? __internal_add_timer+0x2d0/0x2d0 [ 33.423109] ? trace_hardirqs_on+0xd/0x10 [ 33.427226] try_to_del_timer_sync+0xa2/0x120 [ 33.431700] ? del_timer+0x130/0x130 [ 33.435380] ? del_timer_sync+0xeb/0x240 [ 33.439409] del_timer_sync+0x18a/0x240 [ 33.443351] tun_free_netdev+0x105/0x1b0 [ 33.447388] ? tun_xdp+0x410/0x410 [ 33.450896] ? cpumask_next+0x24/0x30 [ 33.454666] ? netdev_refcnt_read+0xed/0x150 [ 33.459050] ? tun_xdp+0x410/0x410 [ 33.462557] netdev_run_todo+0x870/0xca0 [ 33.466610] ? do_group_exit+0x149/0x400 [ 33.470637] ? register_netdev+0x30/0x30 [ 33.474751] ? lock_downgrade+0x990/0x990 [ 33.478866] ? trace_hardirqs_on+0xd/0x10 [ 33.482990] ? refcount_sub_and_test+0x115/0x1b0 [ 33.487732] ? refcount_inc+0x50/0x50 [ 33.491498] ? refcount_inc+0x50/0x50 [ 33.496413] ? sk_destruct+0x4c/0x80 [ 33.500101] ? __sk_free+0x5c/0x230 [ 33.503718] ? sk_free+0x2f/0x40 [ 33.507056] ? __tun_detach+0x176/0x1390 [ 33.511088] ? tun_attach+0xf90/0xf90 [ 33.514856] ? do_raw_spin_trylock+0x190/0x190 [ 33.519405] ? locks_remove_file+0x3fa/0x5a0 [ 33.523780] ? fcntl_setlk+0x10d0/0x10d0 [ 33.527808] ? __fsnotify_parent+0xb4/0x3a0 [ 33.532112] ? fsnotify+0x1af0/0x1af0 [ 33.535897] ? __tun_detach+0x1390/0x1390 [ 33.540012] rtnl_unlock+0xe/0x10 [ 33.543429] tun_chr_close+0x49/0x60 [ 33.547111] __fput+0x333/0x7f0 [ 33.550361] ? fput+0x140/0x140 [ 33.553607] ? check_same_owner+0x320/0x320 [ 33.557895] ? _raw_spin_unlock_irq+0x27/0x70 [ 33.562358] ____fput+0x15/0x20 [ 33.565607] task_work_run+0x199/0x270 [ 33.569462] ? task_work_cancel+0x210/0x210 [ 33.573751] ? _raw_spin_unlock+0x22/0x30 [ 33.577865] ? switch_task_namespaces+0x87/0xc0 [ 33.582503] do_exit+0x9d2/0x1af0 [ 33.585926] ? mm_update_next_owner+0x930/0x930 [ 33.590572] ? __pmd_alloc+0x4e0/0x4e0 [ 33.594439] ? find_held_lock+0x39/0x1d0 [ 33.598473] ? lock_downgrade+0x990/0x990 [ 33.602608] ? handle_mm_fault+0x410/0x8d0 [ 33.606810] ? down_read_trylock+0xdb/0x170 [ 33.611098] ? __handle_mm_fault+0x39c0/0x39c0 [ 33.615658] ? vmacache_find+0x5f/0x280 [ 33.619602] ? up_read+0x1a/0x40 [ 33.622937] ? __do_page_fault+0x35b/0xb60 [ 33.627137] ? do_vfs_ioctl+0x492/0x1530 [ 33.631181] ? do_page_fault+0xee/0x720 [ 33.635122] ? __do_page_fault+0xb60/0xb60 [ 33.639333] ? putname+0xf3/0x130 [ 33.642761] do_group_exit+0x149/0x400 [ 33.646617] ? lockdep_sys_exit+0x47/0xf0 [ 33.650729] ? SyS_exit+0x30/0x30 [ 33.654147] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 33.659149] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 33.663958] SyS_exit_group+0x1d/0x20 [ 33.667726] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 33.672445] RIP: 0033:0x443658 [ 33.675600] RSP: 002b:00007ffdff1b4738 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 33.683272] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443658 [ 33.690508] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 33.697758] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 33.705007] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 33.712247] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000