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-7,10.128.15.234' (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: [ 49.069340] ================================================================== [ 49.070469] BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610 [ 49.071378] Write of size 8 at addr ffff8801d10136b8 by task syzkaller198869/2975 [ 49.072385] [ 49.072619] CPU: 0 PID: 2975 Comm: syzkaller198869 Not tainted 4.14.0-rc5+ #136 [ 49.073596] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.074827] Call Trace: [ 49.075187] dump_stack+0x194/0x257 [ 49.075680] ? arch_local_irq_restore+0x53/0x53 [ 49.076303] ? show_regs_print_info+0x65/0x65 [ 49.076905] ? lock_timer_base+0x1a3/0x2b0 [ 49.077494] ? detach_if_pending+0x557/0x610 [ 49.078087] print_address_description+0x73/0x250 [ 49.078732] ? detach_if_pending+0x557/0x610 [ 49.079323] kasan_report+0x25b/0x340 [ 49.079840] __asan_report_store8_noabort+0x17/0x20 [ 49.080509] detach_if_pending+0x557/0x610 [ 49.081094] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.081801] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.082422] ? lock_timer_base+0x1a3/0x2b0 [ 49.082992] ? lock_timer_base+0x1eb/0x2b0 [ 49.083563] ? __internal_add_timer+0x2d0/0x2d0 [ 49.084189] ? lock_downgrade+0x990/0x990 [ 49.084756] ? trace_hardirqs_on+0xd/0x10 [ 49.085318] try_to_del_timer_sync+0xa2/0x120 [ 49.085918] ? del_timer+0x130/0x130 [ 49.086419] ? del_timer_sync+0xeb/0x240 [ 49.086970] del_timer_sync+0x18a/0x240 [ 49.087510] tun_free_netdev+0x105/0x1b0 [ 49.088056] ? tun_xdp+0x410/0x410 [ 49.088535] ? cpumask_next+0x24/0x30 [ 49.089066] ? netdev_refcnt_read+0xed/0x150 [ 49.090813] ? tun_xdp+0x410/0x410 [ 49.094323] netdev_run_todo+0x870/0xca0 [ 49.098353] ? do_group_exit+0x149/0x400 [ 49.102384] ? mark_held_locks+0xaf/0x100 [ 49.106505] ? register_netdev+0x30/0x30 [ 49.110543] ? find_held_lock+0x35/0x1d0 [ 49.114585] ? lock_downgrade+0x990/0x990 [ 49.118707] ? refcount_sub_and_test+0x115/0x1b0 [ 49.123430] ? refcount_inc+0x50/0x50 [ 49.127199] ? refcount_inc+0x50/0x50 [ 49.130971] ? sk_destruct+0x4c/0x80 [ 49.134651] ? __sk_free+0x5c/0x230 [ 49.138245] ? sk_free+0x2f/0x40 [ 49.141579] ? __tun_detach+0x176/0x1390 [ 49.145619] ? tun_attach+0xfa0/0xfa0 [ 49.149392] ? lock_downgrade+0x990/0x990 [ 49.153513] ? locks_remove_file+0x3fa/0x5a0 [ 49.157891] ? fcntl_setlk+0x10c0/0x10c0 [ 49.161923] ? __fsnotify_parent+0xb4/0x3a0 [ 49.166212] ? fsnotify+0x1af0/0x1af0 [ 49.169986] ? __tun_detach+0x1390/0x1390 [ 49.174104] rtnl_unlock+0xe/0x10 [ 49.177523] tun_chr_close+0x49/0x60 [ 49.181203] __fput+0x327/0x7e0 [ 49.184454] ? fput+0x140/0x140 [ 49.187704] ? check_same_owner+0x320/0x320 [ 49.191993] ? _raw_spin_unlock_irq+0x27/0x70 [ 49.196461] ____fput+0x15/0x20 [ 49.199712] task_work_run+0x199/0x270 [ 49.203574] ? task_work_cancel+0x210/0x210 [ 49.207864] ? _raw_spin_unlock+0x22/0x30 [ 49.211979] ? switch_task_namespaces+0x87/0xc0 [ 49.216624] do_exit+0x9b5/0x1ad0 [ 49.220048] ? kvfree+0x3b/0x60 [ 49.223300] ? mm_update_next_owner+0x930/0x930 [ 49.227935] ? find_held_lock+0x35/0x1d0 [ 49.231971] ? handle_mm_fault+0x248/0x8d0 [ 49.236174] ? find_held_lock+0x35/0x1d0 [ 49.240214] ? __do_page_fault+0x64c/0xd60 [ 49.244415] ? lock_downgrade+0x990/0x990 [ 49.248535] ? handle_mm_fault+0x410/0x8d0 [ 49.252736] ? __do_page_fault+0x31e/0xd60 [ 49.256939] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.261491] ? vmacache_find+0x5f/0x280 [ 49.265439] ? up_read+0x1a/0x40 [ 49.268773] ? __do_page_fault+0x3d6/0xd60 [ 49.272980] ? mm_fault_error+0x2c0/0x2c0 [ 49.277095] ? do_vfs_ioctl+0x486/0x1520 [ 49.281131] ? do_page_fault+0xee/0x720 [ 49.285074] ? __do_page_fault+0xd60/0xd60 [ 49.289277] ? putname+0xf3/0x130 [ 49.292703] do_group_exit+0x149/0x400 [ 49.296561] ? SyS_exit+0x30/0x30 [ 49.299981] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.304967] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.309691] SyS_exit_group+0x1d/0x20 [ 49.313478] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.318206] RIP: 0033:0x443708 [ 49.321364] RSP: 002b:00007ffe89ff1ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 49.329043] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443708 [ 49.336278] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 49.343515] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 49.350751] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 49.357987] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000 [ 49.365242] [ 49.366839] Allocated by task 2975: [ 49.370440] save_stack_trace+0x16/0x20 [ 49.374385] save_stack+0x43/0xd0 [ 49.377803] kasan_kmalloc+0xad/0xe0 [ 49.381486] __kmalloc_node+0x47/0x70 [ 49.385254] kvmalloc_node+0x64/0xd0 [ 49.388935] alloc_netdev_mqs+0x16e/0xed0 [ 49.393054] __tun_chr_ioctl+0x12b2/0x3d20 [ 49.397252] tun_chr_ioctl+0x2a/0x40 [ 49.400933] do_vfs_ioctl+0x1b1/0x1520 [ 49.404784] SyS_ioctl+0x8f/0xc0 [ 49.408119] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.412838] [ 49.414431] Freed by task 2975: [ 49.417675] save_stack_trace+0x16/0x20 [ 49.421614] save_stack+0x43/0xd0 [ 49.425036] kasan_slab_free+0x71/0xc0 [ 49.428887] kfree+0xca/0x250 [ 49.431957] kvfree+0x36/0x60 [ 49.435026] free_netdev+0x2cf/0x360 [ 49.438706] __tun_chr_ioctl+0x2cea/0x3d20 [ 49.442906] tun_chr_ioctl+0x2a/0x40 [ 49.446584] do_vfs_ioctl+0x1b1/0x1520 [ 49.450435] SyS_ioctl+0x8f/0xc0 [ 49.453767] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.458485] [ 49.460081] The buggy address belongs to the object at ffff8801d1010380 [ 49.460081] which belongs to the cache kmalloc-16384 of size 16384 [ 49.473050] The buggy address is located 13112 bytes inside of [ 49.473050] 16384-byte region [ffff8801d1010380, ffff8801d1014380) [ 49.485235] The buggy address belongs to the page: [ 49.490131] page:ffffea0007440400 count:1 mapcount:0 mapping:ffff8801d1010380 index:0x0 compound_mapcount: 0 [ 49.500066] flags: 0x200000000008100(slab|head) [ 49.504703] raw: 0200000000008100 ffff8801d1010380 0000000000000000 0000000100000001 [ 49.512563] raw: ffffea000747a020 ffff8801dac01c48 ffff8801dac02200 0000000000000000 [ 49.520410] page dumped because: kasan: bad access detected [ 49.526083] [ 49.527674] Memory state around the buggy address: [ 49.532568] ffff8801d1013580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.539892] ffff8801d1013600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.547214] >ffff8801d1013680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.554538] ^ [ 49.559865] ffff8801d1013700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.567188] ffff8801d1013780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 49.574512] ================================================================== [ 49.581834] Disabling lock debugging due to kernel taint [ 49.587247] Kernel panic - not syncing: panic_on_warn set ... [ 49.587247] [ 49.594575] CPU: 0 PID: 2975 Comm: syzkaller198869 Tainted: G B 4.14.0-rc5+ #136 [ 49.603198] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 49.612515] Call Trace: [ 49.615076] dump_stack+0x194/0x257 [ 49.618671] ? arch_local_irq_restore+0x53/0x53 [ 49.623303] ? kasan_end_report+0x32/0x50 [ 49.627417] ? lock_downgrade+0x990/0x990 [ 49.631532] ? detach_if_pending+0x510/0x610 [ 49.635905] panic+0x1e4/0x417 [ 49.639064] ? __warn+0x1d9/0x1d9 [ 49.642488] ? detach_if_pending+0x557/0x610 [ 49.646858] kasan_end_report+0x50/0x50 [ 49.650797] kasan_report+0x144/0x340 [ 49.654565] __asan_report_store8_noabort+0x17/0x20 [ 49.659544] detach_if_pending+0x557/0x610 [ 49.663745] ? trace_raw_output_tick_stop+0x130/0x130 [ 49.668900] ? _raw_spin_lock_irqsave+0x9e/0xc0 [ 49.673532] ? lock_timer_base+0x1a3/0x2b0 [ 49.677732] ? lock_timer_base+0x1eb/0x2b0 [ 49.681931] ? __internal_add_timer+0x2d0/0x2d0 [ 49.686564] ? lock_downgrade+0x990/0x990 [ 49.690675] ? trace_hardirqs_on+0xd/0x10 [ 49.694791] try_to_del_timer_sync+0xa2/0x120 [ 49.699248] ? del_timer+0x130/0x130 [ 49.702925] ? del_timer_sync+0xeb/0x240 [ 49.706952] del_timer_sync+0x18a/0x240 [ 49.710893] tun_free_netdev+0x105/0x1b0 [ 49.714917] ? tun_xdp+0x410/0x410 [ 49.718421] ? cpumask_next+0x24/0x30 [ 49.722190] ? netdev_refcnt_read+0xed/0x150 [ 49.726563] ? tun_xdp+0x410/0x410 [ 49.730068] netdev_run_todo+0x870/0xca0 [ 49.734094] ? do_group_exit+0x149/0x400 [ 49.738122] ? mark_held_locks+0xaf/0x100 [ 49.742232] ? register_netdev+0x30/0x30 [ 49.746258] ? find_held_lock+0x35/0x1d0 [ 49.750289] ? lock_downgrade+0x990/0x990 [ 49.754404] ? refcount_sub_and_test+0x115/0x1b0 [ 49.759124] ? refcount_inc+0x50/0x50 [ 49.762888] ? refcount_inc+0x50/0x50 [ 49.766655] ? sk_destruct+0x4c/0x80 [ 49.770332] ? __sk_free+0x5c/0x230 [ 49.773924] ? sk_free+0x2f/0x40 [ 49.777254] ? __tun_detach+0x176/0x1390 [ 49.781282] ? tun_attach+0xfa0/0xfa0 [ 49.785049] ? lock_downgrade+0x990/0x990 [ 49.789166] ? locks_remove_file+0x3fa/0x5a0 [ 49.793542] ? fcntl_setlk+0x10c0/0x10c0 [ 49.797569] ? __fsnotify_parent+0xb4/0x3a0 [ 49.801858] ? fsnotify+0x1af0/0x1af0 [ 49.805625] ? __tun_detach+0x1390/0x1390 [ 49.809741] rtnl_unlock+0xe/0x10 [ 49.813156] tun_chr_close+0x49/0x60 [ 49.816839] __fput+0x327/0x7e0 [ 49.820088] ? fput+0x140/0x140 [ 49.823336] ? check_same_owner+0x320/0x320 [ 49.827628] ? _raw_spin_unlock_irq+0x27/0x70 [ 49.832095] ____fput+0x15/0x20 [ 49.835341] task_work_run+0x199/0x270 [ 49.839192] ? task_work_cancel+0x210/0x210 [ 49.843478] ? _raw_spin_unlock+0x22/0x30 [ 49.847594] ? switch_task_namespaces+0x87/0xc0 [ 49.852230] do_exit+0x9b5/0x1ad0 [ 49.855651] ? kvfree+0x3b/0x60 [ 49.858895] ? mm_update_next_owner+0x930/0x930 [ 49.863529] ? find_held_lock+0x35/0x1d0 [ 49.867559] ? handle_mm_fault+0x248/0x8d0 [ 49.871760] ? find_held_lock+0x35/0x1d0 [ 49.875791] ? __do_page_fault+0x64c/0xd60 [ 49.879990] ? lock_downgrade+0x990/0x990 [ 49.884109] ? handle_mm_fault+0x410/0x8d0 [ 49.888306] ? __do_page_fault+0x31e/0xd60 [ 49.892506] ? __handle_mm_fault+0x39c0/0x39c0 [ 49.897052] ? vmacache_find+0x5f/0x280 [ 49.900994] ? up_read+0x1a/0x40 [ 49.904326] ? __do_page_fault+0x3d6/0xd60 [ 49.908528] ? mm_fault_error+0x2c0/0x2c0 [ 49.912640] ? do_vfs_ioctl+0x486/0x1520 [ 49.916667] ? do_page_fault+0xee/0x720 [ 49.920607] ? __do_page_fault+0xd60/0xd60 [ 49.924808] ? putname+0xf3/0x130 [ 49.928228] do_group_exit+0x149/0x400 [ 49.932081] ? SyS_exit+0x30/0x30 [ 49.935499] ? trace_hardirqs_on_caller+0x421/0x5c0 [ 49.940481] ? trace_hardirqs_on_thunk+0x1a/0x1c [ 49.945201] SyS_exit_group+0x1d/0x20 [ 49.948968] entry_SYSCALL_64_fastpath+0x1f/0xbe [ 49.953687] RIP: 0033:0x443708 [ 49.956842] RSP: 002b:00007ffe89ff1ba8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 [ 49.964514] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443708 [ 49.971748] RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 [ 49.978982] RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd0 [ 49.986220] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [ 49.993457] R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000