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-3,10.128.0.56' (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: [ 29.384290] ================================================================== [ 29.385359] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 29.386282] Write of size 8 at addr ffff8801d0c23678 by task syzkaller284241/2985 [ 29.387278] [ 29.387511] CPU: 0 PID: 2985 Comm: syzkaller284241 Not tainted 4.14.0-rc5+ #51 [ 29.388473] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.389691] Call Trace: [ 29.390049] dump_stack+0x194/0x257 [ 29.390539] ? arch_local_irq_restore+0x53/0x53 [ 29.391164] ? show_regs_print_info+0x65/0x65 [ 29.391763] ? lock_acquire+0x1d5/0x580 [ 29.392297] ? lock_timer_base+0x1a3/0x2b0 [ 29.392865] ? detach_if_pending+0x557/0x610 [ 29.393469] print_address_description+0x73/0x250 [ 29.394113] ? detach_if_pending+0x557/0x610 [ 29.394717] kasan_report+0x25b/0x340 [ 29.395231] __asan_report_store8_noabort+0x17/0x20 [ 29.395897] detach_if_pending+0x557/0x610 [ 29.396464] ? trace_raw_output_tick_stop+0x130/0x130 [ 29.397183] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 29.397802] ? lock_timer_base+0x1a3/0x2b0 [ 29.398370] ? lock_timer_base+0x1eb/0x2b0 [ 29.398943] ? __internal_add_timer+0x2d0/0x2d0 [ 29.399563] ? lock_downgrade+0x990/0x990 [ 29.400115] ? trace_hardirqs_on+0xd/0x10 [ 29.400679] try_to_del_timer_sync+0xa2/0x120 [ 29.401295] ? del_timer+0x130/0x130 [ 29.401813] ? del_timer_sync+0xeb/0x240 [ 29.402382] del_timer_sync+0x18a/0x240 [ 29.402921] tun_free_netdev+0x105/0x1b0 [ 29.403467] ? tun_xdp+0x410/0x410 [ 29.403945] ? cpumask_next+0x24/0x30 [ 29.404455] ? netdev_refcnt_read+0xed/0x150 [ 29.408830] ? tun_xdp+0x410/0x410 [ 29.412347] netdev_run_todo+0x870/0xca0 [ 29.416380] ? do_group_exit+0x149/0x400 [ 29.420408] ? mark_held_locks+0xaf/0x100 [ 29.424521] ? register_netdev+0x30/0x30 [ 29.428552] ? find_held_lock+0x35/0x1d0 [ 29.432587] ? lock_downgrade+0x990/0x990 [ 29.436792] ? refcount_sub_and_test+0x115/0x1b0 [ 29.441512] ? refcount_inc+0x50/0x50 [ 29.445279] ? refcount_inc+0x50/0x50 [ 29.449050] ? sk_destruct+0x4c/0x80 [ 29.452728] ? __sk_free+0x5c/0x230 [ 29.456328] ? sk_free+0x2f/0x40 [ 29.459658] ? __tun_detach+0x176/0x1390 [ 29.463693] ? tun_attach+0xfa0/0xfa0 [ 29.467461] ? lock_downgrade+0x990/0x990 [ 29.471576] ? locks_remove_file+0x3fa/0x5a0 [ 29.475953] ? fcntl_setlk+0x10c0/0x10c0 [ 29.479982] ? __fsnotify_parent+0xb4/0x3a0 [ 29.484270] ? fsnotify+0x1af0/0x1af0 [ 29.488038] ? __tun_detach+0x1390/0x1390 [ 29.492154] ? __tun_detach+0x1390/0x1390 [ 29.496270] rtnl_unlock+0xe/0x10 [ 29.499688] tun_chr_close+0x49/0x60 [ 29.503367] __fput+0x327/0x7e0 [ 29.506617] ? fput+0x140/0x140 [ 29.509863] ? check_same_owner+0x320/0x320 [ 29.514147] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.518611] ____fput+0x15/0x20 [ 29.521855] task_work_run+0x199/0x270 [ 29.525709] ? task_work_cancel+0x210/0x210 [ 29.529995] ? _raw_spin_unlock+0x22/0x30 [ 29.534110] ? switch_task_namespaces+0x87/0xc0 [ 29.538748] do_exit+0x9b5/0x1ad0 [ 29.542165] ? __handle_mm_fault+0xf07/0x39c0 [ 29.546627] ? mm_update_next_owner+0x930/0x930 [ 29.551260] ? lock_release+0xa40/0xa40 [ 29.555197] ? do_raw_spin_trylock+0x190/0x190 [ 29.559747] ? kfree+0xe4/0x250 [ 29.562994] ? kvfree+0x36/0x60 [ 29.566256] ? __handle_mm_fault+0x587/0x39c0 [ 29.570721] ? check_noncircular+0x20/0x20 [ 29.574934] ? __pmd_alloc+0x4e0/0x4e0 [ 29.578792] ? find_held_lock+0x35/0x1d0 [ 29.582824] ? handle_mm_fault+0x248/0x8d0 [ 29.587026] ? find_held_lock+0x35/0x1d0 [ 29.591062] ? __do_page_fault+0x64c/0xd60 [ 29.595261] ? lock_downgrade+0x990/0x990 [ 29.599382] ? handle_mm_fault+0x410/0x8d0 [ 29.603578] ? down_read_trylock+0xdb/0x170 [ 29.607862] ? __do_page_fault+0x31e/0xd60 [ 29.612062] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.616611] ? vmacache_find+0x5f/0x280 [ 29.620559] do_group_exit+0x149/0x400 [ 29.624412] ? __do_page_fault+0x3d6/0xd60 [ 29.628610] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 29.632983] ? SyS_exit+0x30/0x30 [ 29.636405] ? do_fast_syscall_32+0x158/0xf05 [ 29.640864] ? do_group_exit+0x400/0x400 [ 29.644889] SyS_exit_group+0x1d/0x20 [ 29.648655] do_fast_syscall_32+0x3f2/0xf05 [ 29.652947] ? do_int80_syscall_32+0x940/0x940 [ 29.657494] ? kasan_check_read+0x11/0x20 [ 29.661610] ? syscall_return_slowpath+0x510/0x510 [ 29.666505] ? SyS_rt_sigaction+0x94/0x1b0 [ 29.670706] ? SyS_sigprocmask+0x4b0/0x4b0 [ 29.674905] ? SyS_read+0x184/0x220 [ 29.678500] ? retint_user+0x18/0x20 [ 29.682182] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 29.686997] entry_SYSENTER_compat+0x51/0x60 [ 29.691367] RIP: 0023:0xf7fc2c79 [ 29.694695] RSP: 002b:00000000ffbacf1c EFLAGS: 00000292 ORIG_RAX: 00000000000000fc [ 29.702365] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000080f2298 [ 29.709599] RDX: 0000000000000000 RSI: 00000000080db578 RDI: 00000000080f22a0 [ 29.716835] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 29.724069] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 29.731302] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 29.738553] [ 29.740144] Allocated by task 2985: [ 29.743736] save_stack_trace+0x16/0x20 [ 29.747674] save_stack+0x43/0xd0 [ 29.751092] kasan_kmalloc+0xad/0xe0 [ 29.754769] __kmalloc_node+0x47/0x70 [ 29.758534] kvmalloc_node+0x64/0xd0 [ 29.762211] alloc_netdev_mqs+0x16e/0xed0 [ 29.766322] __tun_chr_ioctl+0x12b2/0x3d20 [ 29.770518] tun_chr_compat_ioctl+0x29/0x30 [ 29.774805] compat_SyS_ioctl+0x1d7/0x3290 [ 29.779005] do_fast_syscall_32+0x3f2/0xf05 [ 29.783290] entry_SYSENTER_compat+0x51/0x60 [ 29.787659] [ 29.789253] Freed by task 2985: [ 29.792494] save_stack_trace+0x16/0x20 [ 29.796430] save_stack+0x43/0xd0 [ 29.799845] kasan_slab_free+0x71/0xc0 [ 29.803695] kfree+0xca/0x250 [ 29.806762] kvfree+0x36/0x60 [ 29.809830] free_netdev+0x2cf/0x360 [ 29.813505] __tun_chr_ioctl+0x2cea/0x3d20 [ 29.817701] tun_chr_compat_ioctl+0x29/0x30 [ 29.821985] compat_SyS_ioctl+0x1d7/0x3290 [ 29.826185] do_fast_syscall_32+0x3f2/0xf05 [ 29.830472] entry_SYSENTER_compat+0x51/0x60 [ 29.834840] [ 29.836434] The buggy address belongs to the object at ffff8801d0c20340 [ 29.836434] which belongs to the cache kmalloc-16384 of size 16384 [ 29.849402] The buggy address is located 13112 bytes inside of [ 29.849402] 16384-byte region [ffff8801d0c20340, ffff8801d0c24340) [ 29.861585] The buggy address belongs to the page: [ 29.866478] page:ffffea0007430800 count:1 mapcount:0 mapping:ffff8801d0c20340 index:0x0 compound_mapcount: 0 [ 29.876412] flags: 0x200000000008100(slab|head) [ 29.881047] raw: 0200000000008100 ffff8801d0c20340 0000000000000000 0000000100000001 [ 29.888894] raw: ffffea000748aa20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 29.896734] page dumped because: kasan: bad access detected [ 29.902404] [ 29.903995] Memory state around the buggy address: [ 29.908887] ffff8801d0c23500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.916214] ffff8801d0c23580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.923539] >ffff8801d0c23600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.930861] ^ [ 29.938097] ffff8801d0c23680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.945416] ffff8801d0c23700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 29.952735] ================================================================== [ 29.960054] Disabling lock debugging due to kernel taint [ 29.965465] Kernel panic - not syncing: panic_on_warn set ... [ 29.965465] [ 29.972787] CPU: 0 PID: 2985 Comm: syzkaller284241 Tainted: G B 4.14.0-rc5+ #51 [ 29.981321] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 29.990635] Call Trace: [ 29.993191] dump_stack+0x194/0x257 [ 29.996782] ? arch_local_irq_restore+0x53/0x53 [ 30.001414] ? kasan_end_report+0x32/0x50 [ 30.005527] ? lock_downgrade+0x990/0x990 [ 30.009639] ? detach_if_pending+0x540/0x610 [ 30.014012] panic+0x1e4/0x417 [ 30.017169] ? __warn+0x1d9/0x1d9 [ 30.020592] ? detach_if_pending+0x557/0x610 [ 30.024964] kasan_end_report+0x50/0x50 [ 30.028903] kasan_report+0x144/0x340 [ 30.032670] __asan_report_store8_noabort+0x17/0x20 [ 30.037647] detach_if_pending+0x557/0x610 [ 30.041848] ? trace_raw_output_tick_stop+0x130/0x130 [ 30.047002] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 30.051631] ? lock_timer_base+0x1a3/0x2b0 [ 30.055828] ? lock_timer_base+0x1eb/0x2b0 [ 30.060029] ? __internal_add_timer+0x2d0/0x2d0 [ 30.064660] ? lock_downgrade+0x990/0x990 [ 30.068768] ? trace_hardirqs_on+0xd/0x10 [ 30.072884] try_to_del_timer_sync+0xa2/0x120 [ 30.077343] ? del_timer+0x130/0x130 [ 30.081019] ? del_timer_sync+0xeb/0x240 [ 30.085043] del_timer_sync+0x18a/0x240 [ 30.088981] tun_free_netdev+0x105/0x1b0 [ 30.093004] ? tun_xdp+0x410/0x410 [ 30.096508] ? cpumask_next+0x24/0x30 [ 30.100273] ? netdev_refcnt_read+0xed/0x150 [ 30.104648] ? tun_xdp+0x410/0x410 [ 30.108154] netdev_run_todo+0x870/0xca0 [ 30.112177] ? do_group_exit+0x149/0x400 [ 30.116200] ? mark_held_locks+0xaf/0x100 [ 30.120310] ? register_netdev+0x30/0x30 [ 30.124341] ? find_held_lock+0x35/0x1d0 [ 30.128368] ? lock_downgrade+0x990/0x990 [ 30.132481] ? refcount_sub_and_test+0x115/0x1b0 [ 30.137201] ? refcount_inc+0x50/0x50 [ 30.140967] ? refcount_inc+0x50/0x50 [ 30.144733] ? sk_destruct+0x4c/0x80 [ 30.148409] ? __sk_free+0x5c/0x230 [ 30.152007] ? sk_free+0x2f/0x40 [ 30.155337] ? __tun_detach+0x176/0x1390 [ 30.159368] ? tun_attach+0xfa0/0xfa0 [ 30.163133] ? lock_downgrade+0x990/0x990 [ 30.167245] ? locks_remove_file+0x3fa/0x5a0 [ 30.171620] ? fcntl_setlk+0x10c0/0x10c0 [ 30.175644] ? __fsnotify_parent+0xb4/0x3a0 [ 30.179928] ? fsnotify+0x1af0/0x1af0 [ 30.183694] ? __tun_detach+0x1390/0x1390 [ 30.187804] ? __tun_detach+0x1390/0x1390 [ 30.191917] rtnl_unlock+0xe/0x10 [ 30.195332] tun_chr_close+0x49/0x60 [ 30.199009] __fput+0x327/0x7e0 [ 30.202253] ? fput+0x140/0x140 [ 30.205496] ? check_same_owner+0x320/0x320 [ 30.210231] ? _raw_spin_unlock_irq+0x27/0x70 [ 30.214693] ____fput+0x15/0x20 [ 30.217940] task_work_run+0x199/0x270 [ 30.221793] ? task_work_cancel+0x210/0x210 [ 30.226077] ? _raw_spin_unlock+0x22/0x30 [ 30.230187] ? switch_task_namespaces+0x87/0xc0 [ 30.234820] do_exit+0x9b5/0x1ad0 [ 30.238235] ? __handle_mm_fault+0xf07/0x39c0 [ 30.242693] ? mm_update_next_owner+0x930/0x930 [ 30.247324] ? lock_release+0xa40/0xa40 [ 30.251262] ? do_raw_spin_trylock+0x190/0x190 [ 30.255808] ? kfree+0xe4/0x250 [ 30.259051] ? kvfree+0x36/0x60 [ 30.262299] ? __handle_mm_fault+0x587/0x39c0 [ 30.266758] ? check_noncircular+0x20/0x20 [ 30.270954] ? __pmd_alloc+0x4e0/0x4e0 [ 30.274809] ? find_held_lock+0x35/0x1d0 [ 30.278835] ? handle_mm_fault+0x248/0x8d0 [ 30.283035] ? find_held_lock+0x35/0x1d0 [ 30.287062] ? __do_page_fault+0x64c/0xd60 [ 30.291258] ? lock_downgrade+0x990/0x990 [ 30.295373] ? handle_mm_fault+0x410/0x8d0 [ 30.299568] ? down_read_trylock+0xdb/0x170 [ 30.303851] ? __do_page_fault+0x31e/0xd60 [ 30.308050] ? __handle_mm_fault+0x39c0/0x39c0 [ 30.312597] ? vmacache_find+0x5f/0x280 [ 30.316539] do_group_exit+0x149/0x400 [ 30.320394] ? __do_page_fault+0x3d6/0xd60 [ 30.324590] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 30.328960] ? SyS_exit+0x30/0x30 [ 30.332379] ? do_fast_syscall_32+0x158/0xf05 [ 30.336837] ? do_group_exit+0x400/0x400 [ 30.340862] SyS_exit_group+0x1d/0x20 [ 30.344626] do_fast_syscall_32+0x3f2/0xf05 [ 30.348915] ? do_int80_syscall_32+0x940/0x940 [ 30.353460] ? kasan_check_read+0x11/0x20 [ 30.357572] ? syscall_return_slowpath+0x510/0x510 [ 30.362464] ? SyS_rt_sigaction+0x94/0x1b0 [ 30.366662] ? SyS_sigprocmask+0x4b0/0x4b0 [ 30.370860] ? SyS_read+0x184/0x220 [ 30.374449] ? retint_user+0x18/0x20 [ 30.378129] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 30.382940] entry_SYSENTER_compat+0x51/0x60