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-8,10.128.0.10' (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: [ 51.364285] ================================================================== [ 51.371736] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 51.378458] Write of size 8 at addr ffff8801cdbd3740 by task syzkaller748767/2988 [ 51.386045] [ 51.387647] CPU: 0 PID: 2988 Comm: syzkaller748767 Not tainted 4.14.0-rc3+ #118 [ 51.395063] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 51.404390] Call Trace: [ 51.406951] dump_stack+0x194/0x257 [ 51.410559] ? arch_local_irq_restore+0x53/0x53 [ 51.415202] ? show_regs_print_info+0x65/0x65 [ 51.419672] ? lock_timer_base+0x1a3/0x2b0 [ 51.423881] ? detach_if_pending+0x557/0x610 [ 51.428266] print_address_description+0x73/0x250 [ 51.433080] ? detach_if_pending+0x557/0x610 [ 51.437460] kasan_report+0x25b/0x340 [ 51.441235] __asan_report_store8_noabort+0x17/0x20 [ 51.446222] detach_if_pending+0x557/0x610 [ 51.450434] ? trace_raw_output_tick_stop+0x130/0x130 [ 51.455602] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 51.460238] ? lock_timer_base+0x1a3/0x2b0 [ 51.464448] ? lock_timer_base+0x1eb/0x2b0 [ 51.468662] ? __internal_add_timer+0x2d0/0x2d0 [ 51.473305] ? trace_hardirqs_on+0xd/0x10 [ 51.477434] try_to_del_timer_sync+0xa2/0x120 [ 51.481905] ? del_timer+0x130/0x130 [ 51.485595] ? del_timer_sync+0xeb/0x240 [ 51.489636] del_timer_sync+0x18a/0x240 [ 51.493592] tun_free_netdev+0x105/0x1b0 [ 51.497630] ? tun_xdp+0x410/0x410 [ 51.501140] ? cpumask_next+0x24/0x30 [ 51.504917] ? netdev_refcnt_read+0xed/0x150 [ 51.509300] ? tun_xdp+0x410/0x410 [ 51.512813] netdev_run_todo+0x870/0xca0 [ 51.516846] ? do_group_exit+0x149/0x400 [ 51.520887] ? register_netdev+0x30/0x30 [ 51.524925] ? lock_downgrade+0x990/0x990 [ 51.529046] ? trace_hardirqs_on+0xd/0x10 [ 51.533183] ? refcount_sub_and_test+0x115/0x1b0 [ 51.537908] ? refcount_inc+0x50/0x50 [ 51.541679] ? refcount_inc+0x50/0x50 [ 51.545459] ? sk_destruct+0x4c/0x80 [ 51.549144] ? __sk_free+0x5c/0x230 [ 51.552744] ? sk_free+0x2f/0x40 [ 51.556084] ? __tun_detach+0x176/0x1390 [ 51.560127] ? tun_attach+0xf90/0xf90 [ 51.563913] ? locks_remove_file+0x3fa/0x5a0 [ 51.568297] ? fcntl_setlk+0x10d0/0x10d0 [ 51.572334] ? __fsnotify_parent+0xb4/0x3a0 [ 51.576630] ? fsnotify+0x1af0/0x1af0 [ 51.580409] ? __tun_detach+0x1390/0x1390 [ 51.584532] rtnl_unlock+0xe/0x10 [ 51.587955] tun_chr_close+0x49/0x60 [ 51.591643] __fput+0x333/0x7f0 [ 51.594900] ? fput+0x140/0x140 [ 51.598154] ? check_same_owner+0x320/0x320 [ 51.602452] ____fput+0x15/0x20 [ 51.605704] task_work_run+0x199/0x270 [ 51.609567] ? task_work_cancel+0x210/0x210 [ 51.613859] ? free_nsproxy+0x185/0x1f0 [ 51.617808] ? switch_task_namespaces+0xa2/0xc0 [ 51.622453] do_exit+0x9d2/0x1af0 [ 51.625885] ? mm_update_next_owner+0x930/0x930 [ 51.630527] ? find_held_lock+0x39/0x1d0 [ 51.634573] ? lock_downgrade+0x990/0x990 [ 51.638715] ? handle_mm_fault+0x410/0x8d0 [ 51.642923] ? __do_page_fault+0x31e/0xd60 [ 51.647130] ? __handle_mm_fault+0x39c0/0x39c0 [ 51.651682] ? vmacache_find+0x5f/0x280 [ 51.655641] ? up_read+0x1a/0x40 [ 51.658981] ? __do_page_fault+0x3d6/0xd60 [ 51.663195] ? mm_fault_error+0x2c0/0x2c0 [ 51.667313] ? do_vfs_ioctl+0x492/0x1530 [ 51.671353] ? do_page_fault+0xee/0x720 [ 51.675298] ? __do_page_fault+0xd60/0xd60 [ 51.679503] ? putname+0xf3/0x130 [ 51.682935] do_group_exit+0x149/0x400 [ 51.686795] ? lockdep_sys_exit+0x47/0xf0 [ 51.690915] ? SyS_exit+0x30/0x30 [ 51.694341] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 51.699331] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 51.704060] SyS_exit_group+0x1d/0x20 [ 51.707835] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.712563] RIP: 0033:0x444ec9 [ 51.715724] RSP: 002b:00007ffd2d02fda8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 51.723405] RAX: ffffffffffffffda RBX: 00007ffd2d02fdf0 RCX: 0000000000444ec9 [ 51.731001] RDX: 0000000000444ec9 RSI: 00000000207a3fd8 RDI: 0000000000000001 [ 51.738245] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffd2d02fdf0 [ 51.745485] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402210 [ 51.752725] R13: 00000000004022a0 R14: 0000000000000000 R15: 0000000000000000 [ 51.759986] [ 51.761588] Allocated by task 2988: [ 51.765192] save_stack_trace+0x16/0x20 [ 51.769139] save_stack+0x43/0xd0 [ 51.772566] kasan_kmalloc+0xad/0xe0 [ 51.776249] __kmalloc_node+0x47/0x70 [ 51.780020] kvmalloc_node+0x64/0xd0 [ 51.783721] alloc_netdev_mqs+0x16e/0xed0 [ 51.787850] __tun_chr_ioctl+0x12be/0x3d20 [ 51.792055] tun_chr_ioctl+0x2a/0x40 [ 51.795740] do_vfs_ioctl+0x1b1/0x1530 [ 51.799597] SyS_ioctl+0x8f/0xc0 [ 51.802936] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.807658] [ 51.809254] Freed by task 2988: [ 51.812504] save_stack_trace+0x16/0x20 [ 51.816450] save_stack+0x43/0xd0 [ 51.819870] kasan_slab_free+0x71/0xc0 [ 51.823725] kfree+0xca/0x250 [ 51.826799] kvfree+0x36/0x60 [ 51.829874] free_netdev+0x2cf/0x360 [ 51.833560] __tun_chr_ioctl+0x2cf6/0x3d20 [ 51.837764] tun_chr_ioctl+0x2a/0x40 [ 51.841448] do_vfs_ioctl+0x1b1/0x1530 [ 51.845304] SyS_ioctl+0x8f/0xc0 [ 51.848641] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 51.853363] [ 51.854963] The buggy address belongs to the object at ffff8801cdbd0340 [ 51.854963] which belongs to the cache kmalloc-16384 of size 16384 [ 51.867935] The buggy address is located 13312 bytes inside of [ 51.867935] 16384-byte region [ffff8801cdbd0340, ffff8801cdbd4340) [ 51.880124] The buggy address belongs to the page: [ 51.885023] page:ffffea000736f400 count:1 mapcount:0 mapping:ffff8801cdbd0340 index:0x0 compound_mapcount: 0 [ 51.894967] flags: 0x200000000008100(slab|head) [ 51.899608] raw: 0200000000008100 ffff8801cdbd0340 0000000000000000 0000000100000001 [ 51.907458] raw: ffffea000736d820 ffff8801dac01c50 ffff8801dac02200 0000000000000000 [ 51.915305] page dumped because: kasan: bad access detected [ 51.920982] [ 51.922582] Memory state around the buggy address: [ 51.927480] ffff8801cdbd3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.934809] ffff8801cdbd3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.942138] >ffff8801cdbd3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.949465] ^ [ 51.954883] ffff8801cdbd3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.962211] ffff8801cdbd3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 51.969540] ================================================================== [ 51.976867] Disabling lock debugging due to kernel taint [ 51.982280] Kernel panic - not syncing: panic_on_warn set ... [ 51.982280] [ 51.989605] CPU: 0 PID: 2988 Comm: syzkaller748767 Tainted: G B 4.14.0-rc3+ #118 [ 51.998228] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 52.007545] Call Trace: [ 52.010098] dump_stack+0x194/0x257 [ 52.013692] ? arch_local_irq_restore+0x53/0x53 [ 52.018327] ? vprintk_default+0x28/0x30 [ 52.022357] ? detach_if_pending+0x460/0x610 [ 52.026731] panic+0x1e4/0x417 [ 52.029888] ? __warn+0x1d9/0x1d9 [ 52.033313] ? detach_if_pending+0x557/0x610 [ 52.037685] kasan_end_report+0x50/0x50 [ 52.041626] kasan_report+0x144/0x340 [ 52.045393] __asan_report_store8_noabort+0x17/0x20 [ 52.050371] detach_if_pending+0x557/0x610 [ 52.054573] ? trace_raw_output_tick_stop+0x130/0x130 [ 52.059729] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 52.064360] ? lock_timer_base+0x1a3/0x2b0 [ 52.068561] ? lock_timer_base+0x1eb/0x2b0 [ 52.072762] ? __internal_add_timer+0x2d0/0x2d0 [ 52.077399] ? trace_hardirqs_on+0xd/0x10 [ 52.081515] try_to_del_timer_sync+0xa2/0x120 [ 52.085975] ? del_timer+0x130/0x130 [ 52.089654] ? del_timer_sync+0xeb/0x240 [ 52.093685] del_timer_sync+0x18a/0x240 [ 52.097627] tun_free_netdev+0x105/0x1b0 [ 52.101652] ? tun_xdp+0x410/0x410 [ 52.105156] ? cpumask_next+0x24/0x30 [ 52.108923] ? netdev_refcnt_read+0xed/0x150 [ 52.113297] ? tun_xdp+0x410/0x410 [ 52.116801] netdev_run_todo+0x870/0xca0 [ 52.120826] ? do_group_exit+0x149/0x400 [ 52.124854] ? register_netdev+0x30/0x30 [ 52.128879] ? lock_downgrade+0x990/0x990 [ 52.132990] ? trace_hardirqs_on+0xd/0x10 [ 52.137115] ? refcount_sub_and_test+0x115/0x1b0 [ 52.141835] ? refcount_inc+0x50/0x50 [ 52.145599] ? refcount_inc+0x50/0x50 [ 52.149366] ? sk_destruct+0x4c/0x80 [ 52.153045] ? __sk_free+0x5c/0x230 [ 52.156637] ? sk_free+0x2f/0x40 [ 52.159968] ? __tun_detach+0x176/0x1390 [ 52.163998] ? tun_attach+0xf90/0xf90 [ 52.167772] ? locks_remove_file+0x3fa/0x5a0 [ 52.172147] ? fcntl_setlk+0x10d0/0x10d0 [ 52.176174] ? __fsnotify_parent+0xb4/0x3a0 [ 52.180461] ? fsnotify+0x1af0/0x1af0 [ 52.184231] ? __tun_detach+0x1390/0x1390 [ 52.188343] rtnl_unlock+0xe/0x10 [ 52.191760] tun_chr_close+0x49/0x60 [ 52.195438] __fput+0x333/0x7f0 [ 52.198685] ? fput+0x140/0x140 [ 52.201939] ? check_same_owner+0x320/0x320 [ 52.206229] ____fput+0x15/0x20 [ 52.209476] task_work_run+0x199/0x270 [ 52.213341] ? task_work_cancel+0x210/0x210 [ 52.217628] ? free_nsproxy+0x185/0x1f0 [ 52.221568] ? switch_task_namespaces+0xa2/0xc0 [ 52.226205] do_exit+0x9d2/0x1af0 [ 52.229626] ? mm_update_next_owner+0x930/0x930 [ 52.234260] ? find_held_lock+0x39/0x1d0 [ 52.238295] ? lock_downgrade+0x990/0x990 [ 52.242418] ? handle_mm_fault+0x410/0x8d0 [ 52.246617] ? __do_page_fault+0x31e/0xd60 [ 52.250816] ? __handle_mm_fault+0x39c0/0x39c0 [ 52.255361] ? vmacache_find+0x5f/0x280 [ 52.259303] ? up_read+0x1a/0x40 [ 52.262636] ? __do_page_fault+0x3d6/0xd60 [ 52.266838] ? mm_fault_error+0x2c0/0x2c0 [ 52.270950] ? do_vfs_ioctl+0x492/0x1530 [ 52.274978] ? do_page_fault+0xee/0x720 [ 52.278917] ? __do_page_fault+0xd60/0xd60 [ 52.283114] ? putname+0xf3/0x130 [ 52.286535] do_group_exit+0x149/0x400 [ 52.290398] ? lockdep_sys_exit+0x47/0xf0 [ 52.294603] ? SyS_exit+0x30/0x30 [ 52.298021] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 52.303005] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 52.307726] SyS_exit_group+0x1d/0x20 [ 52.311497] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 52.316220] RIP: 0033:0x444ec9 [ 52.319375] RSP: 002b:00007ffd2d02fda8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 [ 52.327046] RAX: ffffffffffffffda RBX: 00007ffd2d02fdf0 RCX: 0000000000444ec9 [ 52.334280] RDX: 0000000000444ec9 RSI: 00000000207a3fd8 RDI: 0000000000000001 [ 52.341519] RBP: 0000000000000086 R08: 0000000000000000 R09: 00007ffd2d02fdf0 [ 52.348754] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000402210 [ 52.355989] R13: 00000000004022a0 R14: 0000000000000000 R15: 0000000000000000