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.8' (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: [ 28.238630] ================================================================== [ 28.239814] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 28.240736] Write of size 8 at addr ffff8801d1d336b8 by task syzkaller076853/2974 [ 28.241803] [ 28.242068] CPU: 1 PID: 2974 Comm: syzkaller076853 Not tainted 4.14.0-rc5+ #135 [ 28.243074] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.244307] Call Trace: [ 28.244700] dump_stack+0x194/0x257 [ 28.245212] ? arch_local_irq_restore+0x53/0x53 [ 28.245869] ? show_regs_print_info+0x65/0x65 [ 28.246486] ? lock_timer_base+0x1a3/0x2b0 [ 28.247085] ? detach_if_pending+0x557/0x610 [ 28.247724] print_address_description+0x73/0x250 [ 28.248387] ? detach_if_pending+0x557/0x610 [ 28.249008] kasan_report+0x25b/0x340 [ 28.249566] __asan_report_store8_noabort+0x17/0x20 [ 28.250281] detach_if_pending+0x557/0x610 [ 28.250866] ? trace_raw_output_tick_stop+0x130/0x130 [ 28.251595] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 28.252228] ? lock_timer_base+0x1a3/0x2b0 [ 28.252831] ? lock_timer_base+0x1eb/0x2b0 [ 28.253438] ? __internal_add_timer+0x2d0/0x2d0 [ 28.254076] ? lock_downgrade+0x990/0x990 [ 28.254644] ? trace_hardirqs_on+0xd/0x10 [ 28.255239] try_to_del_timer_sync+0xa2/0x120 [ 28.255906] ? del_timer+0x130/0x130 [ 28.256423] ? del_timer_sync+0xeb/0x240 [ 28.257011] del_timer_sync+0x18a/0x240 [ 28.257564] tun_free_netdev+0x105/0x1b0 [ 28.258142] ? tun_xdp+0x410/0x410 [ 28.258633] ? cpumask_next+0x24/0x30 [ 28.261460] ? netdev_refcnt_read+0xed/0x150 [ 28.265863] ? tun_xdp+0x410/0x410 [ 28.269476] netdev_run_todo+0x870/0xca0 [ 28.273523] ? do_group_exit+0x149/0x400 [ 28.277569] ? mark_held_locks+0xaf/0x100 [ 28.281691] ? register_netdev+0x30/0x30 [ 28.285727] ? find_held_lock+0x35/0x1d0 [ 28.289772] ? lock_downgrade+0x990/0x990 [ 28.293900] ? refcount_sub_and_test+0x115/0x1b0 [ 28.298628] ? refcount_inc+0x50/0x50 [ 28.302405] ? refcount_inc+0x50/0x50 [ 28.306182] ? sk_destruct+0x4c/0x80 [ 28.309866] ? __sk_free+0x5c/0x230 [ 28.313463] ? sk_free+0x2f/0x40 [ 28.316800] ? __tun_detach+0x176/0x1390 [ 28.320844] ? tun_attach+0xfa0/0xfa0 [ 28.324622] ? lock_downgrade+0x990/0x990 [ 28.328755] ? locks_remove_file+0x3fa/0x5a0 [ 28.333136] ? fcntl_setlk+0x10c0/0x10c0 [ 28.337170] ? __fsnotify_parent+0xb4/0x3a0 [ 28.341467] ? fsnotify+0x1af0/0x1af0 [ 28.345250] ? __tun_detach+0x1390/0x1390 [ 28.349379] rtnl_unlock+0xe/0x10 [ 28.352800] tun_chr_close+0x49/0x60 [ 28.356485] __fput+0x327/0x7e0 [ 28.359744] ? fput+0x140/0x140 [ 28.362996] ? check_same_owner+0x320/0x320 [ 28.367294] ? _raw_spin_unlock_irq+0x27/0x70 [ 28.371767] ____fput+0x15/0x20 [ 28.375023] task_work_run+0x199/0x270 [ 28.378883] ? task_work_cancel+0x210/0x210 [ 28.383175] ? _raw_spin_unlock+0x22/0x30 [ 28.387294] ? switch_task_namespaces+0x87/0xc0 [ 28.391937] do_exit+0x9b5/0x1ad0 [ 28.395361] ? kvfree+0x3b/0x60 [ 28.398616] ? mm_update_next_owner+0x930/0x930 [ 28.403255] ? find_held_lock+0x35/0x1d0 [ 28.407297] ? handle_mm_fault+0x248/0x8d0 [ 28.411506] ? find_held_lock+0x35/0x1d0 [ 28.415549] ? __do_page_fault+0x64c/0xd60 [ 28.419755] ? lock_downgrade+0x990/0x990 [ 28.423886] ? handle_mm_fault+0x410/0x8d0 [ 28.428088] ? __do_page_fault+0x31e/0xd60 [ 28.432292] ? __handle_mm_fault+0x39c0/0x39c0 [ 28.436842] ? vmacache_find+0x5f/0x280 [ 28.440803] ? up_read+0x1a/0x40 [ 28.444140] ? __do_page_fault+0x3d6/0xd60 [ 28.448355] ? mm_fault_error+0x2c0/0x2c0 [ 28.452472] ? do_vfs_ioctl+0x486/0x1520 [ 28.456515] ? do_page_fault+0xee/0x720 [ 28.460461] ? __do_page_fault+0xd60/0xd60 [ 28.464666] ? iterate_fd+0x3f0/0x3f0 [ 28.468435] ? putname+0xf3/0x130 [ 28.471866] do_group_exit+0x149/0x400 [ 28.475727] ? SyS_exit+0x30/0x30 [ 28.479150] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 28.484138] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 28.488869] SyS_exit_group+0x1d/0x20 [ 28.492645] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 28.497368] RIP: 0033:0x443748 [ 28.500527] RSP: 002b:00007ffced033c18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 28.508214] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443748 [ 28.515452] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 28.522692] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 28.529930] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 28.537169] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 28.544433] [ 28.546030] Allocated by task 2974: [ 28.549627] save_stack_trace+0x16/0x20 [ 28.553570] save_stack+0x43/0xd0 [ 28.556990] kasan_kmalloc+0xad/0xe0 [ 28.560671] __kmalloc_node+0x47/0x70 [ 28.564439] kvmalloc_node+0x64/0xd0 [ 28.568120] alloc_netdev_mqs+0x16e/0xed0 [ 28.572237] __tun_chr_ioctl+0x12b2/0x3d20 [ 28.576439] tun_chr_ioctl+0x2a/0x40 [ 28.580118] do_vfs_ioctl+0x1b1/0x1520 [ 28.583974] SyS_ioctl+0x8f/0xc0 [ 28.587309] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 28.592028] [ 28.593626] Freed by task 2974: [ 28.596874] save_stack_trace+0x16/0x20 [ 28.600818] save_stack+0x43/0xd0 [ 28.604236] kasan_slab_free+0x71/0xc0 [ 28.608090] kfree+0xca/0x250 [ 28.611162] kvfree+0x36/0x60 [ 28.614239] free_netdev+0x2cf/0x360 [ 28.617920] __tun_chr_ioctl+0x2cea/0x3d20 [ 28.622121] tun_chr_ioctl+0x2a/0x40 [ 28.625803] do_vfs_ioctl+0x1b1/0x1520 [ 28.629656] SyS_ioctl+0x8f/0xc0 [ 28.632989] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 28.637709] [ 28.639306] The buggy address belongs to the object at ffff8801d1d30380 [ 28.639306] which belongs to the cache kmalloc-16384 of size 16384 [ 28.652278] The buggy address is located 13112 bytes inside of [ 28.652278] 16384-byte region [ffff8801d1d30380, ffff8801d1d34380) [ 28.664466] The buggy address belongs to the page: [ 28.669365] page:ffffea0007474c00 count:1 mapcount:0 mapping:ffff8801d1d30380 index:0x0 compound_mapcount: 0 [ 28.679301] flags: 0x200000000008100(slab|head) [ 28.683939] raw: 0200000000008100 ffff8801d1d30380 0000000000000000 0000000100000001 [ 28.691789] raw: ffffea0007479020 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 28.699633] page dumped because: kasan: bad access detected [ 28.706389] [ 28.707987] Memory state around the buggy address: [ 28.712886] ffff8801d1d33580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.720212] ffff8801d1d33600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.727538] >ffff8801d1d33680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.734862] ^ [ 28.740020] ffff8801d1d33700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.747347] ffff8801d1d33780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 28.754672] ================================================================== [ 28.761998] Disabling lock debugging due to kernel taint [ 28.767413] Kernel panic - not syncing: panic_on_warn set ... [ 28.767413] [ 28.774742] CPU: 1 PID: 2974 Comm: syzkaller076853 Tainted: G B 4.14.0-rc5+ #135 [ 28.783370] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 28.792689] Call Trace: [ 28.795262] dump_stack+0x194/0x257 [ 28.798861] ? arch_local_irq_restore+0x53/0x53 [ 28.803496] ? kasan_end_report+0x32/0x50 [ 28.807612] ? lock_downgrade+0x990/0x990 [ 28.811728] ? detach_if_pending+0x510/0x610 [ 28.816114] panic+0x1e4/0x417 [ 28.819274] ? __warn+0x1d9/0x1d9 [ 28.822703] ? detach_if_pending+0x557/0x610 [ 28.827081] kasan_end_report+0x50/0x50 [ 28.831021] kasan_report+0x144/0x340 [ 28.834792] __asan_report_store8_noabort+0x17/0x20 [ 28.839777] detach_if_pending+0x557/0x610 [ 28.843981] ? trace_raw_output_tick_stop+0x130/0x130 [ 28.849139] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 28.853775] ? lock_timer_base+0x1a3/0x2b0 [ 28.857978] ? lock_timer_base+0x1eb/0x2b0 [ 28.862184] ? __internal_add_timer+0x2d0/0x2d0 [ 28.866821] ? lock_downgrade+0x990/0x990 [ 28.870944] ? trace_hardirqs_on+0xd/0x10 [ 28.875067] try_to_del_timer_sync+0xa2/0x120 [ 28.879530] ? del_timer+0x130/0x130 [ 28.883212] ? del_timer_sync+0xeb/0x240 [ 28.887243] del_timer_sync+0x18a/0x240 [ 28.891189] tun_free_netdev+0x105/0x1b0 [ 28.895219] ? tun_xdp+0x410/0x410 [ 28.898728] ? cpumask_next+0x24/0x30 [ 28.902501] ? netdev_refcnt_read+0xed/0x150 [ 28.906880] ? tun_xdp+0x410/0x410 [ 28.910387] netdev_run_todo+0x870/0xca0 [ 28.914415] ? do_group_exit+0x149/0x400 [ 28.918446] ? mark_held_locks+0xaf/0x100 [ 28.922564] ? register_netdev+0x30/0x30 [ 28.926595] ? find_held_lock+0x35/0x1d0 [ 28.930632] ? lock_downgrade+0x990/0x990 [ 28.934753] ? refcount_sub_and_test+0x115/0x1b0 [ 28.939475] ? refcount_inc+0x50/0x50 [ 28.943242] ? refcount_inc+0x50/0x50 [ 28.947011] ? sk_destruct+0x4c/0x80 [ 28.950691] ? __sk_free+0x5c/0x230 [ 28.954285] ? sk_free+0x2f/0x40 [ 28.957621] ? __tun_detach+0x176/0x1390 [ 28.961658] ? tun_attach+0xfa0/0xfa0 [ 28.965429] ? lock_downgrade+0x990/0x990 [ 28.969549] ? locks_remove_file+0x3fa/0x5a0 [ 28.973926] ? fcntl_setlk+0x10c0/0x10c0 [ 28.977957] ? __fsnotify_parent+0xb4/0x3a0 [ 28.982259] ? fsnotify+0x1af0/0x1af0 [ 28.986031] ? __tun_detach+0x1390/0x1390 [ 28.990146] rtnl_unlock+0xe/0x10 [ 28.993566] tun_chr_close+0x49/0x60 [ 28.997248] __fput+0x327/0x7e0 [ 29.000498] ? fput+0x140/0x140 [ 29.003750] ? check_same_owner+0x320/0x320 [ 29.008039] ? _raw_spin_unlock_irq+0x27/0x70 [ 29.012507] ____fput+0x15/0x20 [ 29.015756] task_work_run+0x199/0x270 [ 29.019615] ? task_work_cancel+0x210/0x210 [ 29.023905] ? _raw_spin_unlock+0x22/0x30 [ 29.028023] ? switch_task_namespaces+0x87/0xc0 [ 29.032662] do_exit+0x9b5/0x1ad0 [ 29.036084] ? kvfree+0x3b/0x60 [ 29.039332] ? mm_update_next_owner+0x930/0x930 [ 29.043968] ? find_held_lock+0x35/0x1d0 [ 29.048004] ? handle_mm_fault+0x248/0x8d0 [ 29.052208] ? find_held_lock+0x35/0x1d0 [ 29.056245] ? __do_page_fault+0x64c/0xd60 [ 29.060450] ? lock_downgrade+0x990/0x990 [ 29.064573] ? handle_mm_fault+0x410/0x8d0 [ 29.068774] ? __do_page_fault+0x31e/0xd60 [ 29.072982] ? __handle_mm_fault+0x39c0/0x39c0 [ 29.077530] ? vmacache_find+0x5f/0x280 [ 29.081478] ? up_read+0x1a/0x40 [ 29.084813] ? __do_page_fault+0x3d6/0xd60 [ 29.089024] ? mm_fault_error+0x2c0/0x2c0 [ 29.093138] ? do_vfs_ioctl+0x486/0x1520 [ 29.097173] ? do_page_fault+0xee/0x720 [ 29.101117] ? __do_page_fault+0xd60/0xd60 [ 29.105319] ? iterate_fd+0x3f0/0x3f0 [ 29.109085] ? putname+0xf3/0x130 [ 29.112509] do_group_exit+0x149/0x400 [ 29.116366] ? SyS_exit+0x30/0x30 [ 29.119799] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 29.124788] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 29.129515] SyS_exit_group+0x1d/0x20 [ 29.133285] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 29.138008] RIP: 0033:0x443748 [ 29.141168] RSP: 002b:00007ffced033c18 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 29.148845] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443748 [ 29.156085] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 29.163322] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 29.170558] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 29.177795] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000