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.21' (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: [ 52.147284] ================================================================== [ 52.154769] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 52.161498] Write of size 8 at addr ffff8801ce05b780 by task syzkaller043284/2983 [ 52.169090] [ 52.170694] CPU: 1 PID: 2983 Comm: syzkaller043284 Not tainted 4.14.0-rc4+ #128 [ 52.178112] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.187446] Call Trace: [ 52.190014] dump_stack+0x194/0x257 [ 52.193619] ? arch_local_irq_restore+0x53/0x53 [ 52.198262] ? show_regs_print_info+0x65/0x65 [ 52.202735] ? lock_timer_base+0x1a3/0x2b0 [ 52.206945] ? detach_if_pending+0x557/0x610 [ 52.211330] print_address_description+0x73/0x250 [ 52.216144] ? detach_if_pending+0x557/0x610 [ 52.220526] kasan_report+0x25b/0x340 [ 52.224305] __asan_report_store8_noabort+0x17/0x20 [ 52.229296] detach_if_pending+0x557/0x610 [ 52.233510] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.238674] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.243316] ? lock_timer_base+0x1a3/0x2b0 [ 52.247524] ? lock_timer_base+0x1eb/0x2b0 [ 52.251736] ? __internal_add_timer+0x2d0/0x2d0 [ 52.256380] ? trace_hardirqs_on+0xd/0x10 [ 52.260509] try_to_del_timer_sync+0xa2/0x120 [ 52.264975] ? del_timer+0x130/0x130 [ 52.268664] ? del_timer_sync+0xeb/0x240 [ 52.272702] del_timer_sync+0x18a/0x240 [ 52.276653] tun_free_netdev+0x105/0x1b0 [ 52.280686] ? tun_xdp+0x410/0x410 [ 52.284197] ? cpumask_next+0x24/0x30 [ 52.287972] ? netdev_refcnt_read+0xed/0x150 [ 52.292361] ? tun_xdp+0x410/0x410 [ 52.295874] netdev_run_todo+0x870/0xca0 [ 52.299907] ? do_group_exit+0x149/0x400 [ 52.303944] ? register_netdev+0x30/0x30 [ 52.307980] ? lock_downgrade+0x990/0x990 [ 52.312099] ? trace_hardirqs_on+0xd/0x10 [ 52.316237] ? refcount_sub_and_test+0x115/0x1b0 [ 52.320966] ? refcount_inc+0x50/0x50 [ 52.324739] ? refcount_inc+0x50/0x50 [ 52.328517] ? sk_destruct+0x4c/0x80 [ 52.332203] ? __sk_free+0x5c/0x230 [ 52.335805] ? sk_free+0x2f/0x40 [ 52.339144] ? __tun_detach+0x176/0x1390 [ 52.343191] ? tun_attach+0xf90/0xf90 [ 52.346970] ? do_raw_spin_trylock+0x190/0x190 [ 52.351529] ? locks_remove_file+0x3fa/0x5a0 [ 52.355914] ? fcntl_setlk+0x10d0/0x10d0 [ 52.359950] ? __fsnotify_parent+0xb4/0x3a0 [ 52.364246] ? fsnotify+0x1af0/0x1af0 [ 52.368026] ? __tun_detach+0x1390/0x1390 [ 52.372150] rtnl_unlock+0xe/0x10 [ 52.375573] tun_chr_close+0x49/0x60 [ 52.379261] __fput+0x333/0x7f0 [ 52.382520] ? fput+0x140/0x140 [ 52.385776] ? check_same_owner+0x320/0x320 [ 52.390069] ? _raw_spin_unlock_irq+0x27/0x70 [ 52.394542] ____fput+0x15/0x20 [ 52.397793] task_work_run+0x199/0x270 [ 52.401657] ? task_work_cancel+0x210/0x210 [ 52.405955] ? _raw_spin_unlock+0x22/0x30 [ 52.410076] ? switch_task_namespaces+0x87/0xc0 [ 52.414721] do_exit+0x9d2/0x1af0 [ 52.418154] ? mm_update_next_owner+0x930/0x930 [ 52.422797] ? find_held_lock+0x39/0x1d0 [ 52.426843] ? lock_downgrade+0x990/0x990 [ 52.430987] ? handle_mm_fault+0x410/0x8d0 [ 52.435194] ? __do_page_fault+0x31e/0xd60 [ 52.439403] ? __handle_mm_fault+0x39c0/0x39c0 [ 52.443958] ? vmacache_find+0x5f/0x280 [ 52.447911] ? up_read+0x1a/0x40 [ 52.451251] ? __do_page_fault+0x3d6/0xd60 [ 52.455467] ? mm_fault_error+0x2c0/0x2c0 [ 52.459588] ? do_vfs_ioctl+0x492/0x1530 [ 52.463629] ? do_page_fault+0xee/0x720 [ 52.467578] ? __do_page_fault+0xd60/0xd60 [ 52.471786] ? putname+0xf3/0x130 [ 52.475224] do_group_exit+0x149/0x400 [ 52.479086] ? lockdep_sys_exit+0x47/0xf0 [ 52.483206] ? SyS_exit+0x30/0x30 [ 52.486636] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.491633] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.496371] SyS_exit_group+0x1d/0x20 [ 52.500149] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.504876] RIP: 0033:0x443658 [ 52.508038] RSP: 002b:00007ffcb98ffb58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 52.515722] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443658 [ 52.522964] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 52.530206] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 52.537450] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 52.544691] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 52.551950] [ 52.553550] Allocated by task 2983: [ 52.557151] save_stack_trace+0x16/0x20 [ 52.561096] save_stack+0x43/0xd0 [ 52.564521] kasan_kmalloc+0xad/0xe0 [ 52.568204] __kmalloc_node+0x47/0x70 [ 52.571975] kvmalloc_node+0x64/0xd0 [ 52.575670] alloc_netdev_mqs+0x16e/0xed0 [ 52.579804] __tun_chr_ioctl+0x12be/0x3d20 [ 52.584017] tun_chr_ioctl+0x2a/0x40 [ 52.587706] do_vfs_ioctl+0x1b1/0x1530 [ 52.591563] SyS_ioctl+0x8f/0xc0 [ 52.594901] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.599623] [ 52.601221] Freed by task 2983: [ 52.604471] save_stack_trace+0x16/0x20 [ 52.608417] save_stack+0x43/0xd0 [ 52.611840] kasan_slab_free+0x71/0xc0 [ 52.615697] kfree+0xca/0x250 [ 52.618773] kvfree+0x36/0x60 [ 52.621850] free_netdev+0x2cf/0x360 [ 52.625535] __tun_chr_ioctl+0x2cf6/0x3d20 [ 52.629739] tun_chr_ioctl+0x2a/0x40 [ 52.633422] do_vfs_ioctl+0x1b1/0x1530 [ 52.637293] SyS_ioctl+0x8f/0xc0 [ 52.640633] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.645358] [ 52.646960] The buggy address belongs to the object at ffff8801ce058380 [ 52.646960] which belongs to the cache kmalloc-16384 of size 16384 [ 52.659934] The buggy address is located 13312 bytes inside of [ 52.659934] 16384-byte region [ffff8801ce058380, ffff8801ce05c380) [ 52.672122] The buggy address belongs to the page: [ 52.677022] page:ffffea0007381600 count:1 mapcount:0 mapping:ffff8801ce058380 index:0x0 compound_mapcount: 0 [ 52.686972] flags: 0x200000000008100(slab|head) [ 52.691613] raw: 0200000000008100 ffff8801ce058380 0000000000000000 0000000100000001 [ 52.699466] raw: ffffea000735f420 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 52.707314] page dumped because: kasan: bad access detected [ 52.712990] [ 52.714586] Memory state around the buggy address: [ 52.719484] ffff8801ce05b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.726812] ffff8801ce05b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.734142] >ffff8801ce05b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.741469] ^ [ 52.744804] ffff8801ce05b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.752135] ffff8801ce05b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 52.759469] ================================================================== [ 52.766796] Disabling lock debugging due to kernel taint [ 52.772210] Kernel panic - not syncing: panic_on_warn set ... [ 52.772210] [ 52.779538] CPU: 1 PID: 2983 Comm: syzkaller043284 Tainted: G B 4.14.0-rc4+ #128 [ 52.788161] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.797485] Call Trace: [ 52.800044] dump_stack+0x194/0x257 [ 52.804643] ? arch_local_irq_restore+0x53/0x53 [ 52.809282] ? vprintk_default+0x28/0x30 [ 52.813314] ? detach_if_pending+0x540/0x610 [ 52.817689] panic+0x1e4/0x417 [ 52.820847] ? __warn+0x1d9/0x1d9 [ 52.824272] ? detach_if_pending+0x557/0x610 [ 52.828647] kasan_end_report+0x50/0x50 [ 52.832585] kasan_report+0x144/0x340 [ 52.836354] __asan_report_store8_noabort+0x17/0x20 [ 52.841335] detach_if_pending+0x557/0x610 [ 52.845554] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.850711] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.855346] ? lock_timer_base+0x1a3/0x2b0 [ 52.859545] ? lock_timer_base+0x1eb/0x2b0 [ 52.863745] ? __internal_add_timer+0x2d0/0x2d0 [ 52.868384] ? trace_hardirqs_on+0xd/0x10 [ 52.872500] try_to_del_timer_sync+0xa2/0x120 [ 52.876961] ? del_timer+0x130/0x130 [ 52.880642] ? del_timer_sync+0xeb/0x240 [ 52.884671] del_timer_sync+0x18a/0x240 [ 52.888613] tun_free_netdev+0x105/0x1b0 [ 52.892641] ? tun_xdp+0x410/0x410 [ 52.896146] ? cpumask_next+0x24/0x30 [ 52.899913] ? netdev_refcnt_read+0xed/0x150 [ 52.904289] ? tun_xdp+0x410/0x410 [ 52.907793] netdev_run_todo+0x870/0xca0 [ 52.911817] ? do_group_exit+0x149/0x400 [ 52.915844] ? register_netdev+0x30/0x30 [ 52.919873] ? lock_downgrade+0x990/0x990 [ 52.923986] ? trace_hardirqs_on+0xd/0x10 [ 52.928109] ? refcount_sub_and_test+0x115/0x1b0 [ 52.932830] ? refcount_inc+0x50/0x50 [ 52.936593] ? refcount_inc+0x50/0x50 [ 52.940363] ? sk_destruct+0x4c/0x80 [ 52.944041] ? __sk_free+0x5c/0x230 [ 52.947634] ? sk_free+0x2f/0x40 [ 52.950964] ? __tun_detach+0x176/0x1390 [ 52.955002] ? tun_attach+0xf90/0xf90 [ 52.958774] ? do_raw_spin_trylock+0x190/0x190 [ 52.963325] ? locks_remove_file+0x3fa/0x5a0 [ 52.967699] ? fcntl_setlk+0x10d0/0x10d0 [ 52.971725] ? __fsnotify_parent+0xb4/0x3a0 [ 52.976012] ? fsnotify+0x1af0/0x1af0 [ 52.979780] ? __tun_detach+0x1390/0x1390 [ 52.983894] rtnl_unlock+0xe/0x10 [ 52.987312] tun_chr_close+0x49/0x60 [ 52.990994] __fput+0x333/0x7f0 [ 52.994240] ? fput+0x140/0x140 [ 52.997488] ? check_same_owner+0x320/0x320 [ 53.001772] ? _raw_spin_unlock_irq+0x27/0x70 [ 53.006235] ____fput+0x15/0x20 [ 53.009481] task_work_run+0x199/0x270 [ 53.013337] ? task_work_cancel+0x210/0x210 [ 53.017621] ? _raw_spin_unlock+0x22/0x30 [ 53.021735] ? switch_task_namespaces+0x87/0xc0 [ 53.026369] do_exit+0x9d2/0x1af0 [ 53.029792] ? mm_update_next_owner+0x930/0x930 [ 53.034425] ? find_held_lock+0x39/0x1d0 [ 53.038456] ? lock_downgrade+0x990/0x990 [ 53.042579] ? handle_mm_fault+0x410/0x8d0 [ 53.046780] ? __do_page_fault+0x31e/0xd60 [ 53.050980] ? __handle_mm_fault+0x39c0/0x39c0 [ 53.055529] ? vmacache_find+0x5f/0x280 [ 53.059472] ? up_read+0x1a/0x40 [ 53.062802] ? __do_page_fault+0x3d6/0xd60 [ 53.067007] ? mm_fault_error+0x2c0/0x2c0 [ 53.071119] ? do_vfs_ioctl+0x492/0x1530 [ 53.075149] ? do_page_fault+0xee/0x720 [ 53.079088] ? __do_page_fault+0xd60/0xd60 [ 53.083287] ? putname+0xf3/0x130 [ 53.086708] do_group_exit+0x149/0x400 [ 53.090560] ? lockdep_sys_exit+0x47/0xf0 [ 53.094673] ? SyS_exit+0x30/0x30 [ 53.098092] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 53.103074] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 53.107796] SyS_exit_group+0x1d/0x20 [ 53.111565] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 53.116285] RIP: 0033:0x443658 [ 53.119444] RSP: 002b:00007ffcb98ffb58 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 53.127116] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443658 [ 53.134351] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 53.141587] RBP: 0000000000000086 R08: 00000000000000e7 R09: ffffffffffffffd0