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-4,10.128.15.231' (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: [ 41.974264] ================================================================== [ 41.975493] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 41.976388] Write of size 8 at addr ffff8801c174b6b8 by task syzkaller656140/2978 [ 41.977429] [ 41.977679] CPU: 1 PID: 2978 Comm: syzkaller656140 Not tainted 4.14.0-rc5+ #47 [ 41.978676] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 41.980079] Call Trace: [ 41.980443] dump_stack+0x194/0x257 [ 41.980961] ? arch_local_irq_restore+0x53/0x53 [ 41.981588] ? show_regs_print_info+0x65/0x65 [ 41.982189] ? lock_acquire+0x1d5/0x580 [ 41.982724] ? lock_timer_base+0x1a3/0x2b0 [ 41.983293] ? detach_if_pending+0x557/0x610 [ 41.983886] print_address_description+0x73/0x250 [ 41.984543] ? detach_if_pending+0x557/0x610 [ 41.985186] kasan_report+0x25b/0x340 [ 41.985722] __asan_report_store8_noabort+0x17/0x20 [ 41.986388] detach_if_pending+0x557/0x610 [ 41.986978] ? trace_raw_output_tick_stop+0x130/0x130 [ 41.987671] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 41.988290] ? lock_timer_base+0x1a3/0x2b0 [ 41.988875] ? lock_timer_base+0x1eb/0x2b0 [ 41.989446] ? __internal_add_timer+0x2d0/0x2d0 [ 41.990070] ? lock_downgrade+0x990/0x990 [ 41.990625] ? trace_hardirqs_on+0xd/0x10 [ 41.991189] try_to_del_timer_sync+0xa2/0x120 [ 41.991790] ? del_timer+0x130/0x130 [ 41.992293] ? del_timer_sync+0xeb/0x240 [ 41.992844] del_timer_sync+0x18a/0x240 [ 41.993393] tun_free_netdev+0x105/0x1b0 [ 41.993938] ? tun_xdp+0x410/0x410 [ 41.994415] ? cpumask_next+0x24/0x30 [ 41.998065] ? netdev_refcnt_read+0xed/0x150 [ 42.002443] ? tun_xdp+0x410/0x410 [ 42.005953] netdev_run_todo+0x870/0xca0 [ 42.009981] ? do_group_exit+0x149/0x400 [ 42.014013] ? mark_held_locks+0xaf/0x100 [ 42.018126] ? register_netdev+0x30/0x30 [ 42.022156] ? find_held_lock+0x35/0x1d0 [ 42.026195] ? lock_downgrade+0x990/0x990 [ 42.030316] ? refcount_sub_and_test+0x115/0x1b0 [ 42.035038] ? refcount_inc+0x50/0x50 [ 42.038807] ? refcount_inc+0x50/0x50 [ 42.042587] ? sk_destruct+0x4c/0x80 [ 42.046268] ? __sk_free+0x5c/0x230 [ 42.049862] ? sk_free+0x2f/0x40 [ 42.053197] ? __tun_detach+0x176/0x1390 [ 42.057236] ? tun_attach+0xfa0/0xfa0 [ 42.061005] ? check_noncircular+0x20/0x20 [ 42.065214] ? locks_remove_file+0x3fa/0x5a0 [ 42.069591] ? fcntl_setlk+0x10c0/0x10c0 [ 42.073619] ? kmem_cache_free+0x77/0x280 [ 42.077737] ? __fsnotify_parent+0xb4/0x3a0 [ 42.082029] ? fsnotify+0x1af0/0x1af0 [ 42.085802] ? __tun_detach+0x1390/0x1390 [ 42.089920] ? __tun_detach+0x1390/0x1390 [ 42.094037] rtnl_unlock+0xe/0x10 [ 42.097460] tun_chr_close+0x49/0x60 [ 42.101141] __fput+0x327/0x7e0 [ 42.104393] ? fput+0x140/0x140 [ 42.107645] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.112116] ____fput+0x15/0x20 [ 42.115364] task_work_run+0x199/0x270 [ 42.119223] ? task_work_cancel+0x210/0x210 [ 42.123514] ? _raw_spin_unlock+0x22/0x30 [ 42.127630] ? switch_task_namespaces+0x87/0xc0 [ 42.132270] do_exit+0x9b5/0x1ad0 [ 42.135693] ? __handle_mm_fault+0xf07/0x39c0 [ 42.140158] ? mm_update_next_owner+0x930/0x930 [ 42.144793] ? lock_release+0xa40/0xa40 [ 42.148733] ? do_raw_spin_trylock+0x190/0x190 [ 42.153286] ? preempt_notifier_dec+0x20/0x20 [ 42.157760] ? __handle_mm_fault+0x587/0x39c0 [ 42.162226] ? check_noncircular+0x20/0x20 [ 42.166425] ? __pmd_alloc+0x4e0/0x4e0 [ 42.170279] ? to_ratio+0x30/0x30 [ 42.173703] ? find_held_lock+0x35/0x1d0 [ 42.177739] ? handle_mm_fault+0x248/0x8d0 [ 42.181944] ? find_held_lock+0x35/0x1d0 [ 42.185991] ? __do_page_fault+0x64c/0xd60 [ 42.190196] ? lock_downgrade+0x990/0x990 [ 42.194317] ? handle_mm_fault+0x410/0x8d0 [ 42.198518] ? down_read_trylock+0xdb/0x170 [ 42.202804] ? __do_page_fault+0x31e/0xd60 [ 42.207007] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.211555] ? vmacache_find+0x5f/0x280 [ 42.215498] ? vmacache_update+0xfe/0x130 [ 42.219621] do_group_exit+0x149/0x400 [ 42.223476] ? __do_page_fault+0x3d6/0xd60 [ 42.227679] ? exit_to_usermode_loop+0x198/0x310 [ 42.232401] ? SyS_exit+0x30/0x30 [ 42.235824] ? do_fast_syscall_32+0x158/0xf05 [ 42.240286] ? do_group_exit+0x400/0x400 [ 42.244314] SyS_exit_group+0x1d/0x20 [ 42.248082] do_fast_syscall_32+0x3f2/0xf05 [ 42.252384] ? do_int80_syscall_32+0x940/0x940 [ 42.256933] ? kasan_check_read+0x11/0x20 [ 42.261050] ? do_syscall_64+0x8d0/0x8d0 [ 42.265080] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.269282] ? SyS_sigprocmask+0x4b0/0x4b0 [ 42.273486] ? SyS_read+0x184/0x220 [ 42.277082] ? retint_user+0x18/0x20 [ 42.280769] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 42.285585] entry_SYSENTER_compat+0x51/0x60 [ 42.289959] RIP: 0023:0xf7f13c79 [ 42.293289] RSP: 002b:00000000ffb870fc EFLAGS: 00000296 ORIG_RAX: 00000000000000fc [ 42.300961] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000008210318 [ 42.308198] RDX: 0000000000000000 RSI: 00000000080dc1d8 RDI: 0000000008210320 [ 42.315435] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 [ 42.322671] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 42.329907] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 42.337160] [ 42.338756] Allocated by task 3002: [ 42.342354] save_stack_trace+0x16/0x20 [ 42.346295] save_stack+0x43/0xd0 [ 42.349715] kasan_kmalloc+0xad/0xe0 [ 42.353392] __kmalloc_node+0x47/0x70 [ 42.357159] kvmalloc_node+0x64/0xd0 [ 42.360839] alloc_netdev_mqs+0x16e/0xed0 [ 42.364954] __tun_chr_ioctl+0x12b2/0x3d20 [ 42.369153] tun_chr_compat_ioctl+0x29/0x30 [ 42.373442] compat_SyS_ioctl+0x1d7/0x3290 [ 42.377643] do_fast_syscall_32+0x3f2/0xf05 [ 42.381933] entry_SYSENTER_compat+0x51/0x60 [ 42.386303] [ 42.387897] Freed by task 3002: [ 42.391142] save_stack_trace+0x16/0x20 [ 42.395084] save_stack+0x43/0xd0 [ 42.398501] kasan_slab_free+0x71/0xc0 [ 42.402354] kfree+0xca/0x250 [ 42.405427] kvfree+0x36/0x60 [ 42.408501] free_netdev+0x2cf/0x360 [ 42.412182] __tun_chr_ioctl+0x2cea/0x3d20 [ 42.416385] tun_chr_compat_ioctl+0x29/0x30 [ 42.420676] compat_SyS_ioctl+0x1d7/0x3290 [ 42.424878] do_fast_syscall_32+0x3f2/0xf05 [ 42.429167] entry_SYSENTER_compat+0x51/0x60 [ 42.433541] [ 42.435142] The buggy address belongs to the object at ffff8801c1748380 [ 42.435142] which belongs to the cache kmalloc-16384 of size 16384 [ 42.448116] The buggy address is located 13112 bytes inside of [ 42.448116] 16384-byte region [ffff8801c1748380, ffff8801c174c380) [ 42.460304] The buggy address belongs to the page: [ 42.465205] page:ffffea000705d200 count:1 mapcount:0 mapping:ffff8801c1748380 index:0x0 compound_mapcount: 0 [ 42.475142] flags: 0x200000000008100(slab|head) [ 42.479788] raw: 0200000000008100 ffff8801c1748380 0000000000000000 0000000100000001 [ 42.487637] raw: ffffea00074ac220 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 42.495483] page dumped because: kasan: bad access detected [ 42.501156] [ 42.502751] Memory state around the buggy address: [ 42.507653] ffff8801c174b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.514976] ffff8801c174b600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.522299] >ffff8801c174b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.529623] ^ [ 42.534776] ffff8801c174b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.542100] ffff8801c174b780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 42.549426] ================================================================== [ 42.556747] Disabling lock debugging due to kernel taint [ 42.562159] Kernel panic - not syncing: panic_on_warn set ... [ 42.562159] [ 42.569488] CPU: 1 PID: 2978 Comm: syzkaller656140 Tainted: G B 4.14.0-rc5+ #47 [ 42.578027] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 42.587346] Call Trace: [ 42.589906] dump_stack+0x194/0x257 [ 42.593507] ? arch_local_irq_restore+0x53/0x53 [ 42.598143] ? kasan_end_report+0x32/0x50 [ 42.602257] ? lock_downgrade+0x990/0x990 [ 42.606372] ? detach_if_pending+0x510/0x610 [ 42.610746] panic+0x1e4/0x417 [ 42.613906] ? __warn+0x1d9/0x1d9 [ 42.617338] ? detach_if_pending+0x557/0x610 [ 42.621741] kasan_end_report+0x50/0x50 [ 42.625686] kasan_report+0x144/0x340 [ 42.629454] __asan_report_store8_noabort+0x17/0x20 [ 42.634437] detach_if_pending+0x557/0x610 [ 42.638639] ? trace_raw_output_tick_stop+0x130/0x130 [ 42.643798] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 42.648430] ? lock_timer_base+0x1a3/0x2b0 [ 42.652629] ? lock_timer_base+0x1eb/0x2b0 [ 42.656830] ? __internal_add_timer+0x2d0/0x2d0 [ 42.661474] ? lock_downgrade+0x990/0x990 [ 42.665586] ? trace_hardirqs_on+0xd/0x10 [ 42.669704] try_to_del_timer_sync+0xa2/0x120 [ 42.674164] ? del_timer+0x130/0x130 [ 42.677846] ? del_timer_sync+0xeb/0x240 [ 42.681875] del_timer_sync+0x18a/0x240 [ 42.685820] tun_free_netdev+0x105/0x1b0 [ 42.689847] ? tun_xdp+0x410/0x410 [ 42.693355] ? cpumask_next+0x24/0x30 [ 42.697126] ? netdev_refcnt_read+0xed/0x150 [ 42.701505] ? tun_xdp+0x410/0x410 [ 42.705015] netdev_run_todo+0x870/0xca0 [ 42.709047] ? do_group_exit+0x149/0x400 [ 42.713078] ? mark_held_locks+0xaf/0x100 [ 42.717195] ? register_netdev+0x30/0x30 [ 42.721227] ? find_held_lock+0x35/0x1d0 [ 42.725259] ? lock_downgrade+0x990/0x990 [ 42.729377] ? refcount_sub_and_test+0x115/0x1b0 [ 42.734099] ? refcount_inc+0x50/0x50 [ 42.737866] ? refcount_inc+0x50/0x50 [ 42.741638] ? sk_destruct+0x4c/0x80 [ 42.745324] ? __sk_free+0x5c/0x230 [ 42.748918] ? sk_free+0x2f/0x40 [ 42.752255] ? __tun_detach+0x176/0x1390 [ 42.756286] ? tun_attach+0xfa0/0xfa0 [ 42.760057] ? check_noncircular+0x20/0x20 [ 42.764262] ? locks_remove_file+0x3fa/0x5a0 [ 42.768636] ? fcntl_setlk+0x10c0/0x10c0 [ 42.772665] ? kmem_cache_free+0x77/0x280 [ 42.776782] ? __fsnotify_parent+0xb4/0x3a0 [ 42.781068] ? fsnotify+0x1af0/0x1af0 [ 42.784836] ? __tun_detach+0x1390/0x1390 [ 42.788950] ? __tun_detach+0x1390/0x1390 [ 42.793068] rtnl_unlock+0xe/0x10 [ 42.796510] tun_chr_close+0x49/0x60 [ 42.800203] __fput+0x327/0x7e0 [ 42.803453] ? fput+0x140/0x140 [ 42.806702] ? _raw_spin_unlock_irq+0x27/0x70 [ 42.811167] ____fput+0x15/0x20 [ 42.814417] task_work_run+0x199/0x270 [ 42.818272] ? task_work_cancel+0x210/0x210 [ 42.822561] ? _raw_spin_unlock+0x22/0x30 [ 42.826676] ? switch_task_namespaces+0x87/0xc0 [ 42.831314] do_exit+0x9b5/0x1ad0 [ 42.834733] ? __handle_mm_fault+0xf07/0x39c0 [ 42.839194] ? mm_update_next_owner+0x930/0x930 [ 42.843831] ? lock_release+0xa40/0xa40 [ 42.847771] ? do_raw_spin_trylock+0x190/0x190 [ 42.852321] ? preempt_notifier_dec+0x20/0x20 [ 42.856790] ? __handle_mm_fault+0x587/0x39c0 [ 42.861253] ? check_noncircular+0x20/0x20 [ 42.865454] ? __pmd_alloc+0x4e0/0x4e0 [ 42.869309] ? to_ratio+0x30/0x30 [ 42.872730] ? find_held_lock+0x35/0x1d0 [ 42.876759] ? handle_mm_fault+0x248/0x8d0 [ 42.880960] ? find_held_lock+0x35/0x1d0 [ 42.884990] ? __do_page_fault+0x64c/0xd60 [ 42.889189] ? lock_downgrade+0x990/0x990 [ 42.893306] ? handle_mm_fault+0x410/0x8d0 [ 42.897505] ? down_read_trylock+0xdb/0x170 [ 42.901792] ? __do_page_fault+0x31e/0xd60 [ 42.905993] ? __handle_mm_fault+0x39c0/0x39c0 [ 42.910540] ? vmacache_find+0x5f/0x280 [ 42.914480] ? vmacache_update+0xfe/0x130 [ 42.918603] do_group_exit+0x149/0x400 [ 42.922464] ? __do_page_fault+0x3d6/0xd60 [ 42.926667] ? exit_to_usermode_loop+0x198/0x310 [ 42.931390] ? SyS_exit+0x30/0x30 [ 42.934812] ? do_fast_syscall_32+0x158/0xf05 [ 42.939270] ? do_group_exit+0x400/0x400 [ 42.943295] SyS_exit_group+0x1d/0x20 [ 42.947063] do_fast_syscall_32+0x3f2/0xf05 [ 42.951353] ? do_int80_syscall_32+0x940/0x940 [ 42.955902] ? kasan_check_read+0x11/0x20 [ 42.960016] ? do_syscall_64+0x8d0/0x8d0 [ 42.964044] ? SyS_rt_sigaction+0x94/0x1b0 [ 42.968244] ? SyS_sigprocmask+0x4b0/0x4b0 [ 42.972447] ? SyS_read+0x184/0x220