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.15.198' (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: [ 36.029567] ================================================================== [ 36.030658] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 36.031563] Write of size 8 at addr ffff8801d21536b8 by task syzkaller191737/2977 [ 36.032583] [ 36.032816] CPU: 1 PID: 2977 Comm: syzkaller191737 Not tainted 4.14.0-rc5+ #44 [ 36.034180] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.035398] Call Trace: [ 36.035754] dump_stack+0x194/0x257 [ 36.036246] ? arch_local_irq_restore+0x53/0x53 [ 36.036868] ? show_regs_print_info+0x65/0x65 [ 36.037467] ? lock_acquire+0x1d5/0x580 [ 36.038002] ? lock_timer_base+0x1a3/0x2b0 [ 36.038570] ? detach_if_pending+0x557/0x610 [ 36.039159] print_address_description+0x73/0x250 [ 36.039821] ? detach_if_pending+0x557/0x610 [ 36.040429] kasan_report+0x25b/0x340 [ 36.040945] __asan_report_store8_noabort+0x17/0x20 [ 36.041612] detach_if_pending+0x557/0x610 [ 36.042181] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.042873] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.043496] ? lock_timer_base+0x1a3/0x2b0 [ 36.044061] ? lock_timer_base+0x1eb/0x2b0 [ 36.044630] ? __internal_add_timer+0x2d0/0x2d0 [ 36.045250] ? lock_downgrade+0x990/0x990 [ 36.045804] ? trace_hardirqs_on+0xd/0x10 [ 36.046366] try_to_del_timer_sync+0xa2/0x120 [ 36.046965] ? del_timer+0x130/0x130 [ 36.047464] ? del_timer_sync+0xeb/0x240 [ 36.048014] del_timer_sync+0x18a/0x240 [ 36.048552] tun_free_netdev+0x105/0x1b0 [ 36.049097] ? tun_xdp+0x410/0x410 [ 36.049601] ? cpumask_next+0x24/0x30 [ 36.050111] ? netdev_refcnt_read+0xed/0x150 [ 36.054495] ? tun_xdp+0x410/0x410 [ 36.058004] netdev_run_todo+0x870/0xca0 [ 36.062033] ? do_group_exit+0x149/0x400 [ 36.066061] ? mark_held_locks+0xaf/0x100 [ 36.070174] ? register_netdev+0x30/0x30 [ 36.074204] ? find_held_lock+0x35/0x1d0 [ 36.078239] ? lock_downgrade+0x990/0x990 [ 36.082365] ? refcount_sub_and_test+0x115/0x1b0 [ 36.087085] ? refcount_inc+0x50/0x50 [ 36.090851] ? refcount_inc+0x50/0x50 [ 36.094623] ? sk_destruct+0x4c/0x80 [ 36.098300] ? __sk_free+0x5c/0x230 [ 36.101893] ? sk_free+0x2f/0x40 [ 36.105225] ? __tun_detach+0x176/0x1390 [ 36.109264] ? tun_attach+0xfa0/0xfa0 [ 36.113039] ? locks_remove_file+0x3fa/0x5a0 [ 36.117415] ? fcntl_setlk+0x10c0/0x10c0 [ 36.121443] ? __fsnotify_parent+0xb4/0x3a0 [ 36.125733] ? fsnotify+0x1af0/0x1af0 [ 36.129501] ? __tun_detach+0x1390/0x1390 [ 36.133614] ? __tun_detach+0x1390/0x1390 [ 36.137728] rtnl_unlock+0xe/0x10 [ 36.141146] tun_chr_close+0x49/0x60 [ 36.144824] __fput+0x327/0x7e0 [ 36.148073] ? fput+0x140/0x140 [ 36.151320] ? check_same_owner+0x320/0x320 [ 36.155611] ____fput+0x15/0x20 [ 36.158858] task_work_run+0x199/0x270 [ 36.162714] ? task_work_cancel+0x210/0x210 [ 36.167002] ? free_nsproxy+0x185/0x1f0 [ 36.170942] ? switch_task_namespaces+0xa2/0xc0 [ 36.175580] do_exit+0x9b5/0x1ad0 [ 36.178997] ? __handle_mm_fault+0xf07/0x39c0 [ 36.183463] ? mm_update_next_owner+0x930/0x930 [ 36.188097] ? lock_release+0xa40/0xa40 [ 36.192035] ? mark_held_locks+0xaf/0x100 [ 36.196146] ? kfree+0xe4/0x250 [ 36.199393] ? kvfree+0x36/0x60 [ 36.202647] ? trace_hardirqs_on+0xd/0x10 [ 36.206769] ? __handle_mm_fault+0x587/0x39c0 [ 36.211233] ? check_noncircular+0x20/0x20 [ 36.215431] ? __pmd_alloc+0x4e0/0x4e0 [ 36.219290] ? find_held_lock+0x35/0x1d0 [ 36.223326] ? handle_mm_fault+0x248/0x8d0 [ 36.227530] ? find_held_lock+0x35/0x1d0 [ 36.231565] ? __do_page_fault+0x64c/0xd60 [ 36.235786] ? lock_downgrade+0x990/0x990 [ 36.239906] ? handle_mm_fault+0x410/0x8d0 [ 36.244103] ? down_read_trylock+0xdb/0x170 [ 36.248388] ? __do_page_fault+0x31e/0xd60 [ 36.252587] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.257132] ? vmacache_find+0x5f/0x280 [ 36.261078] do_group_exit+0x149/0x400 [ 36.264929] ? __do_page_fault+0x3d6/0xd60 [ 36.269129] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 36.273502] ? SyS_exit+0x30/0x30 [ 36.276925] ? do_fast_syscall_32+0x158/0xf05 [ 36.281383] ? do_group_exit+0x400/0x400 [ 36.285413] SyS_exit_group+0x1d/0x20 [ 36.289179] do_fast_syscall_32+0x3f2/0xf05 [ 36.293473] ? do_int80_syscall_32+0x940/0x940 [ 36.298025] ? syscall_return_slowpath+0x2b3/0x510 [ 36.302916] ? finish_task_switch+0x1aa/0x740 [ 36.307375] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 36.312359] ? retint_user+0x18/0x20 [ 36.316041] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 36.320855] entry_SYSENTER_compat+0x51/0x60 [ 36.325229] RIP: 0023:0xf7f7fc79 [ 36.328559] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 36.336233] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 36.343469] RDX: 0000000000000001 RSI: 000000002023f000 RDI: 00000000400454ca [ 36.350702] RBP: 0000000008072cf6 R08: 0000000000000000 R09: 0000000000000000 [ 36.357936] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 36.365169] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 36.372421] [ 36.374013] Allocated by task 2977: [ 36.377607] save_stack_trace+0x16/0x20 [ 36.381547] save_stack+0x43/0xd0 [ 36.384965] kasan_kmalloc+0xad/0xe0 [ 36.388643] __kmalloc_node+0x47/0x70 [ 36.392405] kvmalloc_node+0x64/0xd0 [ 36.396086] alloc_netdev_mqs+0x16e/0xed0 [ 36.400197] __tun_chr_ioctl+0x12b2/0x3d20 [ 36.404396] tun_chr_compat_ioctl+0x29/0x30 [ 36.408683] compat_SyS_ioctl+0x1d7/0x3290 [ 36.412881] do_fast_syscall_32+0x3f2/0xf05 [ 36.417167] entry_SYSENTER_compat+0x51/0x60 [ 36.421537] [ 36.423129] Freed by task 2977: [ 36.426373] save_stack_trace+0x16/0x20 [ 36.430313] save_stack+0x43/0xd0 [ 36.433730] kasan_slab_free+0x71/0xc0 [ 36.437580] kfree+0xca/0x250 [ 36.440649] kvfree+0x36/0x60 [ 36.443719] free_netdev+0x2cf/0x360 [ 36.447397] __tun_chr_ioctl+0x2cea/0x3d20 [ 36.451595] tun_chr_compat_ioctl+0x29/0x30 [ 36.455879] compat_SyS_ioctl+0x1d7/0x3290 [ 36.460077] do_fast_syscall_32+0x3f2/0xf05 [ 36.464362] entry_SYSENTER_compat+0x51/0x60 [ 36.468732] [ 36.470325] The buggy address belongs to the object at ffff8801d2150380 [ 36.470325] which belongs to the cache kmalloc-16384 of size 16384 [ 36.483291] The buggy address is located 13112 bytes inside of [ 36.483291] 16384-byte region [ffff8801d2150380, ffff8801d2154380) [ 36.495472] The buggy address belongs to the page: [ 36.500364] page:ffffea0007485400 count:1 mapcount:0 mapping:ffff8801d2150380 index:0x0 compound_mapcount: 0 [ 36.510293] flags: 0x200000000008100(slab|head) [ 36.514926] raw: 0200000000008100 ffff8801d2150380 0000000000000000 0000000100000001 [ 36.522771] raw: ffffea0007460a20 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 36.530612] page dumped because: kasan: bad access detected [ 36.536284] [ 36.537874] Memory state around the buggy address: [ 36.542764] ffff8801d2153580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.550084] ffff8801d2153600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.557405] >ffff8801d2153680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.564727] ^ [ 36.569879] ffff8801d2153700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.577200] ffff8801d2153780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 36.584522] ================================================================== [ 36.591843] Disabling lock debugging due to kernel taint [ 36.597253] Kernel panic - not syncing: panic_on_warn set ... [ 36.597253] [ 36.604580] CPU: 1 PID: 2977 Comm: syzkaller191737 Tainted: G B 4.14.0-rc5+ #44 [ 36.613116] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 36.622430] Call Trace: [ 36.624988] dump_stack+0x194/0x257 [ 36.628585] ? arch_local_irq_restore+0x53/0x53 [ 36.633219] ? kasan_end_report+0x32/0x50 [ 36.637334] ? lock_downgrade+0x990/0x990 [ 36.641447] ? detach_if_pending+0x510/0x610 [ 36.645819] panic+0x1e4/0x417 [ 36.648974] ? __warn+0x1d9/0x1d9 [ 36.652395] ? detach_if_pending+0x557/0x610 [ 36.656766] kasan_end_report+0x50/0x50 [ 36.660702] kasan_report+0x144/0x340 [ 36.664469] __asan_report_store8_noabort+0x17/0x20 [ 36.669446] detach_if_pending+0x557/0x610 [ 36.673647] ? trace_raw_output_tick_stop+0x130/0x130 [ 36.678811] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 36.683442] ? lock_timer_base+0x1a3/0x2b0 [ 36.687639] ? lock_timer_base+0x1eb/0x2b0 [ 36.691839] ? __internal_add_timer+0x2d0/0x2d0 [ 36.696483] ? lock_downgrade+0x990/0x990 [ 36.700594] ? trace_hardirqs_on+0xd/0x10 [ 36.704708] try_to_del_timer_sync+0xa2/0x120 [ 36.709166] ? del_timer+0x130/0x130 [ 36.712842] ? del_timer_sync+0xeb/0x240 [ 36.716868] del_timer_sync+0x18a/0x240 [ 36.720807] tun_free_netdev+0x105/0x1b0 [ 36.724833] ? tun_xdp+0x410/0x410 [ 36.728337] ? cpumask_next+0x24/0x30 [ 36.732102] ? netdev_refcnt_read+0xed/0x150 [ 36.736474] ? tun_xdp+0x410/0x410 [ 36.739976] netdev_run_todo+0x870/0xca0 [ 36.744004] ? do_group_exit+0x149/0x400 [ 36.748030] ? mark_held_locks+0xaf/0x100 [ 36.752139] ? register_netdev+0x30/0x30 [ 36.756162] ? find_held_lock+0x35/0x1d0 [ 36.760192] ? lock_downgrade+0x990/0x990 [ 36.764308] ? refcount_sub_and_test+0x115/0x1b0 [ 36.769025] ? refcount_inc+0x50/0x50 [ 36.772788] ? refcount_inc+0x50/0x50 [ 36.776553] ? sk_destruct+0x4c/0x80 [ 36.780228] ? __sk_free+0x5c/0x230 [ 36.783820] ? sk_free+0x2f/0x40 [ 36.787147] ? __tun_detach+0x176/0x1390 [ 36.791175] ? tun_attach+0xfa0/0xfa0 [ 36.794944] ? locks_remove_file+0x3fa/0x5a0 [ 36.799322] ? fcntl_setlk+0x10c0/0x10c0 [ 36.803348] ? __fsnotify_parent+0xb4/0x3a0 [ 36.807632] ? fsnotify+0x1af0/0x1af0 [ 36.811400] ? __tun_detach+0x1390/0x1390 [ 36.815511] ? __tun_detach+0x1390/0x1390 [ 36.819625] rtnl_unlock+0xe/0x10 [ 36.823058] tun_chr_close+0x49/0x60 [ 36.826733] __fput+0x327/0x7e0 [ 36.829979] ? fput+0x140/0x140 [ 36.833222] ? check_same_owner+0x320/0x320 [ 36.837509] ____fput+0x15/0x20 [ 36.840752] task_work_run+0x199/0x270 [ 36.844606] ? task_work_cancel+0x210/0x210 [ 36.848890] ? free_nsproxy+0x185/0x1f0 [ 36.852828] ? switch_task_namespaces+0xa2/0xc0 [ 36.857463] do_exit+0x9b5/0x1ad0 [ 36.860878] ? __handle_mm_fault+0xf07/0x39c0 [ 36.865340] ? mm_update_next_owner+0x930/0x930 [ 36.870521] ? lock_release+0xa40/0xa40 [ 36.874461] ? mark_held_locks+0xaf/0x100 [ 36.878573] ? kfree+0xe4/0x250 [ 36.881815] ? kvfree+0x36/0x60 [ 36.885062] ? trace_hardirqs_on+0xd/0x10 [ 36.889177] ? __handle_mm_fault+0x587/0x39c0 [ 36.893637] ? check_noncircular+0x20/0x20 [ 36.897833] ? __pmd_alloc+0x4e0/0x4e0 [ 36.901686] ? find_held_lock+0x35/0x1d0 [ 36.905713] ? handle_mm_fault+0x248/0x8d0 [ 36.909912] ? find_held_lock+0x35/0x1d0 [ 36.913941] ? __do_page_fault+0x64c/0xd60 [ 36.918138] ? lock_downgrade+0x990/0x990 [ 36.922251] ? handle_mm_fault+0x410/0x8d0 [ 36.926448] ? down_read_trylock+0xdb/0x170 [ 36.930733] ? __do_page_fault+0x31e/0xd60 [ 36.934931] ? __handle_mm_fault+0x39c0/0x39c0 [ 36.939475] ? vmacache_find+0x5f/0x280 [ 36.943418] do_group_exit+0x149/0x400 [ 36.947271] ? __do_page_fault+0x3d6/0xd60 [ 36.951470] ? __tun_chr_ioctl+0x3d20/0x3d20 [ 36.955839] ? SyS_exit+0x30/0x30 [ 36.959259] ? do_fast_syscall_32+0x158/0xf05 [ 36.963715] ? do_group_exit+0x400/0x400 [ 36.967738] SyS_exit_group+0x1d/0x20 [ 36.971500] do_fast_syscall_32+0x3f2/0xf05 [ 36.975787] ? do_int80_syscall_32+0x940/0x940 [ 36.980334] ? syscall_return_slowpath+0x2b3/0x510 [ 36.985225] ? finish_task_switch+0x1aa/0x740 [ 36.989682] ? prepare_exit_to_usermode+0x2d0/0x2d0 [ 36.994662] ? retint_user+0x18/0x20 [ 36.998342] ? trace_hardirqs_off_thunk+0x1a/0x1c [ 37.003153] entry_SYSENTER_compat+0x51/0x60 [ 37.007524] RIP: 0023:0xf7f7fc79 [ 37.010849] RSP: 002b:000000000820fe2c EFLAGS: 00000202 ORIG_RAX: 00000000000000fc [ 37.018519] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000000000 [ 37.025754] RDX: 0000000000000001 RSI: 000000002023f000 RDI: 00000000400454ca