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-386-2,10.128.0.48' (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: [ 31.602456] ================================================================== [ 31.603711] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 31.604624] Write of size 8 at addr ffff8801ceafb740 by task syzkaller665313/2980 [ 31.605624] [ 31.605862] CPU: 0 PID: 2980 Comm: syzkaller665313 Not tainted 4.14.0-rc3+ #23 [ 31.606912] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 31.608154] Call Trace: [ 31.608516] dump_stack+0x194/0x257 [ 31.609031] ? arch_local_irq_restore+0x53/0x53 [ 31.609657] ? show_regs_print_info+0x65/0x65 [ 31.610266] ? lock_timer_base+0x1a3/0x2b0 [ 31.610855] ? detach_if_pending+0x557/0x610 [ 31.611451] print_address_description+0x73/0x250 [ 31.612101] ? detach_if_pending+0x557/0x610 [ 31.612694] kasan_report+0x25b/0x340 [ 31.613215] __asan_report_store8_noabort+0x17/0x20 [ 31.613884] detach_if_pending+0x557/0x610 [ 31.614460] ? trace_raw_output_tick_stop+0x130/0x130 [ 31.615154] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 31.615816] ? lock_timer_base+0x1a3/0x2b0 [ 31.616387] ? lock_timer_base+0x1eb/0x2b0 [ 31.616965] ? __internal_add_timer+0x2d0/0x2d0 [ 31.617595] ? trace_hardirqs_on+0xd/0x10 [ 31.618167] try_to_del_timer_sync+0xa2/0x120 [ 31.618769] ? del_timer+0x130/0x130 [ 31.619276] ? del_timer_sync+0xeb/0x240 [ 31.619831] del_timer_sync+0x18a/0x240 [ 31.620371] tun_free_netdev+0x105/0x1b0 [ 31.620953] ? tun_xdp+0x410/0x410 [ 31.621435] ? cpumask_next+0x24/0x30 [ 31.621954] ? netdev_refcnt_read+0xed/0x150 [ 31.622552] ? tun_xdp+0x410/0x410 [ 31.623047] netdev_run_todo+0x870/0xca0 [ 31.627083] ? do_group_exit+0x149/0x400 [ 31.631121] ? register_netdev+0x30/0x30 [ 31.635157] ? lock_downgrade+0x990/0x990 [ 31.639277] ? trace_hardirqs_on+0xd/0x10 [ 31.643415] ? refcount_sub_and_test+0x115/0x1b0 [ 31.648143] ? refcount_inc+0x50/0x50 [ 31.651915] ? refcount_inc+0x50/0x50 [ 31.655692] ? sk_destruct+0x4c/0x80 [ 31.659376] ? __sk_free+0x5c/0x230 [ 31.662974] ? sk_free+0x2f/0x40 [ 31.666309] ? __tun_detach+0x176/0x1390 [ 31.670353] ? tun_attach+0xf90/0xf90 [ 31.674129] ? do_raw_spin_trylock+0x190/0x190 [ 31.678684] ? locks_remove_file+0x3fa/0x5a0 [ 31.683064] ? fcntl_setlk+0x10d0/0x10d0 [ 31.687098] ? __fsnotify_parent+0xb4/0x3a0 [ 31.691393] ? fsnotify+0x1af0/0x1af0 [ 31.695168] ? __tun_detach+0x1390/0x1390 [ 31.699285] ? __tun_detach+0x1390/0x1390 [ 31.703402] rtnl_unlock+0xe/0x10 [ 31.706823] tun_chr_close+0x49/0x60 [ 31.710507] __fput+0x333/0x7f0 [ 31.713763] ? fput+0x140/0x140 [ 31.717015] ? check_same_owner+0x320/0x320 [ 31.721307] ? _raw_spin_unlock_irq+0x27/0x70 [ 31.725779] ____fput+0x15/0x20 [ 31.729028] task_work_run+0x199/0x270 [ 31.732889] ? task_work_cancel+0x210/0x210 [ 31.737182] ? _raw_spin_unlock+0x22/0x30 [ 31.741301] ? switch_task_namespaces+0x87/0xc0 [ 31.745942] do_exit+0x9d2/0x1af0 [ 31.749365] ? __handle_mm_fault+0xf07/0x39c0 [ 31.753835] ? mm_update_next_owner+0x930/0x930 [ 31.758474] ? lock_release+0xd70/0xd70 [ 31.762418] ? check_noncircular+0x20/0x20 [ 31.766626] ? kfree+0xe4/0x250 [ 31.769877] ? kvfree+0x36/0x60 [ 31.773136] ? check_noncircular+0x20/0x20 [ 31.777344] ? __handle_mm_fault+0x587/0x39c0 [ 31.781814] ? __pmd_alloc+0x4e0/0x4e0 [ 31.785681] ? find_held_lock+0x39/0x1d0 [ 31.789725] ? lock_downgrade+0x990/0x990 [ 31.793865] ? handle_mm_fault+0x410/0x8d0 [ 31.798069] ? down_read_trylock+0xdb/0x170 [ 31.802358] ? __do_page_fault+0x31e/0xd60 [ 31.806563] ? __handle_mm_fault+0x39c0/0x39c0 [ 31.811114] ? vmacache_find+0x5f/0x280 [ 31.815057] ? vmacache_update+0xfe/0x130 [ 31.819181] do_group_exit+0x149/0x400 [ 31.823038] ? __do_page_fault+0x3d6/0xd60 [ 31.827241] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 31.831620] ? SyS_exit+0x30/0x30 [ 31.835051] ? do_fast_syscall_32+0x158/0xf05 [ 31.839516] ? do_group_exit+0x400/0x400 [ 31.843551] SyS_exit_group+0x1d/0x20 [ 31.847321] do_fast_syscall_32+0x3f2/0xf05 [ 31.851621] ? do_int80_syscall_32+0x940/0x940 [ 31.856175] ? kasan_check_read+0x11/0x20 [ 31.860295] ? syscall_return_slowpath+0x510/0x510 [ 31.865195] ? SyS_rt_sigaction+0x94/0x1b0 [ 31.869404] ? lockdep_sys_exit+0x47/0xf0 [ 31.873525] ? retint_user+0x18/0x20 [ 31.877215] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 31.882034] entry_SYSENTER_compat+0x51/0x60 [ 31.886414] RIP: 0023:0xf7f0bc79 [ 31.889747] RSP: 002b:00000000ffae417c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 31.897428] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 31.904670] RDX: 0000000000000000 RSI: 00000000080db578 RDI: 00000000080f22a0 [ 31.911911] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 31.919150] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 31.926389] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 31.933648] [ 31.935245] Allocated by task 2980: [ 31.938841] save_stack_trace+0x16/0x20 [ 31.942785] save_stack+0x43/0xd0 [ 31.946208] kasan_kmalloc+0xad/0xe0 [ 31.949890] __kmalloc_node+0x47/0x70 [ 31.953659] kvmalloc_node+0x64/0xd0 [ 31.957341] alloc_netdev_mqs+0x16e/0xed0 [ 31.961459] __tun_chr_ioctl+0x12be/0x3d20 [ 31.965661] tun_chr_compat_ioctl+0x29/0x30 [ 31.969950] compat_SyS_ioctl+0x1d7/0x3290 [ 31.974153] do_fast_syscall_32+0x3f2/0xf05 [ 31.978442] entry_SYSENTER_compat+0x51/0x60 [ 31.982815] [ 31.984411] Freed by task 2980: [ 31.987659] save_stack_trace+0x16/0x20 [ 31.991602] save_stack+0x43/0xd0 [ 31.995024] kasan_slab_free+0x71/0xc0 [ 31.999141] kfree+0xca/0x250 [ 32.002215] kvfree+0x36/0x60 [ 32.005289] free_netdev+0x2cf/0x360 [ 32.008971] __tun_chr_ioctl+0x2cf6/0x3d20 [ 32.013173] tun_chr_compat_ioctl+0x29/0x30 [ 32.017467] compat_SyS_ioctl+0x1d7/0x3290 [ 32.021677] do_fast_syscall_32+0x3f2/0xf05 [ 32.025969] entry_SYSENTER_compat+0x51/0x60 [ 32.030344] [ 32.031942] The buggy address belongs to the object at ffff8801ceaf8340 [ 32.031942] which belongs to the cache kmalloc-16384 of size 16384 [ 32.044918] The buggy address is located 13312 bytes inside of [ 32.044918] 16384-byte region [ffff8801ceaf8340, ffff8801ceafc340) [ 32.057109] The buggy address belongs to the page: [ 32.062007] page:ffffea00073abe00 count:1 mapcount:0 mapping:ffff8801ceaf8340 index:0x0 compound_mapcount: 0 [ 32.071949] flags: 0x200000000008100(slab|head) [ 32.076588] raw: 0200000000008100 ffff8801ceaf8340 0000000000000000 0000000100000001 [ 32.084436] raw: ffffea0007357420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 32.092281] page dumped because: kasan: bad access detected [ 32.097956] [ 32.099553] Memory state around the buggy address: [ 32.104454] ffff8801ceafb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.111781] ffff8801ceafb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.119107] >ffff8801ceafb700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.126432] ^ [ 32.131847] ffff8801ceafb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.139174] ffff8801ceafb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 32.146499] ================================================================== [ 32.153822] Disabling lock debugging due to kernel taint [ 32.159235] Kernel panic - not syncing: panic_on_warn set ... [ 32.159235] [ 32.166562] CPU: 0 PID: 2980 Comm: syzkaller665313 Tainted: G B 4.14.0-rc3+ #23 [ 32.175098] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 32.184414] Call Trace: [ 32.186969] dump_stack+0x194/0x257 [ 32.190565] ? arch_local_irq_restore+0x53/0x53 [ 32.195206] ? vprintk_default+0x28/0x30 [ 32.199238] ? detach_if_pending+0x500/0x610 [ 32.203614] panic+0x1e4/0x417 [ 32.206770] ? __warn+0x1d9/0x1d9 [ 32.210195] ? detach_if_pending+0x557/0x610 [ 32.214573] kasan_end_report+0x50/0x50 [ 32.218523] kasan_report+0x144/0x340 [ 32.222289] __asan_report_store8_noabort+0x17/0x20 [ 32.227282] detach_if_pending+0x557/0x610 [ 32.231506] ? trace_raw_output_tick_stop+0x130/0x130 [ 32.236671] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 32.241309] ? lock_timer_base+0x1a3/0x2b0 [ 32.245509] ? lock_timer_base+0x1eb/0x2b0 [ 32.249712] ? __internal_add_timer+0x2d0/0x2d0 [ 32.254350] ? trace_hardirqs_on+0xd/0x10 [ 32.258465] try_to_del_timer_sync+0xa2/0x120 [ 32.262941] ? del_timer+0x130/0x130 [ 32.266623] ? del_timer_sync+0xeb/0x240 [ 32.270652] del_timer_sync+0x18a/0x240 [ 32.274592] tun_free_netdev+0x105/0x1b0 [ 32.278616] ? tun_xdp+0x410/0x410 [ 32.282122] ? cpumask_next+0x24/0x30 [ 32.285889] ? netdev_refcnt_read+0xed/0x150 [ 32.290260] ? tun_xdp+0x410/0x410 [ 32.293765] netdev_run_todo+0x870/0xca0 [ 32.297790] ? do_group_exit+0x149/0x400 [ 32.301816] ? register_netdev+0x30/0x30 [ 32.305842] ? lock_downgrade+0x990/0x990 [ 32.309955] ? trace_hardirqs_on+0xd/0x10 [ 32.314164] ? refcount_sub_and_test+0x115/0x1b0 [ 32.318882] ? refcount_inc+0x50/0x50 [ 32.322644] ? refcount_inc+0x50/0x50 [ 32.326411] ? sk_destruct+0x4c/0x80 [ 32.330086] ? __sk_free+0x5c/0x230 [ 32.333676] ? sk_free+0x2f/0x40 [ 32.337004] ? __tun_detach+0x176/0x1390 [ 32.341035] ? tun_attach+0xf90/0xf90 [ 32.344801] ? do_raw_spin_trylock+0x190/0x190 [ 32.349347] ? locks_remove_file+0x3fa/0x5a0 [ 32.353719] ? fcntl_setlk+0x10d0/0x10d0 [ 32.357749] ? __fsnotify_parent+0xb4/0x3a0 [ 32.362036] ? fsnotify+0x1af0/0x1af0 [ 32.365800] ? __tun_detach+0x1390/0x1390 [ 32.369915] ? __tun_detach+0x1390/0x1390 [ 32.374027] rtnl_unlock+0xe/0x10 [ 32.377443] tun_chr_close+0x49/0x60 [ 32.381121] __fput+0x333/0x7f0 [ 32.384366] ? fput+0x140/0x140 [ 32.387609] ? check_same_owner+0x320/0x320 [ 32.391912] ? _raw_spin_unlock_irq+0x27/0x70 [ 32.396387] ____fput+0x15/0x20 [ 32.399669] task_work_run+0x199/0x270 [ 32.403525] ? task_work_cancel+0x210/0x210 [ 32.407814] ? _raw_spin_unlock+0x22/0x30 [ 32.411928] ? switch_task_namespaces+0x87/0xc0 [ 32.416564] do_exit+0x9d2/0x1af0 [ 32.419981] ? __handle_mm_fault+0xf07/0x39c0 [ 32.424442] ? mm_update_next_owner+0x930/0x930 [ 32.429563] ? lock_release+0xd70/0xd70 [ 32.433505] ? check_noncircular+0x20/0x20 [ 32.437709] ? kfree+0xe4/0x250 [ 32.440953] ? kvfree+0x36/0x60 [ 32.444202] ? check_noncircular+0x20/0x20 [ 32.448401] ? __handle_mm_fault+0x587/0x39c0 [ 32.452866] ? __pmd_alloc+0x4e0/0x4e0 [ 32.456723] ? find_held_lock+0x39/0x1d0 [ 32.460753] ? lock_downgrade+0x990/0x990 [ 32.464876] ? handle_mm_fault+0x410/0x8d0 [ 32.469073] ? down_read_trylock+0xdb/0x170 [ 32.473360] ? __do_page_fault+0x31e/0xd60 [ 32.477557] ? __handle_mm_fault+0x39c0/0x39c0 [ 32.482104] ? vmacache_find+0x5f/0x280 [ 32.486040] ? vmacache_update+0xfe/0x130 [ 32.490153] do_group_exit+0x149/0x400 [ 32.494003] ? __do_page_fault+0x3d6/0xd60 [ 32.498202] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 32.502574] ? SyS_exit+0x30/0x30 [ 32.505994] ? do_fast_syscall_32+0x158/0xf05 [ 32.510452] ? do_group_exit+0x400/0x400 [ 32.514478] SyS_exit_group+0x1d/0x20 [ 32.518242] do_fast_syscall_32+0x3f2/0xf05 [ 32.522529] ? do_int80_syscall_32+0x940/0x940 [ 32.527075] ? kasan_check_read+0x11/0x20 [ 32.531185] ? syscall_return_slowpath+0x510/0x510 [ 32.536078] ? SyS_rt_sigaction+0x94/0x1b0 [ 32.540279] ? lockdep_sys_exit+0x47/0xf0 [ 32.544391] ? retint_user+0x18/0x20 [ 32.548070] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 32.552878] entry_SYSENTER_compat+0x51/0x60 [ 32.557249] RIP: 0023:0xf7f0bc79 [ 32.560576] RSP: 002b:00000000ffae417c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 32.568247] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 32.575491] RDX: 0000000000000000 RSI: 00000000080db578 RDI: 00000000080f22a0 [ 32.582723] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 32.589956] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 32.597188] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000